For the complete documentation index, see llms.txt. This page is also available as Markdown.

IA0xRouter

IA0xRouter

Allows Rigoblock smart pools to execute swaps via the 0x AllowanceHolder and Settler contracts.

DirectCallNotAllowed

error DirectCallNotAllowed()

Thrown when a call is made directly to the adapter instead of via delegatecall.

RecipientNotSmartPool

error RecipientNotSmartPool()

Thrown when the swap recipient is not the smart pool.

CounterfeitSettler

error CounterfeitSettler(address target)

Thrown when the target is not a genuine 0x Settler instance.

UnsupportedSettlerFunction

error UnsupportedSettlerFunction()

Thrown when the Settler calldata has an unsupported function selector.

InvalidSettlerCalldata

Thrown when the Settler calldata is too short to decode.

InsufficientNativeBalance

Thrown when the pool does not hold enough native balance.

ActionNotAllowed

Thrown when a settler action is not in the adapter's allowlist.

Only whitelisted DEX swap actions are permitted.

Parameters

Name
Type
Description

actionSelector

bytes4

The 4-byte selector of the rejected action.

OperatorMustEqualTarget

Thrown when operator is not the same address as target.

AllowanceHolder stores the ephemeral allowance under operator. If operator differs from the genuine Settler (target), a malicious operator contract could consume the ephemeral allowance and drain pool tokens to an arbitrary address.

TransferFromRecipientNotSettler

Thrown when a TRANSFER_FROM action's recipient is not the Settler itself.

Allowing an arbitrary recipient would let the pool owner drain funds.

Parameters

Name
Type
Description

recipient

address

The decoded recipient address that failed the check.

exec

Execute a swap via the 0x AllowanceHolder contract.

The calldata is forwarded unmodified to AllowanceHolder after validation.

Parameters

Name
Type
Description

operator

address

The address authorized to consume the ephemeral allowance. Must equal target.

token

address

The sell token address.

amount

uint256

The sell token amount.

target

address payable

The 0x Settler contract address that will execute the swap.

data

bytes

The Settler.execute() calldata containing swap instructions.

Return Values

Name
Type
Description

result

bytes

The return data from AllowanceHolder.exec.

Last updated