diff --git a/src/constants/index.ts b/src/constants/index.ts index 01da13c..12b1201 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,8 +1,7 @@ export const uint256MaxValue = "115792089237316195423570985008687907853269984665640564039457584007913129639935"; -export const nativeTokenConstant = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; -export const NATIVE_EVM_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; +export const NATIVE_EVM_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee".toLowerCase(); export const MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11"; export const multicallAbi = [ { diff --git a/src/handlers/evm/index.ts b/src/handlers/evm/index.ts index ee778ed..8820592 100644 --- a/src/handlers/evm/index.ts +++ b/src/handlers/evm/index.ts @@ -15,7 +15,11 @@ import { WalletV6, } from "../../types"; -import { CHAINS_WITHOUT_MULTICALL, nativeTokenConstant, uint256MaxValue } from "../../constants"; +import { + CHAINS_WITHOUT_MULTICALL, + NATIVE_EVM_TOKEN_ADDRESS, + uint256MaxValue, +} from "../../constants"; import { Utils } from "./utils"; import { TokensChains } from "../../utils/TokensChains"; @@ -318,7 +322,7 @@ export class EvmHandler extends Utils { const fromProvider = ethersAdapter.rpcProvider(_fromChain.rpc); - const fromIsNative = _fromToken.address === nativeTokenConstant; + const fromIsNative = _fromToken.address.toLowerCase() === NATIVE_EVM_TOKEN_ADDRESS; let fromTokenContract; if (!fromIsNative) { diff --git a/src/handlers/evm/utils.ts b/src/handlers/evm/utils.ts index 858af47..0e9ac8c 100644 --- a/src/handlers/evm/utils.ts +++ b/src/handlers/evm/utils.ts @@ -181,7 +181,7 @@ export class Utils { tokens.map(async t => { let balance: TokenBalance | null; try { - if (t.address === NATIVE_EVM_TOKEN_ADDRESS) { + if (t.address.toLowerCase() === NATIVE_EVM_TOKEN_ADDRESS.toLowerCase()) { balance = await this.fetchBalance({ token: t, userAddress,