Skip to content

Commit

Permalink
Scx1332/minor improvements (#58)
Browse files Browse the repository at this point in the history
* Minor improvements
  • Loading branch information
scx1332 authored Sep 29, 2023
1 parent c484442 commit a40df5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions crates/erc20_payment_lib/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand Down
7 changes: 6 additions & 1 deletion yatestnet/contracts/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('dotenv').config({path:'.env'})
require('dotenv').config({path: '.env'})

require("@nomicfoundation/hardhat-toolbox");

Expand All @@ -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: {
Expand Down

0 comments on commit a40df5d

Please sign in to comment.