Skip to content

Instantly share code, notes, and snippets.

@RaghavSood
Created September 4, 2018 17:34
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 RaghavSood/a1c27edaf189576174f8718085a13697 to your computer and use it in GitHub Desktop.
Save RaghavSood/a1c27edaf189576174f8718085a13697 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.0;
contract MyToken {
mapping(address => uint256) public balances;
uint256 public totalSupply_;
constructor (address addr) public {
totalSupply_= 10000;
balances[addr] = totalSupply_;
}
function transfer(address _to, uint256 _value) public {
require(_value <= balances[msg.sender]);
}
}
contract D {
function doTransfer(address newTokenHolder, MyToken erc20Toekn) external {
erc20Toekn.transfer(newTokenHolder, 20);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment