Assessment reports>Aori 0.3.1 Upgrade>Design>Component: Aori contract (version 0.3.1 upgrade)

Component: Aori contract (version 0.3.1 upgrade)

Description

The Aori contract is an intent settlement protocol designed to facilitate token exchanges across different blockchains between users and trusted solvers. Users can deposit tokens on a source chain with signed intent parameters, which solvers (market makers) can fulfill on destination chains. The contract also supports hooks, which are external contract calls executed during the deposit or fill process. This feature enables more complex operations, such as swapping one token for another before a deposit or using a DEX to acquire the required output token during a fill.

Notable changes

The following outlines the notable changes in version 0.3.1:

  1. Native token support

    • The accounting system now uses 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE as the representative address for native tokens.

    • The depositNative function was added, allowing users to deposit native tokens to their locked balance.

    • The NativeTokenUtils library was introduced in AoriUtils.sol to manage native token transfers and monitor balance changes.

  2. Cancellation changes

    • Source-chain cancellations for cross-chain orders were removed.

    • The _cancel function was updated to transfer tokens directly to the user instead of increasing their unlocked balance.

    • Recipients can now cancel expired cross-chain orders from the destination chain.

  3. Emergency functions

    • The emergencyWithdraw function was added, enabling the contract owner to withdraw tokens from a specific user's locked or unlocked balance to maintain accounting consistency during emergencies.

    • The emergencyCancel function was introduced, allowing the contract owner to cancel orders from the source chain in emergency situations.

  4. Withdraw-amount input specification

    • Inputting 0 as the amount in the withdraw function allows the caller to withdraw their full balance.

  5. Removed swap() function

    • The unused swap() function for single-chain atomic swaps was removed to reduce contract size.

Zellic © 2025Back to top ↑