Commit ae759780 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Rootstock checksum is applied to all chains (#2616)

Fixes #2613
parent de577671
...@@ -2,12 +2,18 @@ import { getAddress } from 'viem'; ...@@ -2,12 +2,18 @@ import { getAddress } from 'viem';
import config from 'configs/app'; import config from 'configs/app';
const ERC1191_CHAIN_IDS = [
'30', // RSK Mainnet
'31', // RSK Testnet
];
export default function getCheckedSummedAddress(address: string): string { export default function getCheckedSummedAddress(address: string): string {
try { try {
return getAddress( return getAddress(
address, address,
// We need to pass chainId to getAddress to make it work correctly for some chains, e.g. Rootstock // We need to pass chainId to getAddress to make it work correctly for chains that support ERC-1191
config.chain.id ? Number(config.chain.id) : undefined, // https://eips.ethereum.org/EIPS/eip-1191#usage--table
ERC1191_CHAIN_IDS.includes(config.chain.id ?? '') ? Number(config.chain.id) : undefined,
); );
} catch (error) { } catch (error) {
return address; return address;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment