Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements full support for ERC20ETH as an input token across all chains in Artemis. ERC20ETH is an ERC20 wrapper for native ETH that uses ERC-7914 for smart wallet compatibility. When Artemis receives an order with ERC20ETH as the input, we normalize it to native ETH (zero address) since that's what we'll receive during the callback.
ERC20ETH Address (all chains):
0x00000000e20E49e6dCeE6e8283A0C090578F0fb9Key Changes
Added ERC20ETH constant and normalization functions (
src/shared.rs)ERC20ETH_ADDRESSconstantnormalize_erc20eth_to_native()for string-based token addressesnormalize_erc20eth_to_native_address()for Address type token addressesUpdated route collection (
src/collectors/uniswapx_route_collector.rs)resolve_address()to normalize ERC20ETH to "ETH" for the Uniswap routing APIUpdated order batching (3 strategy files)
src/strategies/priority_strategy.rs- Normalizetoken_ininget_order_batch()src/strategies/dutchv3_strategy.rs- Normalizetoken_ininget_order_batches()src/strategies/uniswapx_strategy.rs- Normalizetoken_ininget_order_batches()Updated transaction building (
src/strategies/shared.rs)token_ininbuild_fill()before useget_tokens_to_approve()to skip approval for ERC20ETH (treated as native ETH)Files Modified
src/shared.rs- Added constant and helper functions, added testssrc/collectors/uniswapx_route_collector.rs- Updatedresolve_address(), added testssrc/strategies/priority_strategy.rs- Updatedget_order_batch(), added testsrc/strategies/dutchv3_strategy.rs- Updatedget_order_batches()src/strategies/uniswapx_strategy.rs- Updatedget_order_batches()src/strategies/shared.rs- Updatedbuild_fill()andget_tokens_to_approve()Testing
Design Decisions
eq_ignore_ascii_case()for robust address comparisontoken_outBackward Compatibility
✅ Fully backward compatible - only adds new handling without changing existing behavior for other tokens.