Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ICommitToken

Git Source

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

NameTypeDescription
assetsuint256Amount of assets to withdraw
controlleraddressAddress that will control the request (must be msg.sender)
owneraddressAddress that owns the shares (must be msg.sender)

Returns

NameTypeDescription
requestIduint256ID 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

NameTypeDescription
requestIduint256ID of the request (ignored)
owneraddressAddress that owns the shares (must be msg.sender)

Returns

NameTypeDescription
cooldownuint48Remaining cooldown time in seconds

isClaimable

Returns true if a request is claimable

function isClaimable(uint256 requestId, address owner) external view returns (bool);

Parameters

NameTypeDescription
requestIduint256ID of the request (ignored)
owneraddressAddress that owns the shares (must be msg.sender)

Returns

NameTypeDescription
<none>booltrue if the request is claimable, false otherwise

supplyCap

Returns the current supply cap

function supplyCap() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Maximum total supply allowed

supplyCapRemaining

Returns the remaining capacity before hitting the supply cap

function supplyCapRemaining() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Amount of tokens that can still be minted

Events

UnlockingDelayUpdated

Emitted when the redeem (unlocking) cooldown is updated

event UnlockingDelayUpdated(uint48 oldUnlockingDelay, uint48 newUnlockingDelay);

Parameters

NameTypeDescription
oldUnlockingDelayuint48Previous unlocking delay period in seconds
newUnlockingDelayuint48New unlocking delay period in seconds

DenyListUpdated

Emitted when the deny list contract is updated

event DenyListUpdated(address indexed oldDenyList, address indexed newDenyList);

Parameters

NameTypeDescription
oldDenyListaddressPrevious deny list contract address
newDenyListaddressNew deny list contract address

SupplyCapUpdated

Emitted when the supply cap is updated

event SupplyCapUpdated(uint256 oldCap, uint256 newCap);

Parameters

NameTypeDescription
oldCapuint256Previous supply cap
newCapuint256New 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

NameTypeDescription
assetsuint256Pending assets to deposit (deposit request) OR locked-in assets to receive (redeem request)
sharesuint256Locked-in shares to receive (deposit request) OR pending shares to redeem (redeem request)
requestedAtuint48Timestamp of last request (resets on incremental requests)