Skip to content

Instantly share code, notes, and snippets.

@max-blaushild
Created October 10, 2019 03:05
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 max-blaushild/06009ebcb48485fba974d5b92a8707f3 to your computer and use it in GitHub Desktop.
Save max-blaushild/06009ebcb48485fba974d5b92a8707f3 to your computer and use it in GitHub Desktop.
MKR Vote Proxy
constructor(DSChief _chief, address _cold, address _hot) public {
chief = _chief;
cold = _cold;
hot = _hot;
gov = chief.GOV();
iou = chief.IOU();
gov.approve(address(chief));
iou.approve(address(chief));
}
modifier auth() {
require(msg.sender == hot || msg.sender == cold, "Sender must be a Cold or Hot Wallet");
_;
}
function lock() public auth {
if (gov.balanceOf(address(this)) > 0) {
chief.lock(gov.balanceOf(address(this)));
}
}
function release() public auth {
chief.free(chief.deposits(address(this)));
gov.push(cold, gov.balanceOf(address(this)));
}
function voteAddresses(address[] memory issues) public auth returns (bytes32) {
lock();
return chief.vote(issues);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment