Skip to content

Commit 003729f

Browse files
authored
Merge pull request #14 from kleros/feat/support-tokenlist-kleros-eth
feat: upload same list to tokenlist.kleros.eth
2 parents 5303f80 + fe11544 commit 003729f

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

.env.example

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ CURATE_GRAPH_URL=https://api.studio.thegraph.com/query/61738/legacy-curate-gnosi
22
KLEROS_TOKENS_REGISTRY_ADDRESS=0xee1502e29795ef6c2d60f8d7120596abe3bad990
33

44
ENS_CONTRACT=0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
5-
ENS_TOKEN_LIST_NAME=t2crtokens.eth
5+
ENS_T2CRTOKENS_NAME=t2crtokens.eth
6+
ENS_TOKENLIST_NAME=tokenlist.kleros.eth
67

7-
LATEST_TOKEN_LIST_URL=https://t2crtokens.eth.limo
8+
LATEST_T2CRTOKENS_URL=https://t2crtokens.eth.limo
9+
LATEST_TOKENLIST_URL=https://tokenlist.kleros.eth.limo
810

911
PROVIDER_URL=https://mainnet.infura.io/v3/<your-key>
1012
IPFS_GATEWAY=https://cdn.kleros.link
@@ -13,4 +15,5 @@ WALLET_KEY=
1315

1416
# Optional. If not provided, 300 seconds (5 minutes will be used).
1517
POLL_PERIOD_SECONDS=300
16-
18+
# Change to prod if want to remove debug logs
19+
NODE_ENV=development

src/erc20.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default async function checkPublishErc20(
101101
console.info('List did not change.')
102102
console.info(
103103
'Latest list can be found at',
104-
process.env.LATEST_TOKEN_LIST_URL,
104+
listURL,
105105
)
106106
return
107107
} else {

src/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,25 @@ async function main() {
144144
}
145145
}
146146

147-
// Publish fungible tokens
147+
// Update tokens list in ENS (if needed)
148148
await checkPublishErc20(
149149
tokensWithLogo,
150150
provider,
151-
process.env.LATEST_TOKEN_LIST_URL,
152-
process.env.ENS_TOKEN_LIST_NAME,
151+
process.env.LATEST_T2CRTOKENS_URL,
152+
process.env.ENS_T2CRTOKENS_NAME,
153153
'Tokens',
154154
't2cr.tokenlist.json',
155155
)
156+
157+
// Update tokens list in ENS (if needed)
158+
await checkPublishErc20(
159+
tokensWithLogo,
160+
provider,
161+
process.env.LATEST_TOKENLIST_URL,
162+
process.env.ENS_TOKENLIST_NAME,
163+
'Tokens',
164+
'tokenlist.tokenlist.json',
165+
)
156166
}
157167

158168
main().catch((err) => {

src/types/environment.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ declare global {
77
KLEROS_TOKENS_REGISTRY_ADDRESS: string
88
PROVIDER_URL: string
99
POLL_PERIOD_SECONDS: string
10-
LATEST_TOKEN_LIST_URL: string
10+
LATEST_T2CRTOKENS_URL: string
11+
LATEST_TOKENLIST_URL: string
1112
IPFS_GATEWAY: string
1213
WALLET_KEY: string
1314
ENS_CONTRACT: string
14-
ENS_TOKEN_LIST_NAME: string
15+
ENS_T2CRTOKENS_NAME: string,
16+
ENS_TOKENLIST_NAME: string
1517
}
1618
}
1719
}

0 commit comments

Comments
 (0)