Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

VoteProxy2 #8

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ds-chief
2 changes: 1 addition & 1 deletion lib/ds-test
Submodule ds-test updated 2 files
+0 −6 Dappfile
+2 −2 src/test.sol
2 changes: 1 addition & 1 deletion lib/ds-token
52 changes: 0 additions & 52 deletions src/VoteProxy.sol

This file was deleted.

208 changes: 0 additions & 208 deletions src/VoteProxy.t.sol

This file was deleted.

58 changes: 58 additions & 0 deletions src/VoteProxy2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// VoteProxy2 - A cold/hot proxy contract and key setup for voting on DSChief
pragma solidity >=0.5.6;

import 'ds-token/token.sol';
import 'ds-chief/chief.sol';

contract VoteProxy2 {
address public cold;
address public hot;
DSToken public GOV;
DSToken public IOU;
DSChief chief;

event Touch(address indexed sender, bytes4 func);

constructor(DSChief chief_, address cold_, address hot_)
public
{
chief = chief_;
cold = cold_;
hot = hot_;
GOV = chief.GOV();
IOU = chief.IOU();
GOV.approve(address(chief), uint256(-1));
IOU.approve(address(chief), uint256(-1));
}

// Hot and Cold addresses end up with same access tier - this is
// because `release` pushes to the Cold address, not to the sender
modifier controlled() {
require(msg.sender == cold || msg.sender == hot);
emit Touch(msg.sender, msg.sig);
_;
}

function vote(bytes32 slate)
public controlled
{
chief.vote(slate);
}
function lock(uint256 wad)
public controlled
{
chief.lock(wad);
}
function free(uint256 wad)
public controlled
{
chief.free(wad);
}
function release(uint256 wad)
public controlled
{
GOV.push(cold, wad);
}
}


Loading