Skip to content

Commit defcb14

Browse files
Update Connext Adapter (DefiLlama#9827)
* Update supported chains * Add locked xerc20 data * fixes based on requested changes
1 parent 364116a commit defcb14

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

projects/connext/index.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ async function getDeployedContractAddress(chainId) {
1111
const allContracts = await getContracts()
1212
const record = allContracts[chainId + ''] ?? []
1313
const contracts = (record ?? [])[0]?.contracts ?? {}
14-
return [
14+
15+
const result = [
1516
contracts.Connext?.address,
1617
contracts.Connext_DiamondProxy?.address,
17-
].filter(i => i)
18+
].filter(i => i);
19+
20+
// Manually adding Connext-specific xERC20 lockboxes on L1. Don't yet have a programmatic way to retrieve these, so hardcoding the largest lockboxes only for now.
21+
if (chainId === 1) {
22+
result.push("0xC8140dA31E6bCa19b287cC35531c2212763C2059"); // ezETH
23+
}
24+
return result;
1825
}
1926

2027
let getAssetsPromise
@@ -25,13 +32,17 @@ async function getAssetIds(chainId) {
2532
getAssetsPromise = getConfig('connect/assets/'+chainId, url)
2633
const data = await getAssetsPromise
2734
const chainData = data.find(item => item.chainId === chainId) || {}
28-
return Object.entries(chainData.assetId || {}).filter(i => i[0].length && !i[1].symbol.startsWith('next')).map(i => i[0])
35+
const result = Object.entries(chainData.assetId || {}).filter(i => i[0].length && !i[1].symbol.startsWith('next')).map(i => i[0])
36+
// crossChain.json returns the xERC20 representation of ezETH instead of canonical addresses on L1. Manually add these below until a better JSON is available.
37+
if (chainId === 1) {
38+
result.push("0xbf5495Efe5DB9ce00f80364C8B423567e58d2110"); // ezETH
39+
}
40+
return result;
2941
}
3042

3143

3244
function chainTvl(chain) {
3345
return async (api) => {
34-
3546
const chainId = api.chainId
3647
const owners = await getDeployedContractAddress(chainId)
3748
if (!owners.length)
@@ -49,6 +60,9 @@ const chains = [
4960
"optimism",
5061
"arbitrum",
5162
"mode",
63+
"metis",
64+
"base",
65+
"linea",
5266

5367
// deprecated?
5468
"moonriver",

0 commit comments

Comments
 (0)