This product allows users to place orders that will be executed at a specified limit price. Orders are placed gaslessly via signed EIP-712 data, and support multiple inputs and multiple outputs.
- Check if msg.sender is allowed
- Check if order still valid
- Check tokens, amounts
- Get order hash
- Recover order owner account [and validate the signature]
- Extract previously filled amounts for order from storage, or create
- Check if fill possible:
- If partiallyFillable, total amount do not exceed
- If not partiallyFillable - it was not filled previously
- Transfer tokens from order owner
- Update order filled amounts in storage
- Get output token balances before
- Execute path with the OdosExecutor
- Get output token balances difference
- Calculate and transfer referral fee if any
- Check slippage, adjust amountOut
- Check surplus
- Transfer tokens to order owner account
- Emit LimitOrderFilled (MultiLimitOrderFilled) event
Chain | Limit Order Router Address |
---|---|
Ethereum |
0x5F79636fa7bc622eA48802E6cf80A5dae814daE1 |
Optimism |
0xcbF3822A63B7867cD602317fB4aE3ca864826ef8 |
BNB |
0x0D4aB12E62D17f037D43F018Da18FF623e1AF3B2 |
Polygon |
0x93052961c75c92Fd5d6362655936C239EF2D5336 |
Sonic |
0xB9CBD870916e9Ffc52076Caa714f85a022B7f330 |
Fantom |
0x5E0aFaD0f658f9689806296e0509AfFC191d9a09 |
Fraxtal |
0x5E0aFaD0f658f9689806296e0509AfFC191d9a09 |
zkSync Era |
0x74ab8c1247aE3C5FFFD9F85781F31751bdd98E73 |
Mantle |
0xa05A88037402d869b7CA69F5bEc098E19BeDaFbB |
Base |
0xeDeAfdEf0901eF74Ee28c207BE8424D3B353D97A |
Mode |
0x8073e286DaDc6d92BefC8f436c5BcDFcE213e681 |
Arbitrum |
0x7432657cDda02226ac2aAc9d8f552Ee9613B064e |
Avalanche |
0xcc0126349d1bD892D1C53381E68dBF0c8F0E045e |
Linea |
0xb3a9B56056a5c93F468dF62579b9A5BEa1741069 |
Scroll |
0x468633515c46EfFCC77Caa949ce8775505e5deDA |
Chain | Limit Order Router Address |
---|---|
Ethereum |
0x0F26B03961eb5D625BD6001278F0DB13f3e583d8 |
Optimism |
0xafF142fBc8FA5B1885FE54E4C889985F8a579b24 |
BNB |
0xFA198dF5167dc5fb7DDA2Ad413310Be67394bF3d |
Polygon |
0xBefe4BC7f39771CF7C2CcCE6E4e7Ef393deb6704 |
Fantom |
0x275278CEA8d36b879917B51d250F04Be95F905Ed |
Fraxtal |
0x926fAAfcE6148884CD5cF98Cd1878f865E8911Bf |
zkSync Era |
0xa688F1d16b44b9A3110C3b4413b6081F271A643B |
Mantle |
0x51Ea3db8b67462b0A66b3F1fF50cA87C076Acc7a |
Base |
0x8c8c3E8465B911186aDeC83a53C7De8c587eDDaB |
Mode |
0x65005f4Bea4005D48eE9Bdaae960832c6CECC557 |
Arbitrum |
0x83564b903c0311877accEE8f99e6BEb712AD8E43 |
Avalanche |
0xD10634297961fEa132ac7b6e7451BC4E5B17359b |
Linea |
0x5Ab73021e0648f46Da303cE7f5a0F2F15a3944c6 |
Scroll |
0x014F335e0161B4EdDf3fF5b297BA6A31004Ca528 |
forge build
forge test
Test the EIP-712 hash generation to ensure that the Solidity hash is generated correctly.
cd test/eip712test
chmod +x ./runTest.sh
./runTest.sh
forge test --gas-report
npm install -g solhint
solhint 'contracts/*.sol' 'interfaces/*.sol'
forge coverage --report lcov
genhtml -o report lcov.info
Then open the report/index.html
in the browser.
Install Mythril
solc-select install 0.8.19
export SOLC_VERSION=0.8.19
myth analyze contracts/OdosLimitOrderRouter.sol --solc-json ./mythril.config.json
This contract was audited by Halborn in April 2024. A link to the report can be found on the Halborn Website. A copy of the report is included on this page.