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

UsdWithdrawalOutputBuilderFactory

UsdWithdrawalOutputBuilderFactory lets anyone deploy a UsdWithdrawalOutputBuilder for a given ERC-20 token at a predictable address. Because these builders are stateless, it does not matter whether you deploy one yourself or reuse an existing one for the same token. The address is derived deterministically from the token and salt (using CREATE2).

The factory is constructed with a shared SafeERC20Transfer contract, which it passes to every builder it deploys (used as the delegate-call voucher destination).

Functions

newUsdWithdrawalOutputBuilder()

function newUsdWithdrawalOutputBuilder(IERC20 token, bytes32 salt)
external
returns (IUsdWithdrawalOutputBuilder usdWithdrawalOutputBuilder)

Deploy a new USD withdrawal output builder deterministically. Emits UsdWithdrawalOutputBuilderCreated.

Parameters

NameTypeDescription
tokenIERC20The USD-like ERC-20 token
saltbytes32The salt used to deterministically generate the contract address

Return Values

NameTypeDescription
usdWithdrawalOutputBuilderIUsdWithdrawalOutputBuilderThe deployed builder

calculateUsdWithdrawalOutputBuilderAddress()

function calculateUsdWithdrawalOutputBuilderAddress(IERC20 token, bytes32 salt)
external
view
returns (address usdWithdrawalOutputBuilderAddress)

Compute the deterministic address a builder for token/salt would have, whether or not it is already deployed. Use this to obtain the builder address for a WithdrawalConfig without deploying.

Parameters

NameTypeDescription
tokenIERC20The USD-like ERC-20 token
saltbytes32The salt used to deterministically generate the contract address

Return Values

NameTypeDescription
usdWithdrawalOutputBuilderAddressaddressThe deterministic builder address

getSafeErc20Transfer()

function getSafeErc20Transfer() external view returns (ISafeERC20Transfer safeErc20Transfer)

Get the shared safe ERC-20 transfer contract passed down to the builders (used as the delegate-call voucher destination).

Events

UsdWithdrawalOutputBuilderCreated()

event UsdWithdrawalOutputBuilderCreated(IUsdWithdrawalOutputBuilder usdWithdrawalOutputBuilder)

Triggered on a successful call to newUsdWithdrawalOutputBuilder.

Parameters

NameTypeDescription
usdWithdrawalOutputBuilderIUsdWithdrawalOutputBuilderThe newly deployed builder
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.