Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ cargo run -- monitor
| Across | 📋 Planned | Multi-chain |
| CoW Protocol | 📋 Planned | Ethereum |

UniswapX rejects unsupported chains instead of falling back to mainnet.

## Revenue Model

Solvers earn fees from filling intents:
Expand Down
2 changes: 1 addition & 1 deletion src/intents/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod tests {
use super::Chain;

#[test]
fn unichain_id_round_trips() {
fn unichain_round_trips_chain_id() {
assert_eq!(Chain::Unichain.chain_id(), 130);
assert_eq!(Chain::from_id(130), Some(Chain::Unichain));
}
Expand Down
6 changes: 3 additions & 3 deletions src/intents/uniswapx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn api_url(chain: Chain) -> Result<&'static str> {
Chain::Ethereum => Ok("https://api.uniswap.org/v2/orders?orderStatus=open&chainId=1"),
Chain::Arbitrum => Ok("https://api.uniswap.org/v2/orders?orderStatus=open&chainId=42161"),
Chain::Base => Ok("https://api.uniswap.org/v2/orders?orderStatus=open&chainId=8453"),
Chain::Optimism | Chain::Polygon | Chain::Unichain => Err(unsupported_chain_error(chain)),
_ => Err(unsupported_chain_error(chain)),
}
}

Expand Down Expand Up @@ -212,7 +212,7 @@ mod tests {
}

#[test]
fn api_url_uses_explicit_supported_chains() {
fn supported_chains_use_chain_specific_urls() {
assert_eq!(
api_url(Chain::Ethereum).unwrap(),
"https://api.uniswap.org/v2/orders?orderStatus=open&chainId=1"
Expand All @@ -228,7 +228,7 @@ mod tests {
}

#[test]
fn decoder_rejects_unsupported_uniswapx_chains() {
fn unsupported_chains_do_not_fall_back_to_mainnet() {
for chain in [Chain::Optimism, Chain::Polygon, Chain::Unichain] {
let err = expect_error(chain);
assert_eq!(
Expand Down