Skip to content

Instantly share code, notes, and snippets.

@Solexplorer
Created June 8, 2019 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Solexplorer/1cb250e4c3e95c3372f91f0ea1db4e39 to your computer and use it in GitHub Desktop.
Save Solexplorer/1cb250e4c3e95c3372f91f0ea1db4e39 to your computer and use it in GitHub Desktop.
Transfer function
function transfer(address recipient, uint256 amount) public returns (bool) {
require(sender != address(0));
require(recipient != address(0));
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment