ICommitToken
Inherits: IERC7540Redeem, EDenied, EInvalidAddress, EInvalidAmount, ENotSupported, EInvalidCaller, EInsufficientBalance, ESupplyCapped
Functions
requestWithdraw
Request an asynchronous withdrawal of assets
function requestWithdraw(uint256 assets, address controller, address owner) external returns (uint256 requestId);
Parameters
| Name | Type | Description |
|---|---|---|
assets | uint256 | Amount of assets to withdraw |
controller | address | Address that will control the request (must be msg.sender) |
owner | address | Address that owns the shares (must be msg.sender) |
Returns
| Name | Type | Description |
|---|---|---|
requestId | uint256 | ID of the request (always 0) |
cooldownRemaining
Returns the remaining cooldown time for a request
function cooldownRemaining(uint256 requestId, address owner) external view returns (uint48 cooldown);
Parameters
| Name | Type | Description |
|---|---|---|
requestId | uint256 | ID of the request (ignored) |
owner | address | Address that owns the shares (must be msg.sender) |
Returns
| Name | Type | Description |
|---|---|---|
cooldown | uint48 | Remaining cooldown time in seconds |
isClaimable
Returns true if a request is claimable
function isClaimable(uint256 requestId, address owner) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
requestId | uint256 | ID of the request (ignored) |
owner | address | Address that owns the shares (must be msg.sender) |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | true if the request is claimable, false otherwise |
supplyCap
Returns the current supply cap
function supplyCap() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Maximum total supply allowed |
supplyCapRemaining
Returns the remaining capacity before hitting the supply cap
function supplyCapRemaining() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Amount of tokens that can still be minted |
Events
UnlockingDelayUpdated
Emitted when the redeem (unlocking) cooldown is updated
event UnlockingDelayUpdated(uint48 oldUnlockingDelay, uint48 newUnlockingDelay);
Parameters
| Name | Type | Description |
|---|---|---|
oldUnlockingDelay | uint48 | Previous unlocking delay period in seconds |
newUnlockingDelay | uint48 | New unlocking delay period in seconds |
DenyListUpdated
Emitted when the deny list contract is updated
event DenyListUpdated(address indexed oldDenyList, address indexed newDenyList);
Parameters
| Name | Type | Description |
|---|---|---|
oldDenyList | address | Previous deny list contract address |
newDenyList | address | New deny list contract address |
SupplyCapUpdated
Emitted when the supply cap is updated
event SupplyCapUpdated(uint256 oldCap, uint256 newCap);
Parameters
| Name | Type | Description |
|---|---|---|
oldCap | uint256 | Previous supply cap |
newCap | uint256 | New supply cap |
Errors
NoClaimableRequest
Error thrown when trying to claim a non-existent or non-claimable request
error NoClaimableRequest();
NoPendingRequest
Error thrown when trying to cancel a non-existent request
error NoPendingRequest();
RequestNotClaimable
Error thrown when trying to claim before cooldown period passes
error RequestNotClaimable();
InvalidCooldown
Error thrown when setting invalid cooldown values
error InvalidCooldown();
Structs
Request
Request data structure used for both deposits and redeems
The meaning of fields changes based on which mapping stores the request
struct Request {
uint256 assets;
uint256 shares;
uint48 requestedAt;
}
Properties
| Name | Type | Description |
|---|---|---|
assets | uint256 | Pending assets to deposit (deposit request) OR locked-in assets to receive (redeem request) |
shares | uint256 | Locked-in shares to receive (deposit request) OR pending shares to redeem (redeem request) |
requestedAt | uint48 | Timestamp of last request (resets on incremental requests) |