Created
October 10, 2019 03:05
-
-
Save max-blaushild/06009ebcb48485fba974d5b92a8707f3 to your computer and use it in GitHub Desktop.
MKR Vote Proxy
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
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