From d106891b0ad4fd76e5a0b927e9f83613b938aa55 Mon Sep 17 00:00:00 2001 From: Nick Adamson Date: Fri, 29 Dec 2023 16:51:51 -0800 Subject: [PATCH] fix: mm example token approvals and chainId --- examples/rust/examples/maker/maker.rs | 8 ++++---- examples/rust/examples/maker/token_approvals.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/rust/examples/maker/maker.rs b/examples/rust/examples/maker/maker.rs index 93bc0a2..6bb89c6 100644 --- a/examples/rust/examples/maker/maker.rs +++ b/examples/rust/examples/maker/maker.rs @@ -250,7 +250,7 @@ async fn run( let chain_id: U256 = quote.chain_id.clone().unwrap().into(); if chain_id != U256::from(421614_u64) && chain_id != U256::from(31337_u64) { - warn!("RFQ request was not on the testnet chain. Ignoring the request"); + warn!("RFQ request was not on the testnet chain ({:?}). Ignoring the request", chain_id); continue; } @@ -288,9 +288,9 @@ async fn run( } let chain_id: U256 = quote.chain_id.clone().unwrap().into(); - if chain_id != U256::from(421614_u64) || chain_id != U256::from(31337_u64) { - warn!("Soft Quote request was not on the testnet chain. Ignoring the request"); - continue; + if chain_id != U256::from(421614_u64) && chain_id != U256::from(31337_u64) { + warn!("Soft Quote request was not on the testnet chain ({:?}). Ignoring the request", chain_id); + continue; } let quote_offer = if validate_soft_quote(quote.clone()).is_none() { diff --git a/examples/rust/examples/maker/token_approvals.rs b/examples/rust/examples/maker/token_approvals.rs index 507c430..9a82638 100644 --- a/examples/rust/examples/maker/token_approvals.rs +++ b/examples/rust/examples/maker/token_approvals.rs @@ -18,7 +18,7 @@ pub async fn approve_tokens( let gas_price = U256::from(200).mul(U256::exp10(8usize)); // Approval for the Seaport contract - let erc20_contract = bindings::erc20::Erc20::new(settings.magic_address, Arc::clone(provider)); + let erc20_contract = bindings::erc20::Erc20::new(settings.usdc_address, Arc::clone(provider)); let mut approval_tx = erc20_contract .approve(seaport_contract.address(), U256::MAX) .tx; @@ -31,9 +31,9 @@ pub async fn approve_tokens( .await .unwrap(); info!( - "Approved Seaport ({:?}) to spend MAGIC ({:?})", + "Approved Seaport ({:?}) to spend USDC ({:?})", seaport_contract.address(), - settings.magic_address + settings.usdc_address ); // Pre-approve all Options for Seaport