Comment on page
LinearTokenTimelock
A token timelock that releases continuously at the same rate
A timelock for releasing tokens over a continuous linear schedule. There is an appointed beneficiary who controls the tokens when vested. The beneficiary can set a new one if needed using the offer-accept pattern.
The contract maintains the following:
T
- a total token amount which includes any already released and locked tokens. It can increase if new tokens enter the timelock but it cannot decrease.C
- the current held tokens in the contract
The portion of T available for release is T*t/d.
The already released amount is T - C.
The net amount available for release is the total available minus already released. The beneficiary can claim these at any time, and distribute to any address.
Release
BeneficiaryUpdate
PendingBeneficiaryUpdate
A release of timelocked tokens
type | param | description |
address indexed | _beneficiary | the address that owns the timelocked tokens |
address indexed | _recipient | the address receiving this unlocked distribution |
uint256 | _amount | the amount of unlocked tokens released |
A change in beneficiary to the timelock
type | param | description |
address indexed | _beneficiary | the new beneficiary address |
A change in pending beneficiary to the timelock
type | param | description |
address indexed | _pendingBeneficiary | the new beneficiary address |
function lockedToken() external view returns (IERC20);
Returns the address of the locked token casted as an IERC20 interface.
function beneficiary() external view returns (address);
Returns the current beneficiary address.
function pendingBeneficiary() external view returns (address);
Returns the pending beneficiary, which could assume the beneficiary role at any time by calling
acceptBeneficiary()
function initialBalance() external view returns (uint256);
Returns the initial total amount of locked tokens. If new tokens are dropped into the timelock, this number increases to prevent accounting errors.
function availableForRelease() external view returns (uint256);
The amount of
lockedToken
available to be released by the beneficiary.function totalToken() external view returns(uint256);
Returns the total amount of tokens held by the timelock pending release.
function alreadyReleasedAmount() external view returns (uint256);
The amount of
lockedToken
already released by the beneficiary.function acceptBeneficiary() external;
Accepts the beneficiary role for
msg.sender
. Must already be the pending beneficiary.emits
BeneficiaryUpdate
function release(address to, uint amount) external;
Releases
amount
of timelocked tokens to address to
. The amount
must be less than or equal to the released amount of tokens.emits
Release
function setPendingBeneficiary(address _pendingBeneficiary) external;
Sets the pending beneficiary to
_pendingBeneficiary
.emits
PendingBeneficiaryUpdate
lineartokentimelock.json
4KB
Code
LinearTokenTimelock ABI
ilineartokentimelock.json
2KB
Code
LinearTokenTimelock Interface ABI
Last modified 2yr ago