Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@izqui
Created February 11, 2019 20:44
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 izqui/d326b0197fdce62be0fd72253d06b08b to your computer and use it in GitHub Desktop.
Save izqui/d326b0197fdce62be0fd72253d06b08b to your computer and use it in GitHub Desktop.
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