- Refactor address warnings into src/shared/addressWarnings.js module - getLocalWarnings(address, options): sync checks against local lists - getFullWarnings(address, provider, options): async local + RPC checks - Expand scam address list from 652 to 2417 addresses - Added EtherScamDB (MIT) as additional source - Update confirmTx.js to use the new addressWarnings module
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
const DEBUG = true;
|
|
const DEBUG_MNEMONIC =
|
|
"cube evolve unfold result inch risk jealous skill hotel bulb night wreck";
|
|
|
|
const ETHEREUM_MAINNET_CHAIN_ID = "0x1";
|
|
|
|
const DEFAULT_RPC_URL = "https://ethereum-rpc.publicnode.com";
|
|
|
|
const DEFAULT_BLOCKSCOUT_URL = "https://eth.blockscout.com/api/v2";
|
|
|
|
const BIP44_ETH_PATH = "m/44'/60'/0'/0";
|
|
|
|
const ERC20_ABI = [
|
|
"function name() view returns (string)",
|
|
"function symbol() view returns (string)",
|
|
"function decimals() view returns (uint8)",
|
|
"function balanceOf(address) view returns (uint256)",
|
|
"function transfer(address to, uint256 amount) returns (bool)",
|
|
"function allowance(address owner, address spender) view returns (uint256)",
|
|
"function approve(address spender, uint256 amount) returns (bool)",
|
|
];
|
|
|
|
// Known null/burn addresses that permanently destroy funds.
|
|
const BURN_ADDRESSES = new Set([
|
|
"0x0000000000000000000000000000000000000000",
|
|
"0x0000000000000000000000000000000000000001",
|
|
"0x000000000000000000000000000000000000dead",
|
|
"0xdead000000000000000000000000000000000000",
|
|
"0x00000000000000000000000000000000deadbeef",
|
|
]);
|
|
|
|
function isBurnAddress(address) {
|
|
return BURN_ADDRESSES.has(address.toLowerCase());
|
|
}
|
|
|
|
module.exports = {
|
|
DEBUG,
|
|
DEBUG_MNEMONIC,
|
|
ETHEREUM_MAINNET_CHAIN_ID,
|
|
DEFAULT_RPC_URL,
|
|
DEFAULT_BLOCKSCOUT_URL,
|
|
BIP44_ETH_PATH,
|
|
ERC20_ABI,
|
|
BURN_ADDRESSES,
|
|
isBurnAddress,
|
|
};
|