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

Smart Contract Functions

Key on-chain calls for swaps, token approvals and execution nonces.

Arc Aggregator executes same-chain ERC-20 swaps. No bridging function is exposed. Use the Execution Router proxy listed in Contract Address.

Execute a swap

Execution Router: executePlan · Selector: 0x02fcde22

Executes an aggregator-signed plan and enforces its route, roles, signatures, deadline, nonce and minimum output.

executePlan(
    ExecutionPlan plan,
    SwapParams params,
    bytes32[] logicalPoolIds,
    uint8[] amountModes,
    bytes payerSignature,
    bytes aggregatorSignature
)
Parameter
Purpose

plan

Signed tokens, amounts, roles, hashes, fee terms, deadline and nonce.

params

Ordered swap steps and settlement values matching the plan.

logicalPoolIds

One non-zero logical pool identifier per step.

amountModes

Per-step mode: 0 uses the specified positive amount; 1 consumes the temporary input balance and requires step.amountIn = 0.

payerSignature

0x for Direct Allowance; payer's Permit2 Witness signature for delegated swaps.

aggregatorSignature

Aggregator authorization for the execution plan.

Submit the prepared transaction's to, data and value unchanged. The SDK or Swap API builds the calldata.

Funding flows

  • Direct Swaps: payer = executor = caller. Approve the input token to the Execution Router.

  • Delegated Swaps: payer != executor; executor sends the transaction. The payer approves Permit2 and signs the prepared authorization.

Arc uses nativeMode = 0 and transaction value = 0. Token amounts use base units; deadlines use Unix seconds.

Supporting functions

Function
Selector
Purpose

approve(address spender, uint256 amount)

0x095ea7b3

ERC-20: set the caller's allowance; amount = 0 revokes it.

allowance(address owner, address spender)

0xdd62ed3e

ERC-20: read an owner's allowance for a spender.

invalidateExecutionNonces(uint256 word, uint256 mask)

0x52ab1a8b

Router: payer invalidates selected nonces to cancel pending plans.

isExecutionNonceUsed(address payer, uint256 nonce)

0xf253f061

Router: check whether a nonce was used or invalidated.

For one nonce: word = nonce >> 8, mask = 1 << (nonce & 255). Router nonce invalidation does not revoke token allowances.

Last updated

Was this helpful?