Docs Solidity by example

This commit is contained in:
Leonardo Alt
2019-12-13 16:19:49 +01:00
parent c084f6462d
commit 7a2893842d
4 changed files with 75 additions and 86 deletions
+4 -3
View File
@@ -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];
}
}