Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mm example token approvals and chainId #45

Merged
merged 1 commit into from
Dec 30, 2023
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
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
Loading