# erc20lookup

> Lookup multiple ERC20 tokens' metadata

Latest version **1.2.1** (published 2024-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install erc20lookup
pnpm add erc20lookup
yarn add erc20lookup
bun add erc20lookup
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2024-02-08 |
| First published | 2022-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 284.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | egorfine |

## Links

- npm: https://www.npmjs.com/package/erc20lookup
- Repository: https://github.com/egorFiNE/erc20lookup
- Homepage: https://github.com/egorFiNE/erc20lookup#readme
- Issues: https://github.com/egorFiNE/erc20lookup/issues
- npm.io page: https://npm.io/package/erc20lookup

## Recent versions

- 1.2.1 (latest) — 2024-02-08
- 1.2.0 — 2024-02-01
- 1.1.1 — 2023-08-30
- 1.1.0 — 2023-07-08
- 1.0.7 — 2023-03-13
- 1.0.6 — 2023-03-10
- 1.0.5 — 2023-01-11
- 1.0.4 — 2022-07-29
- 1.0.3 — 2022-05-25
- 1.0.2 — 2022-05-25
- 1.0.1 — 2022-05-25
- 1.0.0 — 2022-05-19

## README

# ERC20Lookup

Lookup multiple ERC20 token's metadata and store it in `contract.erc20` hash.

```javascript
import { lookup } from 'erc20lookup';
import { ethers } from 'ethers'; // ethers v6 or v5 supported

const provider = new ethers.JsonRpcProvider('https://cloudflare-eth.com/v1/mainnet');
const usdt = new ethers.Contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', ERC20_ABI, provider);
await lookup(provider, [ usdt ]);

console.log(usdt.erc20.symbol);
console.log(usdt.erc20.name);
console.log(usdt.erc20.decimals);
```

# Usage

See `test/erc20lookupTest.mjs`

# Deployments and networks

Deployment addresses are hardcoded inside `index.mjs`.

The following networks are currently supported:

| chainId | Network | Address |
| --- | --- | --- |
| 0x01 | Ethereum | [`0x6e7285c3E47c242e3aD62eDD5D0F19886F1e7ef0`](https://etherscan.io/address/0x6e7285c3E47c242e3aD62eDD5D0F19886F1e7ef0) |
| 0x89 | Polygon | [`0xFe35BC1Ff694883dE8D31f3a87C5a668BCE765B0`](https://polygonscan.com/address/0xFe35BC1Ff694883dE8D31f3a87C5a668BCE765B0) |
| 0xa4b1 | Arbitrum | [`0x2a20c66948373c7F619b32737c0bFa1dDa94E6E4`](https://arbiscan.io/address/0x2a20c66948373c7F619b32737c0bFa1dDa94E6E4) |
| 0x2105 | Base | [`0x2C923114fC052D93BDda932DAe1a49668C17b0F0`](https://basescan.org/address/0x2C923114fC052D93BDda932DAe1a49668C17b0F0) |
| 0x38 | BNB | [`0x9a8D6BB3c45E100c8456a8295C8b90b993bE20D4`](https://bscscan.com/address/0x9a8D6BB3c45E100c8456a8295C8b90b993bE20D4) |
| 43114 | Avalanche | [`0xCbCB78054731a6FCCa53920959033810Ff0A7D1d`](https://snowtrace.io/address/0xCbCB78054731a6FCCa53920959033810Ff0A7D1d) |
| 0xfa | Fantom | [`0xD07b8Ddbb60aA59648F8697A2faCbDa4C8ed4994`](https://ftmscan.com/address/0xD07b8Ddbb60aA59648F8697A2faCbDa4C8ed4994) |
| 0x0a | Optimistic | [`0xEF0Bb05F544b8540E538B958257C466dcB7347D0`](https://optimistic.etherscan.io/address/0xEF0Bb05F544b8540E538B958257C466dcB7347D0) |
| 0x4e454152 | Aurora | `0x48cF154a086bAB5492A8D150f4d87a74eCf90743` |
| 0xa0c71fd | Blast Testnet (Sepolia) | [`0x529dbe909c6461b6fa5cA85A52DCd09087182675`](https://testnet.blastscan.io/address/0x529dbe909c6461b6fa5cA85A52DCd09087182675/contract/168587773/code) |
| 0x61 | BNB Testnet | [`0x73E068e9c7ffc91F463ca5464E77E6826D84E3A5`](https://testnet.bscscan.com/address/0x73E068e9c7ffc91F463ca5464E77E6826D84E3A5) |
| 0xaa36a7 | Ethereum Sepolia | [`0x746418DB600352A808709f2048E797ab0918C581`](https://sepolia.etherscan.io/address/0x746418DB600352A808709f2048E797ab0918C581) |
| 0x05 | Goerli Testnet | [`0x1a7f041dDC8919D26dB38E186E00e6E36dCCA0E6`](https://goerli.etherscan.io/address/0x1a7f041dDC8919D26dB38E186E00e6E36dCCA0E6) |

# Overriding contract address

Need to use your own deployment? Specify the contract address in the `ERC20_LOOKUP_CONTRACT_ADDRESS` env variable or supply it as a third argument to `lookup`:

```javascript
await lookup(provider, [ usdt ], '0x....');
```

# Ethers support

We support both v5 and v6, but none is listed in this module's dependencies. You'll have to install ethers manually to run tests:

```bash
npm install --no-save ethers
```

# Tests

## Node module tests

```bash
npm install --no-save ethers
npm run test
```

## Solidity tests

```bash
npm install
hardhat test
```

---
_Source: https://npm.io/package/erc20lookup · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
