AI agent documentation index: llms.txt. Raw markdown for any page is available by appending .md to the URL. Full content snapshot: llms-full.txt.
llms.txt — complete Cartesi documentation index. Append .md to any page URL for raw Markdown (e.g. /cartesi-rollups/2.0/development/building-an-application.md).
Skip to main content

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

NameTypeDescription
appContractaddressThe 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).
accountbytesThe account, as encoded in the accounts drive

Return Values

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

NameTypeDescription
attemptedAccountSizeuint64The attempted account size, in bytes
minAccountSizeuint64The minimum expected account size, in bytes
We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.