Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
dee772a5
Commit
dee772a5
authored
Jan 12, 2022
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation to TokenTimelock
parent
1051db38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
TokenTimelock.sol
contracts/token/ERC20/utils/TokenTimelock.sol
+10
-4
No files found.
contracts/token/ERC20/utils/TokenTimelock.sol
View file @
dee772a5
...
@@ -24,6 +24,11 @@ contract TokenTimelock {
...
@@ -24,6 +24,11 @@ contract TokenTimelock {
// timestamp when token release is enabled
// timestamp when token release is enabled
uint256 private immutable _releaseTime;
uint256 private immutable _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).
*/
constructor(
constructor(
IERC20 token_,
IERC20 token_,
address beneficiary_,
address beneficiary_,
...
@@ -36,28 +41,29 @@ contract TokenTimelock {
...
@@ -36,28 +41,29 @@ contract TokenTimelock {
}
}
/**
/**
* @
return
the token being held.
* @
dev Returns
the token being held.
*/
*/
function token() public view virtual returns (IERC20) {
function token() public view virtual returns (IERC20) {
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");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment