Skip to content

Instantly share code, notes, and snippets.

@aunyks
Last active August 17, 2017 17:52
Show Gist options
  • Save aunyks/fc9565dd99264b336564a299d259ddde to your computer and use it in GitHub Desktop.
Save aunyks/fc9565dd99264b336564a299d259ddde to your computer and use it in GitHub Desktop.
contract MyERCToken {
// In this case, the total supply
// of MyERCToken is fixed, but
// it can very much be changed
uint256 _totalSupply = 1000000;
function totalSupply() constant returns (uint256 theTotalSupply) {
// Because our function signature
// states that the returning variable
// is "theTotalSupply", we'll just set that variable
// to the value of the instance variable "_totalSupply"
// and return it
theTotalSupply = _totalSupply;
return theTotalSupply;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment