add-chain
Skill2 starsChanged 2 days agoMITView on GitHub
Adds an EVM chain, or new tokens and contracts on a chain, to the registry in @binference/chains, each address read on chain first. Use when a chain, a token or a venue's contract address joins the registry.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-mcp-toolSkill
- add-migrationSkill
- add-protocol-operationSkill
- add-venueSkill
- clean-diffSkill
- debug-failureSkill
- handle-security-reportSkill
- releaseSkill
- review-diffSkill
- review-money-pathSkill
- review-testsSkill
- run-testsSkill
- shape-commitSkill
- speed-up-testsSkill
- test-telegramSkill
- tune-ciSkill
- vet-releaseSkill
- write-adrSkill
- binference-toolsSkill
- copy-tradingSkill
- dca-planSkill
- meme-huntingSkill
- safe-swapSkill
- token-due-diligenceSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Write each address in its EIP-55 checksum form.
- Very specific: line 37
Every token and contract carries a verification: its source URL, the day you read it and control: "read" ("not_read" while the proxy and …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a chain
A chain is data. The engine never names one: it reads the registry. Adding an EVM chain is a file
in packages/chains, its venue addresses and fork tests; nothing in engine changes. A new chain
family (not EVM) is a new package instead and needs its own ADR.
1. Decide first
v1 enables BSC only (decision 0023). A new chain that owners can turn on needs the maintainers'
yes: write the ADR with write-adr before the code. Tokens and contracts on BSC need no ADR.
2. Read every address on chain
An address enters the registry only after you read it on the chain itself:
- code is present at the address;
- for a proxy, the implementation and admin slots, and the owner, are read;
- one call ties it to its siblings (a router's factory, a pool's tokens, a token's decimals);
- the source is the project's own public page, repo or API, never a forum post, a block explorer's label alone, or a local note.
Write each address in its EIP-55 checksum form. Take decimals from the token's decimals():
stablecoins on BSC have 18.
3. Write the data
- One file per chain at the top of
packages/chains/src/, named after the chain's registry key (bsc.ts), exported as aChainDefinitionfrom@binference/chain: the CAIP-2 id, the key, the name, the family, the native asset, the block time, the finality rule, RPCs, relays, explorers (each with itstxUrltransaction page,{hash}where the hash goes, and itsaddressUrladdress page,{address}where the address goes), tokens and contracts. - Every token and contract carries a
verification: its source URL, the day you read it andcontrol: "read"("not_read"while the proxy and owner are still unread). - Contract names are kebab-case and unique within their venue; the venue is the plugin's id.
- The chain's ceiling caps and price feeds sit beside it, as
bsc.tsexportsbscCeilingCapsandbscPriceFeeds. - Export the new values from
packages/chains/src/index.ts. Any helper file goes into a folder:check:chain-literalsreads every top-level file name as a chain key. - Pure packages (marked
pureinconfig/package-graph.json) never spell a chain: noeip155:literal, chain id, chain key or hex address.
4. Wire it
- The composition root lists the chains it serves (
selfHostedChainsinpackages/cli/src/compose/open-engine-parts.ts). - The config schema in
packages/cli/src/config/schema/chains-venues.schema.tsholds the chain's defaults, such as its network fee cap. Runpnpm check:config-schema --writeand commit the regenerated snapshot and key reference.
5. Test
- The chain's
*.test.tsbeside its file, likebsc.test.ts: the definition parses, every address is checksummed and appears once, each has a dated, sourced verification. - A fork test in
packages/chain-evm/src/fork/readseth_getCodeat every token and contract at the pinned block, likebsc-addresses.test.ts. The fork suite forks BSC today; a second chain adds its fork to the suite's global setup inconfig/vitest/fork-setup.ts. - Venues that trade on the chain run their fork tests on it (
add-venue).
pnpm vitest run packages/chains --maxWorkers=2
pnpm test:fork packages/chain-evm/src/fork
pnpm run check:chain-literalschains is money-path code: run review-money-path and paste its checklist into the pull
request.
6. Report
The chain or the addresses added, each with its source and the day it was read, the fork run that read them, and the ADR when a chain was added.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

