Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ac448f0

Browse files
karelvuongmulfdev
andauthoredJan 8, 2025
chore: add docs + restructure repo (#4)
* chore: add docs + restructure repo - Add README.md and CONTRIBUTING.md - Change file structure to group token data (20, 721, 1155) under `data/` * readme update --------- Co-authored-by: mulf <mail@mulf.wtf> Co-authored-by: Mulf <63870279+mulfdev@users.noreply.github.com>
1 parent fc155e5 commit ac448f0

File tree

9 files changed

+105
-11
lines changed

9 files changed

+105
-11
lines changed
 

‎CONTRIBUTING.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Contributing to Treasure Bridged Token Registry
2+
3+
This guide explains how to propose adding new tokens to the Treasure Bridge whitelist registry.
4+
5+
## Token Submission Process
6+
7+
1. Fork this repository
8+
2. Add your token details to the appropriate JSON file in either `data/mainnet/` or `data/testnet/`:
9+
- ERC20 tokens: `erc20.json`
10+
- ERC721 tokens: `erc721.json`
11+
- ERC1155 tokens: `erc1155.json`
12+
3. Create a Pull Request
13+
14+
## Token Information Requirements
15+
16+
All tokens should be added to the `tokens` array in the respective JSON file.
17+
18+
### ERC20 Tokens
19+
Add your token to `erc20.json` using the following format:
20+
21+
{
22+
"name": "Token Name",
23+
"srcChainId": 5, // Source chain ID
24+
"destChainId": 80001, // Destination chain ID
25+
"srcTokenAddress": "0x...", // Token address on source chain
26+
"destTokenAddress": "0x...", // Token address on destination chain
27+
"isNft": false,
28+
"isCollateral": true, // Optional: true if token is collateral
29+
"underlyingTokenAddress": "0x..." // Optional: required if isCollateral is true
30+
}
31+
32+
### ERC721 Tokens
33+
Add your NFT collection to `erc721.json` using the following format:
34+
35+
{
36+
"name": "Collection Name",
37+
"srcChainId": 421613,
38+
"destChainId": 5,
39+
"srcTokenAddress": "0x...",
40+
"destTokenAddress": "0x...",
41+
"isNft": true,
42+
"nftStandard": "ERC721",
43+
"isCollateral": false,
44+
"underlyingTokenAddress": "0x...", // Optional: required if isCollateral is true
45+
"nftBatchSignature": "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)"
46+
}
47+
48+
### ERC1155 Tokens
49+
Add your collection to `erc1155.json` using the following format:
50+
51+
{
52+
"name": "Collection Name",
53+
"srcChainId": 5,
54+
"destChainId": 420,
55+
"srcTokenAddress": "0x...",
56+
"destTokenAddress": "0x...",
57+
"isNft": true,
58+
"nftStandard": "ERC1155",
59+
"isCollateral": true,
60+
"underlyingTokenAddress": "0x...", // Optional: required if isCollateral is true
61+
"nftBatchSignature": "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)"
62+
}
63+
64+
## Submission Requirements
65+
66+
1. **Contract Verification**
67+
- Contract must be verified on the respective network's block explorer
68+
- Must be a valid implementation of the respective token standard (ERC20/721/1155)
69+
70+
2. **Security**
71+
- Contract should have no known vulnerabilities
72+
- Preferably audited by a reputable security firm
73+
74+
3. **PR Description Requirements**
75+
- Source and destination chain IDs
76+
- Contract addresses on both chains
77+
- Brief description of the token/collection
78+
- Link to project website
79+
- Link to verified contracts on block explorers
80+
- Link to audit report (if available)
81+
82+
## Pull Request Process
83+
84+
1. Ensure your token information follows the correct JSON format
85+
2. Create a PR with a clear title (e.g., "Add MAGIC to ERC20 whitelist")
86+
3. Fill out all required information in the PR description
87+
4. Wait for review from maintainers
88+
5. Address any requested changes
89+
6. Once approved, your token will be added to the registry
90+
91+
## Questions or Issues?
92+
93+
If you have questions about the contribution process or encounter any issues, please open a GitHub issue in this repository.

‎README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ This repository maintains the official registry of bridged tokens in the Treasur
44

55
## Structure
66

7-
The registry is organized into two main directories:
7+
The repository organizes token registries by network and token standard. In the `data` directory
8+
you'll find
89

910
- `mainnet/`: Production token configurations
1011
- `testnet/`: Test network token configurations
1112

1213
Each directory contains three JSON files:
1314

14-
- `erc20-data.json`: ERC20 token configurations
15-
- `erc721-data.json`: ERC721 token configurations
16-
- `erc1155-data.json`: ERC1155 token configurations
15+
- `erc20.json`: ERC20 token configurations
16+
- `erc721.json`: ERC721 token configurations
17+
- `erc1155.json`: ERC1155 token configurations
1718

1819
## Token Configuration
1920

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎main.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ func main() {
3131
// Data file locations by token type
3232
dataFiles := map[TokenType][2]string{
3333
ERC20: {
34-
"testnet/erc20-data.json",
35-
"mainnet/erc20-data.json",
34+
"data/testnet/erc20.json",
35+
"data/mainnet/erc20.json",
3636
},
3737
ERC721: {
38-
"testnet/erc721-data.json",
39-
"mainnet/erc721-data.json",
38+
"data/testnet/erc721.json",
39+
"data/mainnet/erc721.json",
4040
},
4141
ERC1155: {
42-
"testnet/erc1155-data.json",
43-
"mainnet/erc1155-data.json",
42+
"data/testnet/erc1155.json",
43+
"data/mainnet/erc1155.json",
4444
},
4545
}
4646

@@ -110,5 +110,5 @@ func main() {
110110
os.Exit(1)
111111
}
112112

113-
fmt.Println("All token configurations validated successfully")
113+
fmt.Println("All token configurations validated successfully.")
114114
}

0 commit comments

Comments
 (0)
Please sign in to comment.