mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Docs Solidity by example
This commit is contained in:
@@ -38,9 +38,6 @@ and the sum of all balances is an invariant across the lifetime of the contract.
|
||||
event Transfer(address from, address to, uint amount);
|
||||
event Approval(address owner, address spender, uint amount);
|
||||
|
||||
function balanceOf(address tokenOwner) public view returns (uint balance) {
|
||||
return balances[tokenOwner];
|
||||
}
|
||||
function transfer(address to, uint amount) public returns (bool success) {
|
||||
balances.move(msg.sender, to, amount);
|
||||
emit Transfer(msg.sender, to, amount);
|
||||
@@ -62,4 +59,8 @@ and the sum of all balances is an invariant across the lifetime of the contract.
|
||||
emit Approval(msg.sender, spender, tokens);
|
||||
return true;
|
||||
}
|
||||
|
||||
function balanceOf(address tokenOwner) public view returns (uint balance) {
|
||||
return balances[tokenOwner];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user