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
9 changes: 9 additions & 0 deletions configs/offline/baseline.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
chain-id = "31337" # Anvil local chain
base-tokens = [
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
]
max-hops = 2
max-partial-attempts = 5
native-token-price-estimation-amount = "100000000000000000" # 0.1 ETH
35 changes: 35 additions & 0 deletions configs/offline/driver.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
app-data-fetching-enabled = true
orderbook-url = "http://orderbook"
tx-gas-limit = "45000000"

[[solver]]
name = "baseline" # Arbitrary name given to this solver, must be unique
endpoint = "http://baseline"
absolute-slippage = "40000000000000000" # Denominated in wei, optional
relative-slippage = "0.1" # Percentage in the [0, 1] range
# Anvil account #0 private key (from test mnemonic)
account = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

[submission]
gas-price-cap = "1000000000000"

[[submission.mempool]]
mempool = "public"

[contracts]
gp-v2-settlement = "0xb7f8bc63bbcad18155201308c8f3540b07f84f5e"
weth = "0x5fbdb2315678afecb367f032d93f642f64180aa3"
balances = "0xbd5a6618df333f8f66702daadc9a953e2b52a65d"
signatures = "0x7377795aa7b4a8fca5e4e194f54eaff667db45f0"

[liquidity]
base-tokens = [
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
]

[[liquidity.uniswap-v2]] # Uniswap V2 configuration (auto-generated from deployment)
router = "0x5fc8d32690cc91d4c39d9d3abcbd16989f875707"
pool-code = "0xb6912aa8f91da604bdd903b3484a9f6bb569baa993085fc590133487ff27f91e" # Uniswap V2 init code hash
missing-pool-cache-time = "1h"
4 changes: 1 addition & 3 deletions crates/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ impl Chain {
| Self::Optimism => U256::from(10u128.pow(17)),
Self::Gnosis | Self::Avalanche | Self::Lens => U256::from(10u128.pow(18)),
Self::Polygon | Self::Plasma => U256::from(10u128.pow(20)),
Self::Hardhat => {
panic!("unsupported chain for default amount to estimate native prices with")
}
Self::Hardhat => U256::from(10u128.pow(17)), // Use same as testnets for local testing
}
}

Expand Down
10 changes: 9 additions & 1 deletion crates/solvers/src/infra/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ impl Contracts {
Self {
weth: eth::WethAddress(
WETH9::deployment_address(&chain.id())
.expect("there should be a contract address for all supported chains")
.unwrap_or_else(|| {
// For local development chains (Hardhat/Anvil), use the standard deployment
// address from the test deployment at 0x5FbDB2315678afecb367f032d93F642f64180aa3
if chain.id() == 31337 {
"0x5FbDB2315678afecb367f032d93F642f64180aa3".parse().unwrap()
} else {
panic!("there should be a contract address for all supported chains")
}
})
.into_legacy(),
),
}
Expand Down
25 changes: 25 additions & 0 deletions playground/.env.offline
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Auto-generated by deploy-all.sh
# Generated at: 1763735432

# Network Configuration
CHAIN_ID=31337
NODE_URL=http://chain:8545
SIMULATION_NODE_URL=http://chain:8545

# Token Addresses (from deployment)
WETH_ADDRESS=0x5fbdb2315678afecb367f032d93f642f64180aa3
DAI_ADDRESS=0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9
USDC_ADDRESS=0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0
NATIVE_TOKEN_ADDRESS=0x5fbdb2315678afecb367f032d93f642f64180aa3

# Uniswap V2 Addresses (from deployment)
UNISWAP_V2_FACTORY_ADDRESS=0xdc64a140aa3e981100a9beca4e685f962f0cf6c9
UNISWAP_V2_ROUTER_ADDRESS=0x5fc8d32690cc91d4c39d9d3abcbd16989f875707

# CoW Protocol Addresses (from deployment)
SETTLEMENT_CONTRACT_ADDRESS=0xb7f8bc63bbcad18155201308c8f3540b07f84f5e
AUTHENTICATOR_ADDRESS=0x610178da211fef7d417bc0e6fed39f05609ad788
VAULT_RELAYER_ADDRESS=8daf17a20c9dba35f005b6324f493785d239719d
BALANCER_VAULT_ADDRESS=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
BALANCES_CONTRACT_ADDRESS=0xbd5a6618df333f8f66702daadc9a953e2b52a65d
SIGNATURES_CONTRACT_ADDRESS=0x7377795aa7b4a8fca5e4e194f54eaff667db45f0
Loading