Ether

Solidity

परिभाषा

Ether (ETH) Ethereum blockchain की native cryptocurrency है। Solidity में, ether को wei में measure किया जाता है (1 ether = 10^18 wei)। Solidity built-in units provide करता है: wei, gwei, ether। Payable functions ether receive कर सकते हैं।

English version

Ether (ETH) is the native cryptocurrency of the Ethereum blockchain. In Solidity, ether is measured in wei (1 ether = 10^18 wei). Solidity provides built-in units: wei, gwei, ether. Payable functions can receive ether.

Code Example

// Unités Ether
uint256 oneWei = 1 wei;
uint256 oneGwei = 1 gwei; // = 10^9 wei
uint256 oneEther = 1 ether; // = 10^18 wei

// Fonction payable
function deposit() public payable {
    require(msg.value >= 0.1 ether, "Minimum 0.1 ETH");
}

// Envoyer de l'Ether
payable(recipient).transfer(1 ether);

संबंधित शब्द

Solingo पर इस concept को practice करें

Ether को interactive exercises और integrated IDE के साथ master करें।

मुफ्त में शुरू करें