Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.