Skip to content

Latest commit

 

History

History
165 lines (114 loc) · 4.95 KB

File metadata and controls

165 lines (114 loc) · 4.95 KB

Solidity API

IERC5725

A non-fungible token standard used to vest tokens (EIP-20 or otherwise) over a vesting release curve scheduled using timestamps.

Because this standard relies on timestamps for the vesting schedule, it's important to keep track of the tokens claimed per Vesting NFT so that a user cannot withdraw more tokens than alloted for a specific Vesting NFT.

PayoutClaimed

event PayoutClaimed(uint256 tokenId, address recipient, uint256 claimAmount)

This event is emitted when the payout is claimed through the claim function @param tokenId the NFT tokenId of the assets being claimed. @param recipient The address which is receiving the payout. @param claimAmount The amount of tokens being claimed.

claim

function claim(uint256 tokenId) external

Claim the pending payout for the NFT

MUST grant the claimablePayout value at the time of claim being called MUST revert if not called by the token owner or approved users MUST emit PayoutClaimed SHOULD revert if there is nothing to claim

Name Type Description
tokenId uint256 The NFT token id

claimedPayout

function claimedPayout(uint256 tokenId) external view returns (uint256 payout)

Number of tokens for the NFT which have been claimed at the current timestamp

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
payout uint256 The total amount of payout tokens claimed for this NFT

claimablePayout

function claimablePayout(uint256 tokenId) external view returns (uint256 payout)

Number of tokens for the NFT which can be claimed at the current timestamp

It is RECOMMENDED that this is calculated as the vestedPayout() subtracted from payoutClaimed().

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
payout uint256 The amount of unlocked payout tokens for the NFT which have not yet been claimed

vestedPayout

function vestedPayout(uint256 tokenId) external view returns (uint256 payout)

Total amount of tokens which have been vested at the current timestamp. This number also includes vested tokens which have been claimed.

It is RECOMMENDED that this function calls vestedPayoutAtTime with block.timestamp as the timestamp parameter.

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
payout uint256 Total amount of tokens which have been vested at the current timestamp.

vestedPayoutAtTime

function vestedPayoutAtTime(uint256 tokenId, uint256 timestamp) external view returns (uint256 payout)

Total amount of vested tokens at the provided timestamp. This number also includes vested tokens which have been claimed.

timestamp MAY be both in the future and in the past. Zero MUST be returned if the timestamp is before the token was minted.

Name Type Description
tokenId uint256 The NFT token id
timestamp uint256 The timestamp to check on, can be both in the past and the future
Name Type Description
payout uint256 Total amount of tokens which have been vested at the provided timestamp

vestingPayout

function vestingPayout(uint256 tokenId) external view returns (uint256 payout)

Number of tokens for an NFT which are currently vesting.

The sum of vestedPayout and vestingPayout SHOULD always be the total payout.

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
payout uint256 The number of tokens for the NFT which are vesting until a future date.

vestingPeriod

function vestingPeriod(uint256 tokenId) external view returns (uint256 vestingStart, uint256 vestingEnd)

The start and end timestamps for the vesting of the provided NFT MUST return the timestamp where no further increase in vestedPayout occurs for vestingEnd.

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
vestingStart uint256 The beginning of the vesting as a unix timestamp
vestingEnd uint256 The ending of the vesting as a unix timestamp

payoutToken

function payoutToken(uint256 tokenId) external view returns (address token)

Token which is used to pay out the vesting claims

Name Type Description
tokenId uint256 The NFT token id
Name Type Description
token address The token which is used to pay out the vesting claims