Skip to content

Instantly share code, notes, and snippets.

@seanwbren
Last active August 30, 2018 21:18
Show Gist options
  • Save seanwbren/9ca07895aa1a321ed471eb226696b11e to your computer and use it in GitHub Desktop.
Save seanwbren/9ca07895aa1a321ed471eb226696b11e to your computer and use it in GitHub Desktop.
contract MyContract {
DaiContract dai = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359;
function foo(uint amt) public {
require(dai.balanceOf(msg.sender) >= amt && dai.allowance(msg.sender, address(this)) >= amt);
require(dai.transferFrom(msg.sender, address(this), amt));
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment