AirSwap orders are mutually signed instructions to perform an atomic swap. Prior to execution, both the signer (party that creates and signs the order) and sender (party that sends the order to the EVM) must have approved the swap contract to transfer the specified tokens on their behalf.
Properties
An OrderERC20 has the following properties:
Property
Type
Description
nonce
uint256
Unique per signer and usually sequential.
expiry
uint256
Expiry in seconds since 1 January 1970.
signerWallet
address
Wallet that sets and signs terms.
signerToken
address
Token that the signer transfers.
signerAmount
uint256
Amount that the signer transfers.
senderToken
address
Token that the sender transfers.
senderAmount
uint256
Amount that the sender transfers.
v
uint8
v value of the ECDSA signature.
r
bytes32
r value of the ECDSA signature.
s
bytes32
s value of the ECDSA signature.
Execution
Orders are passed to the SwapERC20 contract for execution, which emits a SwapERC20 event on success. The swapLight function is more efficient, whereas the swap function provides protocol fee rebates to staked AST holders. Either function can execute a properly signed order.
Optional. One account may authorize another account to sign orders on its behalf. For example, a server might sign using an account that has been authorized by a contract wallet. To manage signer authorizations, use the following functions on the SwapERC20 contract.
function authorize(address signer) external
function revoke() external
EIP712
The following values are used for the EIP712Domain.