Skip to main content

Contracts

A swap on Aile calls exactly one Aile contract: the order protocol. You approve it for the token you sell and send the fill to it. The tokens are standard ERC-20s; their addresses are on Networks and tokens.

Security and audit

What is audited. The order protocol inherits OrderMixin from the 1inch Limit Order Protocol v4 (@1inch/limit-order-protocol-contract 4.3.2) without modification. 1inch publishes the security audits of that release in 1inch/1inch-audits. In a firm-quote swap the order carries no extension and no fee leg, so the code that moves funds is 1inch’s audited code. What the contract enforces. On fillOrder the protocol verifies that the signature (r, vs, EIP-2098) recovers to order.maker; that msg.sender is the taker the order was signed for (allowedSender); that the order has not expired (expiresAt); and that its nonce bit is unspent (a replay reverts BitInvalidatedOrder). It then transfers takingAmount of the sold token from the taker to the maker and makingAmount of the bought token from the maker to the taker in one transaction, or reverts. The maker pays from its own wallet under an ERC-20 allowance it granted the protocol. What it does not enforce. The contract does not check the price: the amounts are whatever the maker signed. The midmarket rate and the spread are information in the quote for you to judge before you send (Rates & fees). Custody and control. Funds never sit in an Aile contract or on an Aile server; settlement is one atomic transfer between the taker’s wallet and the maker’s. Aile’s servers price and sign quotes; the fill is sent by your wallet straight to the order protocol. The protocol’s owner can pause new fills during an incident; a pause cannot move funds or alter a signed order.

Order format

quote.order is the 1inch v4 order struct with decimal-string amounts: orderHash (the key of GET /orders/{hash}) is the EIP-712 hash of this struct under the domain above.