IWithdrawalOutputBuilder
A withdrawal output builder turns an account (as encoded in the application's accounts drive) into an output that, when executed by the Application contract, transfers that account's funds to its owner.
During withdraw(), the Application static-calls the builder set in its WithdrawalConfig and runs the returned output. Because the call is a STATICCALL, buildWithdrawalOutput must not change any state (it is view/pure). Any state change, such as contract creation, log emission, storage write, self-destruct, or Ether transfer, reverts the call and aborts the withdrawal.
The account encoding is application-specific. See UsdWithdrawalOutputBuilder for the single-ERC-20 implementation.
Functions
buildWithdrawalOutput()
function buildWithdrawalOutput(address appContract, bytes calldata account)
external
view
returns (bytes memory output)
Build an output that, when executed by the application contract, transfers the funds of an account to its owner.
Parameters
| Name | Type | Description |
|---|---|---|
appContract | address | The application contract address. May be needed for outputs that move assets from the application's own account to the account owner (e.g. ERC-721 / ERC-1155 transfers). |
account | bytes | The account, as encoded in the accounts drive |
Return Values
| Name | Type | Description |
|---|---|---|
output | bytes | The withdrawal output |
Errors
AccountTooShort()
error AccountTooShort(uint64 attemptedAccountSize, uint64 minAccountSize)
Raised when the provided account is too short for the builder to decode on-chain.
Parameters
| Name | Type | Description |
|---|---|---|
attemptedAccountSize | uint64 | The attempted account size, in bytes |
minAccountSize | uint64 | The minimum expected account size, in bytes |