Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add brBTC, Remote Bridged mBTC and Bridged egETH tokens #42

Merged
merged 4 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hemilabs/token-list",
"version": "1.10.0",
"version": "1.11.0",
"description": "List of ERC-20 tokens in the Hemi Network chains",
"bugs": {
"url": "https://github.com/hemilabs/token-list/issues"
Expand Down
6 changes: 5 additions & 1 deletion scripts/add-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ async function addToken() {
() => undefined,
);

const filename = symbol.toLowerCase().replace(".e", "");
const filename = symbol
.toLowerCase()
.replace(".e", "")
.replaceAll(" ", "-")
.toLowerCase();
const repoUrl = "https://raw.githubusercontent.com/hemilabs/token-list";
const logoURI = `${repoUrl}/master/src/logos/${filename}.svg`;
tokenList.tokens.push({
Expand Down
17 changes: 16 additions & 1 deletion scripts/validate-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,28 @@ const tokenList = JSON.parse(
const schemaUrl =
"https://raw.githubusercontent.com/Uniswap/token-lists/main/src/tokenlist.schema.json";

// Some tokens are invalid (they were deployed with a schema that doesn't match the expected Uniswap list).
// So we must exclude these.
// TODO see https://github.com/hemilabs/token-list/issues/41
const tokenAddressToExclude = [
// Remote Bridged mBTC
"0x0Af3EC6F9592C193196bEf220BC0Ce4D9311527D",
// Bridged egETH
"0x027a9d301FB747cd972CFB29A63f3BDA551DFc5c",
];

// See https://github.com/uniswap/token-lists?tab=readme-ov-file#validating-token-lists
async function validate() {
const ajv = new Ajv({ allErrors: true, verbose: true });
addFormats(ajv);
const schema = await fetch(schemaUrl).then((r) => r.json());
const validator = ajv.compile(schema);
const valid = validator(tokenList);
const valid = validator({
...tokenList,
tokens: tokenList.tokens.filter(
(token) => !tokenAddressToExclude.includes(token.address),
),
});
if (valid) {
return;
}
Expand Down
37 changes: 35 additions & 2 deletions src/hemi.tokenlist.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"name": "Hemi Token List",
"timestamp": "2025-02-14T18:27:35.910Z",
"timestamp": "2025-03-03T20:09:15.197Z",
"version": {
"major": 1,
"minor": 10,
"minor": 11,
"patch": 0
},
"tokens": [
{
"address": "0x027a9d301FB747cd972CFB29A63f3BDA551DFc5c",
"chainId": 43111,
"decimals": 18,
"extensions": {
"birthBlock": 1129497
},
"logoURI": "https://raw.githubusercontent.com/hemilabs/token-list/master/src/logos/bridged-egeth.svg",
"name": "Bridged egETH",
"symbol": "Bridged egETH"
},
{
"address": "0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3",
"chainId": 43111,
Expand All @@ -23,6 +34,17 @@
"name": "Wrapped BTC",
"symbol": "WBTC"
},
{
"address": "0x0Af3EC6F9592C193196bEf220BC0Ce4D9311527D",
"chainId": 43111,
"decimals": 8,
"extensions": {
"birthBlock": 1187223
},
"logoURI": "https://raw.githubusercontent.com/hemilabs/token-list/master/src/logos/remote-bridged-mbtc.svg",
"name": "Liquid Staked BTC",
"symbol": "Remote Bridged mBTC"
},
{
"address": "0x12B6e6FC45f81cDa81d2656B974E8190e4ab8D93",
"chainId": 43111,
Expand Down Expand Up @@ -226,6 +248,17 @@
"protocol": "exSat"
}
},
{
"address": "0x93919784C523f39CACaa98Ee0a9d96c3F32b593e",
"chainId": 43111,
"decimals": 8,
"extensions": {
"birthBlock": 971348
},
"logoURI": "https://raw.githubusercontent.com/hemilabs/token-list/master/src/logos/brbtc.svg",
"name": "brBTC",
"symbol": "brBTC"
},
{
"address": "0x98D6E32f3092D39A6c0B36062cC9EB1E52Ccc99D",
"chainId": 43111,
Expand Down
27 changes: 27 additions & 0 deletions src/logos/brbtc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/logos/bridged-egeth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/logos/remote-bridged-mbtc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions test/hemi.tokenlist.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ describe("List of tokens", function () {
});

it("image URL and file should be valid", function () {
const repoUrl = "https://raw.githubusercontent.com/hemilabs/token-list";
const filename = symbol.toLowerCase().replace(".e", "");
// TODO https://github.com/hemilabs/token-list/issues/36 testnet bitcoin logo url needs to be updated
if (address === "0x36Ab5Dba83d5d470F670BC4c06d7Da685d9afAe7") {
this.skip();
return;
}
const repoUrl = "https://raw.githubusercontent.com/hemilabs/token-list";
const filename = symbol
.toLowerCase()
.replace(".e", "")
.replaceAll(" ", "-")
.toLowerCase();
assert.equal(logoURI, `${repoUrl}/master/src/logos/${filename}.svg`);
fs.accessSync(`src/logos/${filename}.svg`);
});
Expand Down