Skip to content

Commit

Permalink
Merge pull request #45 from valorem-labs-inc/fix-mm-example-approvals…
Browse files Browse the repository at this point in the history
…-sepolia

fix: mm example token approvals and chainId
  • Loading branch information
0xAlcibiades authored Dec 30, 2023
2 parents 8689b42 + d106891 commit 68aaf9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/rust/examples/maker/maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ async fn run<P: JsonRpcClient + 'static>(

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;
}

Expand Down Expand Up @@ -288,9 +288,9 @@ async fn run<P: JsonRpcClient + 'static>(
}

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() {
Expand Down
6 changes: 3 additions & 3 deletions examples/rust/examples/maker/token_approvals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub async fn approve_tokens<P: JsonRpcClient + 'static>(
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;
Expand All @@ -31,9 +31,9 @@ pub async fn approve_tokens<P: JsonRpcClient + 'static>(
.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
Expand Down

0 comments on commit 68aaf9c

Please sign in to comment.