// SPDX-License-Identifier: CC0-1.0
pragmasolidity^0.8.0;import"@openzeppelin/contracts/token/ERC721/IERC721.sol";/**
* @title Non-Fungible Vesting Token Standard.
* @notice A non-fungible token standard used to vest ERC-20 tokens over a vesting release curve
* scheduled using timestamps.
* 一种非同质化 token 标准,用于通过使用时间戳计划的 vesting 释放曲线来分配 ERC-20 token。
* @dev 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 allotted for a specific Vesting NFT.
* 由于此标准依赖于时间戳进行归属计划,因此跟踪每个归属 NFT 声明的 token 非常重要,这样用户才不会提取比特定归属 NFT 分配的 token 更多。
* @custom:interface-id 0xbd3a202b
*/interfaceIERC5725isIERC721{/**
* 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.
*/eventPayoutClaimed(uint256indexedtokenId,addressindexedrecipient,uint256claimAmount);/**
* This event is emitted when an `owner` sets an address to manage token claims for all tokens.
* @param owner The address setting a manager to manage all tokens.
* @param spender The address being permitted to manage all tokens.
* @param approved A boolean indicating whether the spender is approved to claim for all tokens.
*/eventClaimApprovalForAll(addressindexedowner,addressindexedspender,boolapproved);/**
* This event is emitted when an `owner` sets an address to manage token claims for a `tokenId`.
* @param owner The `owner` of `tokenId`.
* @param spender The address being permitted to manage a tokenId.
* @param tokenId The unique identifier of the token being managed.
* @param approved A boolean indicating whether the spender is approved to claim for `tokenId`.
*/eventClaimApproval(addressindexedowner,addressindexedspender,uint256indexedtokenId,boolapproved);/**
* @notice Claim the pending payout for the NFT.
* @notice 声明 NFT 的待处理付款。
* @dev MUST grant the claimablePayout value at the time of claim being called to `msg.sender`.
* MUST revert if not called by the token owner or approved users.
* MUST emit PayoutClaimed.
* SHOULD revert if there is nothing to claim.
* @param tokenId The NFT token id.
*/functionclaim(uint256tokenId)external;/**
* @notice Number of tokens for the NFT which have been claimed at the current timestamp.
* @notice 在当前时间戳已声明的 NFT 的 token 数量。
* @param tokenId The NFT token id.
* @return payout The total amount of payout tokens claimed for this NFT.
*/functionclaimedPayout(uint256tokenId)externalviewreturns(uint256payout);/**
* @notice Number of tokens for the NFT which can be claimed at the current timestamp.
* @notice 可以在当前时间戳声明的 NFT 的 token 数量。
* @dev It is RECOMMENDED that this is calculated as the `vestedPayout()` subtracted from `payoutClaimed()`.
* 建议将其计算为从 `vestedPayout()` 中减去的 `payoutClaimed()`。
* @param tokenId The NFT token id.
* @return payout The amount of unlocked payout tokens for the NFT which have not yet been claimed.
*/functionclaimablePayout(uint256tokenId)externalviewreturns(uint256payout);/**
* @notice Total amount of tokens which have been vested at the current timestamp.
* This number also includes vested tokens which have been claimed.
* @notice 在当前时间戳已 vesting 的 token 总量。
* 此数字还包括已声明的 vesting token。
* @dev It is RECOMMENDED that this function calls `vestedPayoutAtTime`
* with `block.timestamp` as the `timestamp` parameter.
* 建议此函数使用 `block.timestamp` 作为 `timestamp` 参数调用 `vestedPayoutAtTime`。
* @param tokenId The NFT token id.
* @return payout Total amount of tokens which have been vested at the current timestamp.
*/functionvestedPayout(uint256tokenId)externalviewreturns(uint256payout);/**
* @notice Total amount of vested tokens at the provided timestamp.
* This number also includes vested tokens which have been claimed.
* @notice 在提供的时间戳已 vesting 的 token 总量。
* 此数字还包括已声明的 vesting token。
* @dev `timestamp` MAY be both in the future and in the past.
* Zero MUST be returned if the timestamp is before the token was minted.
* `timestamp` 可以是将来和过去的时间。
* 如果时间戳在 token 创建之前,则必须返回零。
* @param tokenId The NFT token id.
* @param timestamp The timestamp to check on, can be both in the past and the future.
* @return payout Total amount of tokens which have been vested at the provided timestamp.
*/functionvestedPayoutAtTime(uint256tokenId,uint256timestamp)externalviewreturns(uint256payout);/**
* @notice Number of tokens for an NFT which are currently vesting.
* @notice 当前正在 vesting 的 NFT 的 token 数量。
* @dev The sum of vestedPayout and vestingPayout SHOULD always be the total payout.
* vestedPayout 和 vestingPayout 的总和应始终为总付款。
* @param tokenId The NFT token id.
* @return payout The number of tokens for the NFT which are vesting until a future date.
*/functionvestingPayout(uint256tokenId)externalviewreturns(uint256payout);/**
* @notice 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`.
* @notice 提供的 NFT 归属的开始和结束时间戳。
* 必须返回 `vestingEnd` 的 vestedPayout 不再增加的时间戳。
* @param tokenId The NFT token id.
* @return vestingStart The beginning of the vesting as a unix timestamp.
* @return vestingEnd The ending of the vesting as a unix timestamp.
*/functionvestingPeriod(uint256tokenId)externalviewreturns(uint256vestingStart,uint256vestingEnd);/**
* @notice Token which is used to pay out the vesting claims.
* @notice 用于支付归属声明的 token。
* @param tokenId The NFT token id.
* @return token The token which is used to pay out the vesting claims.
*/functionpayoutToken(uint256tokenId)externalviewreturns(addresstoken);/**
* @notice Sets a global `operator` with permission to manage all tokens owned by the current `msg.sender`.
* @notice 设置一个全局 `operator`,该 `operator` 有权管理当前 `msg.sender` 拥有的所有 token。
* @param operator The address to let manage all tokens.
* @param approved A boolean indicating whether the spender is approved to claim for all tokens.
*/functionsetClaimApprovalForAll(addressoperator,boolapproved)external;/**
* @notice Sets a tokenId `operator` with permission to manage a single `tokenId` owned by the `msg.sender`.
* @notice 设置一个 tokenId `operator`,该 `operator` 有权管理 `msg.sender` 拥有的单个 `tokenId`。
* @param operator The address to let manage a single `tokenId`.
* @param tokenId the `tokenId` to be managed.
* @param approved A boolean indicating whether the spender is approved to claim for all tokens.
*/functionsetClaimApproval(addressoperator,boolapproved,uint256tokenId)external;/**
* @notice Returns true if `owner` has set `operator` to manage all `tokenId`s.
* @notice 如果 `owner` 已设置 `operator` 来管理所有 `tokenId`,则返回 true。
* @param owner The owner allowing `operator` to manage all `tokenId`s.
* @param operator The address who is given permission to spend tokens on behalf of the `owner`.
*/functionisClaimApprovedForAll(addressowner,addressoperator)externalviewreturns(boolisClaimApproved);/**
* @notice Returns the operating address for a `tokenId`.
* If `tokenId` is not managed, then returns the zero address.
* @notice 返回 `tokenId` 的操作地址。
* 如果未管理 `tokenId`,则返回零地址。
* @param tokenId The NFT `tokenId` to query for a `tokenId` manager.
*/functiongetClaimApproved(uint256tokenId)externalviewreturns(addressoperator);}