diff --git a/crates/erc20_payment_lib/src/eth.rs b/crates/erc20_payment_lib/src/eth.rs index a227215a..2803e71d 100644 --- a/crates/erc20_payment_lib/src/eth.rs +++ b/crates/erc20_payment_lib/src/eth.rs @@ -26,9 +26,8 @@ pub async fn get_balance( "Checking balance for address {:#x}, token address: {:#x}, check_gas {}", address, token_address.unwrap_or_default(), - check_gas + check_gas, ); - let gas_balance = if check_gas { Some( web3.eth() @@ -63,8 +62,8 @@ pub async fn get_balance( .map_err(err_from!())?; if res.0.len() != 32 { return Err(err_create!(TransactionFailedError::new(&format!( - "Invalid balance response: {:?}", - res.0 + "Invalid balance response: {:?}. Probably not a valid ERC20 contract {:#x}", + res.0, token_address )))); }; Some(U256::from_big_endian(&res.0)) diff --git a/yatestnet/contracts/hardhat.config.js b/yatestnet/contracts/hardhat.config.js index 3e9fb41e..77a68932 100644 --- a/yatestnet/contracts/hardhat.config.js +++ b/yatestnet/contracts/hardhat.config.js @@ -1,4 +1,4 @@ -require('dotenv').config({path:'.env'}) +require('dotenv').config({path: '.env'}) require("@nomicfoundation/hardhat-toolbox"); @@ -12,6 +12,11 @@ module.exports = { url: process.env.YATESTNET_RPC || "http://127.0.0.1:8545", accounts: [private_key], chainId: 987789 + }, + mumbai: { + url: process.env.MUMBAI_RPC || "http://127.0.0.1:8545", + accounts: [private_key], + chainId: 80001 } }, solidity: {