Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 14, 2025
1 parent 6c62a86 commit 1478efb
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions projects/sophon-farm/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const { sumTokens2 } = require('../helper/unwrapLPs')

const contract = '0x5753fBeC29De6E2b56F73f7d7786e9f0d34897bb'

async function tvl(api) {
return sumTokens2({ api, owner: contract, fetchCoValentTokens: true })
}
const { sumTokens2 } = require("../helper/unwrapLPs")

module.exports = {
sophon: {
tvl,
start: 810461,
},
methodology: 'Counts all ERC20 token balances in the Sophon Farm contract'
}

async function tvl(api) {
const farm = '0x5753fBeC29De6E2b56F73f7d7786e9f0d34897bb'
const pools = await api.call({ abi: "function getPoolInfo() view returns ((address lpToken, address l2Farm, uint256 amount, uint256 boostAmount, uint256 depositAmount, uint256 allocPoint, uint256 lastRewardBlock, uint256 accPointsPerShare, uint256 totalRewards, string description)[] poolInfos)", target: farm})
const tokens = pools.map(i => i.lpToken)
return sumTokens2({ owner: farm, tokens, api, })
}

0 comments on commit 1478efb

Please sign in to comment.