-
Notifications
You must be signed in to change notification settings - Fork 47
/
TimelockHarness.sol
40 lines (30 loc) · 980 Bytes
/
TimelockHarness.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pragma solidity ^0.5.16;
import "../governance/Timelock.sol";
interface Administered {
function _acceptAdmin() external returns (uint256);
}
contract TimelockHarness is Timelock {
constructor(address admin_, uint256 delay_) public Timelock(admin_, delay_) {}
function setDelayWithoutChecking(uint256 delay_) public {
delay = delay_;
emit NewDelay(delay);
}
function harnessSetPendingAdmin(address pendingAdmin_) public {
pendingAdmin = pendingAdmin_;
}
function harnessSetAdmin(address admin_) public {
admin = admin_;
}
}
contract TimelockTest is Timelock {
constructor(address admin_, uint256 delay_) public Timelock(admin_, 2 days) {
delay = delay_;
}
function harnessSetAdmin(address admin_) public {
require(msg.sender == admin);
admin = admin_;
}
function harnessAcceptAdmin(Administered administered) public {
administered._acceptAdmin();
}
}