IERC7540Deposit

Git Source

Functions

requestDeposit

*Transfers assets from sender into the Vault and submits a Request for asynchronous deposit.

  • MUST support ERC-20 approve / transferFrom on asset as a deposit Request flow.
  • MUST revert if all of assets cannot be requested for deposit.
  • owner MUST be msg.sender unless some unspecified explicit approval is given by the caller, approval of ERC-20 tokens from owner to sender is NOT enough.*
function requestDeposit(uint256 assets, address controller, address owner) external returns (uint256 requestId);

Parameters

NameTypeDescription
assetsuint256the amount of deposit assets to transfer from owner
controlleraddressthe controller of the request who will be able to operate the request
owneraddressthe source of the deposit assets NOTE: most implementations will require pre-approval of the Vault with the Vault's underlying asset token.

pendingDepositRequest

*Returns the amount of requested assets in Pending state.

  • MUST NOT include any assets in Claimable state for deposit or mint.
  • MUST NOT show any variations depending on the caller.
  • MUST NOT revert unless due to integer overflow caused by an unreasonably large input.*
function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 pendingAssets);

claimableDepositRequest

*Returns the amount of requested assets in Claimable state for the controller to deposit or mint.

  • MUST NOT include any assets in Pending state.
  • MUST NOT show any variations depending on the caller.
  • MUST NOT revert unless due to integer overflow caused by an unreasonably large input.*
function claimableDepositRequest(
    uint256 requestId,
    address controller
)
    external
    view
    returns (uint256 claimableAssets);

deposit

*Mints shares Vault shares to receiver by claiming the Request of the controller.

  • MUST emit the Deposit event.
  • controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator.*
function deposit(uint256 assets, address receiver, address controller) external returns (uint256 shares);

mint

*Mints exactly shares Vault shares to receiver by claiming the Request of the controller.

  • MUST emit the Deposit event.
  • controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator.*
function mint(uint256 shares, address receiver, address controller) external returns (uint256 assets);

Events

DepositRequest

event DepositRequest(
    address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 assets
);