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
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.
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.
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.
Withdraw-amount input specification
Inputting
0
as theamount
in thewithdraw
function 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.