Created
February 11, 2019 20:44
-
-
Save izqui/d326b0197fdce62be0fd72253d06b08b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./ERC20.sol"; | |
interface ApproveAndCallReceiver { | |
function receiveApproval(address _from, uint256 _amount, address _token, bytes memory _data) public; | |
} | |
contract BurnAndPropose is ApproveAndCallReceiver { | |
ERC20 constant public ANT = ERC20(0x960b236A07cf122663c4303350609A66A7B288C0); | |
address public voting; | |
uint256 public burn; | |
constructor (address _voting, uint256 _burn) public { | |
voting = _voting; | |
burn = _burn; | |
} | |
function receiveApproval(address _from, uint256 _amount, address _token, bytes memory _data) public { | |
require(msg.sender == address(ANT) && _token == address(ANT)); | |
require(_amount == burn); | |
ANT.transferFrom(_from, address(0xdead), burn); | |
require(voting.call(_data)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment