-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathLockup.sol
61 lines (49 loc) · 1.6 KB
/
Lockup.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import "OpusToken.sol";
import "SafeMath.sol";
contract Lockup {
using SafeMath for uint256;
address public foundation;
address public candidate;
address public multisig;
address public tokenAddress = address(0x4355fC160f74328f9b383dF2EC589bB3dFd82Ba0);
OpusToken public Opus = OpusToken(tokenAddress);
uint256 public lockupBlocks = 1261000;
uint256 public endBlock;
modifier onlyFoundation() {
if (msg.sender != foundation) {
throw;
}
_;
}
function Lockup(address _multisig) {
multisig = _multisig;
foundation = msg.sender;
endBlock = lockupBlocks.add(block.number);
}
function tokenFallback(address _from, uint256 _value, bytes _data) external {
return;
}
function withdraw(uint256 value) onlyFoundation {
if(block.number < endBlock) {
throw;
}
Opus.transfer(multisig, value);
}
function setMultisig(address addr) external onlyFoundation {
if (addr == address(0)) throw;
multisig = addr;
}
function proposeFoundationTransfer(address newFoundation) external onlyFoundation {
//propose new owner
candidate = newFoundation;
}
function cancelFoundationTransfer() external onlyFoundation {
candidate = address(0);
}
function acceptFoundationTransfer() external {
//new owner accept transfer to complete transfer
if(msg.sender != candidate) throw;
foundation = candidate;
candidate = address(0);
}
}