Skip to content

Commit 2f47a12

Browse files
committed
chore: modernize tooling, remove dead code, and rewrite docs
1 parent c84275d commit 2f47a12

24 files changed

+792
-2705
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ PROVIDER_URL=https://mainnet.infura.io/v3/<YOUR_INFURA_API_KEY>
33
LINEA_PROVIDER_URL=https://linea-mainnet.infura.io/v3/<YOUR_INFURA_API_KEY>
44
CONTRACT_ADDRESS=0x051F1D88f0aF5763fB888eC4378b4D8B29ea3319
55
L2_CONTRACT_ADDRESS=0x353012dc4a9A6cF55c941bADC267f82004A8ceB9
6-
COINMARKETCAP_API_KEY=<YOUR_COINMARKETCAP_API_KEY>

.eslintrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
1+
## Description
2+
13
**Action:** Add / Update / Remove token (choose one)
24

5+
**Token name:** <!-- e.g. USD Coin -->
6+
**Network:** Mainnet / Sepolia (choose one)
7+
38
**Context / Rationale:**
4-
<brief explanation here>
9+
10+
<!-- Brief explanation of why this change is needed -->
11+
12+
Closes #<!-- issue number, if applicable -->
513

614
---
715

8-
### PR Checklist
16+
## Type of Change
17+
18+
- [ ] Token addition
19+
- [ ] Token update (metadata, address, type)
20+
- [ ] Token removal
21+
- [ ] Documentation update
22+
- [ ] Code change (scripts, config, CI)
23+
24+
## Checklist
925

10-
- [ ] Verified and published the contract source
11-
- [ ] Kept the token list in alphabetical order by token symbol
26+
- [ ] Verified and published the contract source on an explorer
27+
- [ ] Kept the token list in alphabetical order by token name
1228
- [ ] Updated the `updatedAt` field (and `createdAt` if applicable)
13-
- [ ] Updated the list version number according to the README instructions
29+
- [ ] Updated the list version number according to the
30+
[guidelines](./docs/development.md#guidelines)
31+
- [ ] JSON conforms to the
32+
[schema](./json/schema/l2-token-list-schema.json)
33+
- [ ] Did not modify the schema or template files
34+
- [ ] No secrets, private keys, or real API keys in the diff

.github/workflows/validate-json.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020

2121
- name: Set up Node.js
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
2323
with:
2424
node-version-file: '.nvmrc'
2525
cache: 'npm'
@@ -28,7 +28,7 @@ jobs:
2828
run: npm ci
2929

3030
- name: Run TypeScript check
31-
run: npx tsc --noEmit
31+
run: npm run typecheck
3232

3333
- name: Run linter
3434
run: npm run lint
@@ -37,16 +37,16 @@ jobs:
3737
run: npm test
3838

3939
- name: Check formatting
40-
run: npm run prettify
40+
run: npm run prettier
4141

4242
validate_json:
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: Checkout code
46-
uses: actions/checkout@v5
46+
uses: actions/checkout@v6
4747

4848
- name: Set up Python
49-
uses: actions/setup-python@v5
49+
uses: actions/setup-python@v6
5050
with:
5151
python-version: '3.12'
5252

.github/workflows/verify-json.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818

1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@v5
21+
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424

2525
- name: Setup Node.js
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
2828
node-version-file: '.nvmrc'
2929
cache: 'npm'

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npm run lint && npm run precommit
1+
npm run lint && npm run prettier

CONTRIBUTING.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributing to Linea Token List
2+
3+
Thank you for your interest in contributing to the Linea Token List. This guide covers
4+
the development workflow for maintainers and external contributors.
5+
6+
## Prerequisites
7+
8+
See the [Requirements](./README.md#requirements) section in the README.
9+
10+
## Getting Started
11+
12+
```bash
13+
git clone git@github.com:Consensys/linea-token-list.git
14+
cd linea-token-list
15+
cp .env.example .env
16+
npm install
17+
```
18+
19+
## Development Workflow
20+
21+
1. Create a feature branch from `main`:
22+
23+
```bash
24+
git checkout -b feat/add-token-xyz
25+
```
26+
27+
2. Make your changes (see the [Development Guide](./docs/development.md) for token
28+
addition procedures and guidelines).
29+
30+
3. Run quality checks before committing:
31+
32+
```bash
33+
npm run lint
34+
npm run prettier
35+
npm test
36+
```
37+
38+
The pre-commit hook runs lint and formatting checks automatically.
39+
40+
4. Commit your changes and push the branch:
41+
42+
```bash
43+
git add .
44+
git commit -m "feat: add XYZ token to mainnet shortlist"
45+
git push -u origin feat/add-token-xyz
46+
```
47+
48+
5. Open a pull request against `main` on
49+
[GitHub](https://github.com/Consensys/linea-token-list/pulls). Fill in the
50+
[PR template](./.github/PULL_REQUEST_TEMPLATE.md).
51+
52+
## Code Quality
53+
54+
| Check | Command | Description |
55+
| ----------------- | ---------------------- | ----------------------------------------------- |
56+
| Lint | `npm run lint` | ESLint checks on TypeScript source |
57+
| Lint (auto-fix) | `npm run lint:fix` | Auto-fix lint errors |
58+
| Format | `npm run prettier` | Prettier formatting check |
59+
| Format (auto-fix) | `npm run prettier:fix` | Auto-fix formatting |
60+
| Tests | `npm test` | Jest unit tests |
61+
| Verify | `npm run verify` | Full on-chain verification of mainnet shortlist |
62+
63+
## PR Guidelines
64+
65+
- Use the [PR template](./.github/PULL_REQUEST_TEMPLATE.md).
66+
- Only commit the token list file(s). Do not modify the schema or templates.
67+
- Ensure CI checks pass before requesting review.
68+
- Keep one token addition per PR unless batch additions are coordinated with maintainers.
69+
70+
## License
71+
72+
By contributing, you agree that your contributions will be licensed under the same
73+
[MIT OR Apache-2.0](./README.md#license) dual license as the project.

README.md

Lines changed: 114 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,126 @@
11
# Linea Token List
22

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
57
the [Linea Developer Hub](https://developer.linea.build).
68

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
849

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+
```
1079

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:**
1381

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)
18111
> or [other tools](https://docs.linea.build/get-started/how-to/verify-smart-contract).
19112
> The same verification should be done on Ethereum L1 and Linea if necessary.
20113
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).
22123

23-
## Technical resources (for maintainers)
124+
## License
24125

25-
- [Development Guide](./docs/development.md).
126+
Dual-licensed under [MIT](./LICENSE-MIT) or [Apache-2.0](./LICENSE-APACHE).

babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)