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:
Native token support
The accounting system now uses
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeEas the representative address for native tokens.The
depositNativefunction 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.
Cancellation changes
Source-chain cancellations for cross-chain orders were removed.
The
_cancelfunction 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.
Emergency functions
The
emergencyWithdrawfunction 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
emergencyCancelfunction was introduced, allowing the contract owner to cancel orders from the source chain in emergency situations.
Withdraw-amount input specification
Inputting
0as theamountin thewithdrawfunction allows the caller to withdraw their full balance.
Removed
swap()functionThe unused
swap()function for single-chain atomic swaps was removed to reduce contract size.