-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTimelockProxy.sol
43 lines (30 loc) · 1.17 KB
/
TimelockProxy.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
pragma solidity ^0.5.0;
//Import Upgradeability Template
import "zos-lib/contracts/upgradeability/UpgradeabilityProxy.sol";
//Timelock Template
import '../openzeppelin/TokenTimelock.sol';
//Beneficieries template
import "../helpers/BeneficiaryOperations.sol";
/**
* @title TimelockProxy
* @notice A proxy contract that serves the latest implementation of TimelockProxy.
*/
contract TimelockProxy is UpgradeabilityProxy, TokenTimelock, BeneficiaryOperations {
constructor (address _implementation, IERC20 _token, address _beneficiary, uint256 _releaseTime)
UpgradeabilityProxy(_implementation, "")
TokenTimelock(_token, msg.sender, _releaseTime) public {}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the group of beneficiaries can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) public onlyManyBeneficiaries {
_upgradeTo(newImplementation);
}
/**
* @return The address of the implementation.
*/
function implementation() public view returns (address) {
return _implementation();
}
}