Skip to content

Commit c863242

Browse files
committed
fix jioswap
1 parent 62aae41 commit c863242

File tree

4 files changed

+142
-58
lines changed

4 files changed

+142
-58
lines changed

projects/helper/chains.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"meter",
9191
"zilliqa",
9292
"godwoken",
93+
"godwoken_v1",
9394
"zksync",
9495
"zyx",
9596
"karura",

projects/helper/portedTokens.js

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,49 +1276,52 @@ function fixGodwokenBalances(balances) {
12761276
coingeckoId: "bitcoin",
12771277
decimals: 18,
12781278
}, // Wrapped BTC (ForceBridge from BSC)
1279-
1280-
"0x9E858A7aAEDf9FDB1026Ab1f77f627be2791e98A": {
1281-
coingeckoId: "ethereum",
1282-
decimals: 18,
1283-
}, // ETH (via Forcebridge from ETH)
1284-
1285-
"0xB66954619363145a05eF835547449EB9050d82f6": {
1286-
coingeckoId: "ethereum",
1287-
decimals: 18,
1288-
}, // WETH (Via Celer CBridge From ETH)
1289-
"0x186181e225dc1Ad85a4A94164232bD261e351C33": {
1290-
coingeckoId: "usd-coin",
1291-
decimals: 6,
1292-
}, // USDC (via Forcebridge from ETH
1293-
"0x53bB26dc8C5EFC6c95C37155aCa487d1D043436a": {
1294-
coingeckoId: "usd-coin",
1295-
decimals: 6,
1296-
}, // USDC (Via Celer CBridge From ETH)
1297-
"0x2c9Fc6087875646112f66a3C92fEF2d158FAa76e": {
1298-
coingeckoId: "dai",
1299-
decimals: 18,
1300-
}, // DAI (via Forcebridge from ETH)
1301-
"0x317F8d18FB16E49a958Becd0EA72f8E153d25654": {
1302-
coingeckoId: "dai",
1303-
decimals: 18,
1304-
}, // Dai (Via Celer CBridge From ETH)
1305-
"0x8E019acb11C7d17c26D334901fA2ac41C1f44d50": {
1306-
coingeckoId: "tether",
1307-
decimals: 6,
1308-
}, // USDT (via Forcebridge from ETH)
1309-
"0x3c790b38f466514ffCB4230e7B2334e52B64c942": {
1310-
coingeckoId: "tether",
1311-
decimals: 6,
1312-
}, // USDT (Via Celer CBridge From ETH)
1313-
"0xcD7bC9fC617a4F82eC1c8359D1C8610B90e3B44C": {
1314-
coingeckoId: "binance-usd",
1315-
decimals: 18,
1316-
}, // BUSD (Via Celer CBridge From BSC)
13171279
};
13181280

13191281
return fixBalances(balances, mapping);
13201282
}
13211283

1284+
const godwokenV1FixMapping = {
1285+
1286+
"0x9E858A7aAEDf9FDB1026Ab1f77f627be2791e98A": {
1287+
coingeckoId: "ethereum",
1288+
decimals: 18,
1289+
}, // ETH (via Forcebridge from ETH)
1290+
1291+
"0xB66954619363145a05eF835547449EB9050d82f6": {
1292+
coingeckoId: "ethereum",
1293+
decimals: 18,
1294+
}, // WETH (Via Celer CBridge From ETH)
1295+
"0x186181e225dc1Ad85a4A94164232bD261e351C33": {
1296+
coingeckoId: "usd-coin",
1297+
decimals: 6,
1298+
}, // USDC (via Forcebridge from ETH
1299+
"0x53bB26dc8C5EFC6c95C37155aCa487d1D043436a": {
1300+
coingeckoId: "usd-coin",
1301+
decimals: 6,
1302+
}, // USDC (Via Celer CBridge From ETH)
1303+
"0x2c9Fc6087875646112f66a3C92fEF2d158FAa76e": {
1304+
coingeckoId: "dai",
1305+
decimals: 18,
1306+
}, // DAI (via Forcebridge from ETH)
1307+
"0x317F8d18FB16E49a958Becd0EA72f8E153d25654": {
1308+
coingeckoId: "dai",
1309+
decimals: 18,
1310+
}, // Dai (Via Celer CBridge From ETH)
1311+
"0x8E019acb11C7d17c26D334901fA2ac41C1f44d50": {
1312+
coingeckoId: "tether",
1313+
decimals: 6,
1314+
}, // USDT (via Forcebridge from ETH)
1315+
"0x3c790b38f466514ffCB4230e7B2334e52B64c942": {
1316+
coingeckoId: "tether",
1317+
decimals: 6,
1318+
}, // USDT (Via Celer CBridge From ETH)
1319+
"0xcD7bC9fC617a4F82eC1c8359D1C8610B90e3B44C": {
1320+
coingeckoId: "binance-usd",
1321+
decimals: 18,
1322+
}, // BUSD (Via Celer CBridge From BSC)
1323+
}
1324+
13221325
const wavesMapping = {
13231326
"5UYBPpq4WoU5n4MwpFkgJnW3Fq4B1u3ukpK33ik4QerR": {
13241327
coingeckoId: "binancecoin",
@@ -2048,6 +2051,7 @@ const fixBalancesMapping = {
20482051
harmony: fixHarmonyBalances,
20492052
hpb: fixHPBBalances,
20502053
godwoken: fixGodwokenBalances,
2054+
godwoken_v1: b => fixBalances(b, godwokenV1FixMapping, { removeUnmapped: false }),
20512055
klaytn: fixKlaytnBalances,
20522056
waves: fixWavesBalances,
20532057
songbird: b => fixBalances(b, songbirdFixMapping, { removeUnmapped: true }),

projects/jioswap/config.json

Lines changed: 89 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,92 @@
11
{
2-
"meter": {
3-
"jioMeterUSD": {
4-
"address": "0x559Ec9D7D0a80220C8167d6B413d8AA1B26f596D",
5-
"lpToken": "0x4CD99606b98230b039a82bE45165663f6A931A96",
6-
"poolTokens": [
7-
{
8-
"address": "0x24aa189dfaa76c671c279262f94434770f557c35",
9-
"name": "BUSD"
10-
},
11-
{
12-
"address": "0xD86e243FC0007e6226B07c9A50C9d70D78299EB5",
13-
"name": "USDC"
14-
},
15-
{
16-
"address": "0x5fa41671c48e3c951afc30816947126ccc8c162e",
17-
"name": "USDT"
18-
}
19-
]
20-
}
2+
"meter": {
3+
"jioMeterUSD": {
4+
"address": "0x559Ec9D7D0a80220C8167d6B413d8AA1B26f596D",
5+
"lpToken": "0x4CD99606b98230b039a82bE45165663f6A931A96",
6+
"poolTokens": [
7+
{
8+
"address": "0x24aa189dfaa76c671c279262f94434770f557c35",
9+
"name": "BUSD"
10+
},
11+
{
12+
"address": "0xD86e243FC0007e6226B07c9A50C9d70D78299EB5",
13+
"name": "USDC"
14+
},
15+
{
16+
"address": "0x5fa41671c48e3c951afc30816947126ccc8c162e",
17+
"name": "USDT"
18+
}
19+
]
20+
}
21+
},
22+
"godwoken_v1": {
23+
"jioETH": {
24+
"address": "0x0f25e206DAfE6F5bbCE2037b67497D5F017062cd",
25+
"lpToken": "0x3D57dF23702c761f28FEC15B358B4E2F543f343E",
26+
"poolTokens": [
27+
{
28+
"address": "0x9E858A7aAEDf9FDB1026Ab1f77f627be2791e98A",
29+
"name": "ETH (via Forcebridge from ETH)"
30+
},
31+
{
32+
"address": "0xB66954619363145a05eF835547449EB9050d82f6",
33+
"name": "WETH (Via Celer CBridge From ETH)"
34+
}
35+
]
36+
},
37+
"jio2USD": {
38+
"address": "0x55f676d9a014a83e58D6A9b73265709e071aAE88",
39+
"lpToken": "0xb3D6913CF2D6A8fD9b472ff7526ec11620957C8b",
40+
"poolTokens": [
41+
{
42+
"address": "0x186181e225dc1Ad85a4A94164232bD261e351C33",
43+
"name": "USDC (via Forcebridge from ETH"
44+
},
45+
{
46+
"address": "0x53bB26dc8C5EFC6c95C37155aCa487d1D043436a",
47+
"name": "USDC (Via Celer CBridge From ETH)"
48+
}
49+
]
50+
},
51+
"jio3fUSD": {
52+
"address": "0xCF60f11627f2fb412EDe8E674a97c893E8dD73d8",
53+
"lpToken": "0xbe6FB8874C6E5800092E7e85bDD8c165ADcD0592",
54+
"poolTokens": [
55+
{
56+
"address": "0x2c9Fc6087875646112f66a3C92fEF2d158FAa76e",
57+
"name": "DAI (via Forcebridge from ETH)"
58+
},
59+
{
60+
"address": "0x186181e225dc1Ad85a4A94164232bD261e351C33",
61+
"name": "USDC (via Forcebridge from ETH)"
62+
},
63+
{
64+
"address": "0x8E019acb11C7d17c26D334901fA2ac41C1f44d50",
65+
"name": "USDT (via Forcebridge from ETH)"
66+
}
67+
]
68+
},
69+
"jio4celUSD": {
70+
"address": "0x5abff8841a016631ecB90250D65F53996dda10b0",
71+
"lpToken": "0x83f3CfF88102F498b7170fbd237935152E6909c7",
72+
"poolTokens": [
73+
{
74+
"address": "0xcD7bC9fC617a4F82eC1c8359D1C8610B90e3B44C",
75+
"name": "BUSD (Via Celer CBridge From BSC)"
76+
},
77+
{
78+
"address": "0x317F8d18FB16E49a958Becd0EA72f8E153d25654",
79+
"name": "Dai (Via Celer CBridge From ETH)"
80+
},
81+
{
82+
"address": "0x53bB26dc8C5EFC6c95C37155aCa487d1D043436a",
83+
"name": "USDC (Via Celer CBridge From ETH)"
84+
},
85+
{
86+
"address": "0x3c790b38f466514ffCB4230e7B2334e52B64c942",
87+
"name": "USDT (Via Celer CBridge From ETH)"
88+
}
89+
]
2190
}
2291
}
23-
92+
}

projects/jioswap/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
const { sumTokens2 } = require("../helper/unwrapLPs");
22
const config = require("./config");
33
const { getFixBalances } = require("../helper/portedTokens");
4+
const ethers = require("ethers")
5+
const { config: configRPC } = require('@defillama/sdk/build/api');
6+
7+
configRPC.setProvider("godwoken_v1", new ethers.providers.StaticJsonRpcProvider(
8+
"https://v1.mainnet.godwoken.io/rpc",
9+
{
10+
name: "godwoken_v1",
11+
chainId: 71402,
12+
}
13+
))
414

515
module.exports = {
616
misrepresentedTokens: true,

0 commit comments

Comments
 (0)