|
1 | 1 | # Linea Token List |
2 | 2 |
|
3 | | -This repository maintains lists of ERC20 tokens available on Linea. There are two lists: one for Linea Mainnet and one |
4 | | -for Linea Sepolia. It is manually curated by our team, and updated based on submitted PRs via |
| 3 | +Curated lists of ERC-20 tokens available on Linea Mainnet and Linea Sepolia, used by |
| 4 | +the [Linea canonical bridge](https://bridge.linea.build/) UI. |
| 5 | + |
| 6 | +The lists are manually curated by the Linea team and updated based on submitted PRs via |
5 | 7 | the [Linea Developer Hub](https://developer.linea.build). |
6 | 8 |
|
7 | | -If you want to add a token or validate an addition, please follow the procedures outlined below. |
| 9 | +## Requirements |
| 10 | + |
| 11 | +- [Node.js](https://nodejs.org/) v22.22.0 (see [`.nvmrc`](./.nvmrc)) |
| 12 | +- [npm](https://docs.npmjs.com/) v10.0.0+ (ships with Node.js; pinned to `10.9.2` via `packageManager`) |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +```bash |
| 17 | +cp .env.example .env # configure optional provider URLs |
| 18 | +npm install |
| 19 | +npm test # run the unit-test suite |
| 20 | +``` |
| 21 | + |
| 22 | +## Development |
| 23 | + |
| 24 | +See the full [Development Guide](./docs/development.md) for setup details, token addition |
| 25 | +procedures, and guidelines. |
| 26 | + |
| 27 | +### Common Commands |
| 28 | + |
| 29 | +| Command | Description | |
| 30 | +| ---------------------- | ---------------------------------------------------------------------- | |
| 31 | +| `npm test` | Run the unit-test suite (Jest) | |
| 32 | +| `npm run lint` | Check for lint errors (ESLint) | |
| 33 | +| `npm run lint:fix` | Auto-fix lint errors | |
| 34 | +| `npm run prettier` | Check formatting (Prettier) | |
| 35 | +| `npm run prettier:fix` | Auto-fix formatting | |
| 36 | +| `npm run verify` | Compile TypeScript, verify mainnet shortlist on-chain, and auto-format | |
| 37 | + |
| 38 | +### Examples |
| 39 | + |
| 40 | +```bash |
| 41 | +# Verify the mainnet token list against on-chain data |
| 42 | +npm run verify |
| 43 | + |
| 44 | +# Lint and format in one shot |
| 45 | +npm run lint:fix && npm run prettier:fix |
| 46 | +``` |
| 47 | + |
| 48 | +## Project Structure |
8 | 49 |
|
9 | | -## Add a token to the shortlist |
| 50 | +```text |
| 51 | +linea-token-list/ |
| 52 | +├── .github/ |
| 53 | +│ ├── workflows/ # CI/CD workflow definitions |
| 54 | +│ └── PULL_REQUEST_TEMPLATE.md |
| 55 | +├── docs/ |
| 56 | +│ └── development.md # Development guide and token-addition procedures |
| 57 | +├── json/ |
| 58 | +│ ├── linea-mainnet-token-shortlist.json |
| 59 | +│ ├── linea-sepolia-token-shortlist.json |
| 60 | +│ ├── schema/ |
| 61 | +│ │ └── l2-token-list-schema.json |
| 62 | +│ └── templates/ |
| 63 | +│ └── linea-sepolia-token-version-template.json |
| 64 | +├── src/ |
| 65 | +│ ├── abis/ # ABI files (ERC-20, token bridge) |
| 66 | +│ ├── config/ # App configuration and Joi schema |
| 67 | +│ ├── logger/ # Winston logger setup |
| 68 | +│ ├── models/ # TypeScript type definitions |
| 69 | +│ ├── services/ # Core token verification service |
| 70 | +│ └── utils/ # Helpers (validation, file I/O, Ethereum utils) |
| 71 | +├── scripts/ |
| 72 | +│ └── verifyMainnetShortlist.ts # Entry point for `npm run verify` |
| 73 | +├── .env.example # Environment variable template |
| 74 | +├── eslint.config.js # ESLint flat config |
| 75 | +├── jest.config.js # Jest configuration |
| 76 | +├── tsconfig.json # TypeScript configuration |
| 77 | +└── package.json |
| 78 | +``` |
10 | 79 |
|
11 | | -If you represent a project with a token on Linea, it's beneficial to add it to the shortlist. Tokens on this list are |
12 | | -reflected in the UI of the Linea canonical bridge. |
| 80 | +**Key tooling:** |
13 | 81 |
|
14 | | -> [!IMPORTANT] |
15 | | -> Before adding a new token, you must verify the token's smart contract on an explorer. This ensures the authenticity |
16 | | -> and security of the token. You can verify the smart contract |
17 | | -> through [LineaScan](https://lineascan.build/verifyContract) |
| 82 | +- **Package manager**: npm (strict engine enforcement via `.npmrc`) |
| 83 | +- **Linting**: ESLint with `typescript-eslint` |
| 84 | +- **Formatting**: Prettier |
| 85 | +- **Testing**: Jest with `ts-jest` |
| 86 | +- **Git hooks**: Husky (pre-commit runs lint + format check) |
| 87 | + |
| 88 | +## CI/CD |
| 89 | + |
| 90 | +### Continuous Integration |
| 91 | + |
| 92 | +| Workflow | Trigger | Description | |
| 93 | +| ---------------------------------------------------------------------- | ----------------------------- | ----------------------------------------------------------------- | |
| 94 | +| [Test and Validate JSON](./.github/workflows/validate-json.yml) | Push to `main`, PRs to `main` | TypeScript check, lint, tests, formatting, JSON schema validation | |
| 95 | +| [Security Code Scanner](./.github/workflows/security-code-scanner.yml) | Push to `main`, PRs to `main` | MetaMask security code scanner | |
| 96 | + |
| 97 | +### Continuous Verification |
| 98 | + |
| 99 | +| Workflow | Trigger | Description | |
| 100 | +| -------------------------------------------------- | -------------- | ------------------------------------------------ | |
| 101 | +| [Verify JSON](./.github/workflows/verify-json.yml) | Push to `main` | Verifies mainnet shortlist against on-chain data | |
| 102 | + |
| 103 | +## Add a Token to the Shortlist |
| 104 | + |
| 105 | +If you represent a project with a token on Linea, it is beneficial to add it to the |
| 106 | +shortlist. Tokens on this list are reflected in the UI of the Linea canonical bridge. |
| 107 | + |
| 108 | +> **Important:** Before adding a new token, you must verify the token's smart contract on |
| 109 | +> an explorer. This ensures the authenticity and security of the token. You can verify the |
| 110 | +> smart contract through [LineaScan](https://lineascan.build/verifyContract) |
18 | 111 | > or [other tools](https://docs.linea.build/get-started/how-to/verify-smart-contract). |
19 | 112 | > The same verification should be done on Ethereum L1 and Linea if necessary. |
20 | 113 |
|
21 | | -To add a new token, you need to go through the [Linea Developer Hub](https://developer.linea.build) registration process. |
| 114 | +To add a new token, go through the [Linea Developer Hub](https://developer.linea.build) |
| 115 | +registration process. |
| 116 | + |
| 117 | +For maintainers who need to add a token manually, see the |
| 118 | +[Development Guide](./docs/development.md#manually-add-a-token-to-the-list). |
| 119 | + |
| 120 | +## Contributing |
| 121 | + |
| 122 | +See [CONTRIBUTING.md](./CONTRIBUTING.md). |
22 | 123 |
|
23 | | -## Technical resources (for maintainers) |
| 124 | +## License |
24 | 125 |
|
25 | | -- [Development Guide](./docs/development.md). |
| 126 | +Dual-licensed under [MIT](./LICENSE-MIT) or [Apache-2.0](./LICENSE-APACHE). |
0 commit comments