Skip to content

Instantly share code, notes, and snippets.

@andreafspeziale
Last active April 11, 2019 11:05
Show Gist options
  • Save andreafspeziale/2b3524f245c9133e6ce0ce3e870a46dd to your computer and use it in GitHub Desktop.
Save andreafspeziale/2b3524f245c9133e6ce0ce3e870a46dd to your computer and use it in GitHub Desktop.
contract Wallet {
  ...
  address public logic_;
  /**
   * @dev Deposit any ERC20 token into this wallet.
   * @param _token The address of the existing token contract.
   * @param _amount The amount of tokens to deposit.
   * @return Bool if the deposit was successful.
   */
  function depositERC20Token (
    address _token,
    uint256 _amount
  ) external
    returns(bool)
  {
    ...
    require(logic_.delegatecall(bytes4(sha3('deposit(address,uint256)')), _token, _amount));
    return true;
  }
}
@andreafspeziale
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment