Ether e Wei

# Ether e Wei

Transações são pagas com ether.

Da mesma forma que 1 real equivale a 100 centavos, 1 ether equivale a 1018 wei.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract UnidadesEther {
    uint public oneWei = 1 wei;
    // 1 wei é igual a 1
    bool public isOneWei = 1 wei == 1;

    uint public oneEther = 1 ether;
    // 1 ether é igual a 10^18 wei
    bool public isOneEther = 1 ether == 1e18;
}

# Teste no Remix

Last Updated: 22/01/2024 22:26:13