Skip to content

Commit

Permalink
Migrate vault assets from ethereum to silicon zkevm (#13410)
Browse files Browse the repository at this point in the history
Co-authored-by: Juan Ignacio Ubeira <juani@balancerlabs.dev>
Co-authored-by: Juan Ignacio Ubeira <juani@balancer.finance>
Co-authored-by: Divyanshu Chauhan <53409372+divinit7@users.noreply.github.com>
Co-authored-by: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com>
Co-authored-by: jan-magpie <155635960+jan-magpie@users.noreply.github.com>
Co-authored-by: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: Pekaz <afakafak@gmail.com>
  • Loading branch information
8 people authored Feb 7, 2025
1 parent 1a4bc9c commit f9bcf57
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/fizzswap-v2/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { uniTvlExports } = require('../helper/unknownTokens')
module.exports = uniTvlExports({
silicon_zk: '0xCB72354080A1d3B8A48425B889025d0799c52095'
})
35 changes: 35 additions & 0 deletions projects/fizzswap-v3/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { sumTokens2 } = require('../helper/unwrapLPs')
const { getLogs } = require('../helper/cache/getLogs')

async function v3Tvl(api) {
const factory = '0x2aeEC787Be499ef6f68e527B64FADF969D048042';
const WETH = '0xe66863b695a392507f5d68b6a7b8aa8218914059'.toLowerCase();

const fromBlock = 1;
const eventAbi = 'event PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool, uint256 exid)';
const topics = [
'0x20a108faf9dc51ca2b459a109d08568e65a9cb87569b6b3a334c275d504ff94f',
];

const logs = await getLogs({
api,
target: factory,
topics,
fromBlock,
eventAbi,
onlyArgs: true,
})

return sumTokens2({
api, ownerTokens: logs.map(i => {
return [[(i.token0.toLowerCase() == WETH) ? ADDRESSES.null : i.token0, i.token1], i.pool]
}),
})
}

module.exports = {
silicon_zk: {
tvl: v3Tvl,
},
}
1 change: 1 addition & 0 deletions projects/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
"shido",
"shimmer_evm",
"sifchain",
"silicon_zk",
"smartbch",
"solana",
"sommelier",
Expand Down
1 change: 1 addition & 0 deletions projects/helper/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const DEFAULTS = {
ABSTRACT_RPC: "https://api.mainnet.abs.xyz",
BERACHAIN_RPC: "https://rpc.berachain.com",
BERACHAIN_RPC_MULTICALL: "0xcA11bde05977b3631167028862bE2a173976CA11",
SILICON_ZK_RPC_MULTICALL: "0x566da61a4D0841a67bA8F2c7e5975885fa0Af4DA",
}

const ENV_KEYS = [
Expand Down
5 changes: 5 additions & 0 deletions projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ const fixBalancesTokens = {
aptos: {
'0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b': { coingeckoId: "usd-coin", decimals: 6 },
},
silicon_zk: {
'0x0000000000000000000000000000000000000000': { coingeckoId: "ethereum", decimals: 18 },
'0xe66863b695a392507f5d68b6a7b8aa8218914059': { coingeckoId: "ethereum", decimals: 18 },
'0x1e4a5963abfd975d8c9021ce480b42188849d41d': { coingeckoId: "tether", decimals: 18 },
},
}

ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })
Expand Down
5 changes: 4 additions & 1 deletion projects/orbitbridge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const vaults = {
klaytn: '0x9abc3f6c11dbd83234d6e6b2c373dfc1893f648d',
polygon: '0x506DC4c6408813948470a06ef6e4a1DaF228dbd5',
meta: '0x292A00F3b99e3CB9b324EdbaA92258C3C61b55ab',
wemix: '0x445F863df0090f423A6D7005581e30d5841e4D6d'
wemix: '0x445F863df0090f423A6D7005581e30d5841e4D6d',
silicon_zk: '0x5aAAcf28ECDd691b4a657684135d8848d38236Bb'
}

const farms = {
Expand Down Expand Up @@ -48,6 +49,7 @@ async function tvl(api) {
let targetChain = chain
if (chain === 'ethereum') targetChain = 'eth'
if (chain === 'polygon') targetChain = 'matic'
if (chain === 'silicon_zk') targetChain = 'silicon'

const tokenListURL = 'https://bridge.orbitchain.io/open/v1/api/monitor/rawTokenList'
tokenData = tokenData || getConfig('orbit-bridge', tokenListURL)
Expand Down Expand Up @@ -83,6 +85,7 @@ module.exports = {
polygon: { tvl },
meta: { tvl },
wemix: { tvl },
silicon_zk: { tvl },
ripple: {
tvl: sumTokensExport({ owner: 'rLcxBUrZESqHnruY4fX7GQthRjDCDSAWia' })
},
Expand Down

0 comments on commit f9bcf57

Please # to comment.