Commit f641feab by github-actions

Transpile fd483a59

parent bd45e2d3
...@@ -25,6 +25,11 @@ contract TokenTimelockUpgradeable is Initializable { ...@@ -25,6 +25,11 @@ contract TokenTimelockUpgradeable is Initializable {
// timestamp when token release is enabled // timestamp when token release is enabled
uint256 private _releaseTime; uint256 private _releaseTime;
/**
* @dev Deploys a timelock instance that is able to hold the token specified, and will only release it to
* `beneficiary_` when {release} is invoked after `releaseTime_`. The release time is specified as a Unix timestamp
* (in seconds).
*/
function __TokenTimelock_init( function __TokenTimelock_init(
IERC20Upgradeable token_, IERC20Upgradeable token_,
address beneficiary_, address beneficiary_,
...@@ -45,28 +50,29 @@ contract TokenTimelockUpgradeable is Initializable { ...@@ -45,28 +50,29 @@ contract TokenTimelockUpgradeable is Initializable {
} }
/** /**
* @return the token being held. * @dev Returns the token being held.
*/ */
function token() public view virtual returns (IERC20Upgradeable) { function token() public view virtual returns (IERC20Upgradeable) {
return _token; return _token;
} }
/** /**
* @return the beneficiary of the tokens. * @dev Returns the beneficiary that will receive the tokens.
*/ */
function beneficiary() public view virtual returns (address) { function beneficiary() public view virtual returns (address) {
return _beneficiary; return _beneficiary;
} }
/** /**
* @return the time when the tokens are released. * @dev Returns the time when the tokens are released in seconds since Unix epoch (i.e. Unix timestamp).
*/ */
function releaseTime() public view virtual returns (uint256) { function releaseTime() public view virtual returns (uint256) {
return _releaseTime; return _releaseTime;
} }
/** /**
* @notice Transfers tokens held by timelock to beneficiary. * @dev Transfers tokens held by the timelock to the beneficiary. Will only succeed if invoked after the release
* time.
*/ */
function release() public virtual { function release() public virtual {
require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time"); require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment