Skip to content

Commit

Permalink
add staking TVL to zunami (#10660)
Browse files Browse the repository at this point in the history
* add staking TVL to zunami

* code refactor

---------

Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
fextr and g1nt0ki committed Jun 15, 2024
1 parent efa22db commit 5e39ab7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
3 changes: 0 additions & 3 deletions projects/zunami/abi.json

This file was deleted.

25 changes: 20 additions & 5 deletions projects/zunami/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
const ADDRESSES = require('../helper/coreAssets.json')
const abi = require("./abi.json");
const poolAbi = {
"totalHoldings": "uint256:totalHoldings"
}
const stakingAbi = {
"totalSupply": "uint256:totalSupply"
}

const zunUSD = "0x8C0D76C9B18779665475F3E212D9Ca1Ed6A1A0e6";
const zunUSDAps = "0x28e487bbF6b64867C29e61DccbCD17aB64082889";

const zunETH = "0xc2e660C62F72c2ad35AcE6DB78a616215E2F2222";
const zunETHAps = "0x5Ab3aa11a40eB34f1d2733f08596532871bd28e2";

const zunStaking = "0x45af4F12B46682B3958B297bAcebde2cE2E795c3";

const ZUN = "0x6b5204B0Be36771253Cc38e88012E02B752f0f36";

async function ethTvl(api) {
api.add(ADDRESSES.ethereum.DAI, await api.call({ abi: abi.totalHoldings, target: zunUSD, }))
api.add(ADDRESSES.ethereum.DAI, await api.call({ abi: abi.totalHoldings, target: zunUSDAps, }))
api.add(ADDRESSES.ethereum.WETH, await api.call({ abi: abi.totalHoldings, target: zunETH, }))
api.add(ADDRESSES.ethereum.WETH, await api.call({ abi: abi.totalHoldings, target: zunETHAps, }))
api.add(ADDRESSES.ethereum.DAI, await api.call({ abi: poolAbi.totalHoldings, target: zunUSD, }))
api.add(ADDRESSES.ethereum.DAI, await api.call({ abi: poolAbi.totalHoldings, target: zunUSDAps, }))
api.add(ADDRESSES.ethereum.WETH, await api.call({ abi: poolAbi.totalHoldings, target: zunETH, }))
api.add(ADDRESSES.ethereum.WETH, await api.call({ abi: poolAbi.totalHoldings, target: zunETHAps, }))
}

async function staking(api) {
api.add(ZUN, await api.call({ abi: stakingAbi.totalSupply, target: zunStaking, }))
}

module.exports = {
misrepresentedTokens: true,
ethereum: {
tvl: ethTvl,
staking,
},
hallmarks: [
[Math.floor(new Date('2023-08-13')/1e3), 'Project was hacked for $2M'],
Expand Down

0 comments on commit 5e39ab7

Please sign in to comment.