Skip to content
Merged
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: 1 addition & 1 deletion crates/alerter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl OrderBookApi {
// untouched.
fn convert_eth_to_weth(token: Address) -> Address {
const WETH: Address = address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2");
if token.as_slice() == BUY_ETH_ADDRESS.as_bytes() {
if token == BUY_ETH_ADDRESS {
WETH
} else {
token
Expand Down
6 changes: 3 additions & 3 deletions crates/autopilot/src/database/auction_prices.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use {
super::Postgres,
alloy::primitives::Address,
anyhow::Result,
bigdecimal::BigDecimal,
primitive_types::H160,
std::collections::HashMap,
};

impl Postgres {
pub async fn fetch_latest_prices(&self) -> Result<HashMap<H160, BigDecimal>> {
pub async fn fetch_latest_prices(&self) -> Result<HashMap<Address, BigDecimal>> {
let _timer = super::Metrics::get()
.database_queries
.with_label_values(&["fetch_latest_prices"])
Expand All @@ -17,7 +17,7 @@ impl Postgres {
Ok(database::auction_prices::fetch_latest_prices(&mut ex)
.await?
.into_iter()
.map(|auction_price| (H160::from(auction_price.token.0), auction_price.price))
.map(|auction_price| (Address::new(auction_price.token.0), auction_price.price))
.collect::<HashMap<_, _>>())
}
}
15 changes: 7 additions & 8 deletions crates/autopilot/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use {
ethcontract::H160,
ethrpc::{
Web3,
alloy::conversions::{IntoAlloy, IntoLegacy},
alloy::conversions::IntoLegacy,
block_stream::block_number_to_block_number_hash,
},
futures::StreamExt,
Expand Down Expand Up @@ -321,7 +321,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) {
));
let mut allowed_tokens = args.allowed_tokens.clone();
allowed_tokens.extend(base_tokens.tokens().iter());
allowed_tokens.push(model::order::BUY_ETH_ADDRESS.into_alloy());
allowed_tokens.push(model::order::BUY_ETH_ADDRESS);
let unsupported_tokens = args.unsupported_tokens.clone();

let finder = token_owner_finder::init(
Expand Down Expand Up @@ -380,16 +380,15 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) {
web3: web3.clone(),
simulation_web3,
chain,
settlement: eth.contracts().settlement().address().into_legacy(),
native_token: eth.contracts().weth().address().into_legacy(),
settlement: *eth.contracts().settlement().address(),
native_token: *eth.contracts().weth().address(),
authenticator: eth
.contracts()
.settlement()
.authenticator()
.call()
.await
.expect("failed to query solver authenticator address")
.into_legacy(),
.expect("failed to query solver authenticator address"),
base_tokens: base_tokens.clone(),
block_stream: eth.current_block().clone(),
},
Expand Down Expand Up @@ -528,14 +527,14 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) {
bad_token_detector.clone(),
native_price_estimator.clone(),
signature_validator.clone(),
eth.contracts().weth().address().into_legacy(),
*eth.contracts().weth().address(),
args.limit_order_price_factor
.try_into()
.expect("limit order price factor can't be converted to BigDecimal"),
domain::ProtocolFees::new(&args.fee_policies_config),
cow_amm_registry.clone(),
args.run_loop_native_price_timeout,
eth.contracts().settlement().address().into_legacy(),
*eth.contracts().settlement().address(),
args.disable_order_balance_filter,
args.disable_1271_order_sig_filter,
args.disable_1271_order_balance_filter,
Expand Down
Loading