Skip to content

Commit

Permalink
feat: add STRK staking to zkLend (#12466)
Browse files Browse the repository at this point in the history
  • Loading branch information
9oelM authored Nov 28, 2024
1 parent 004c000 commit c4084ef
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions projects/zklend-strk-staking/abi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const strkStaking = [
{
"type": "function",
"name": "get_total_stake",
"inputs": [],
"outputs": [
{
"type": "core::integer::u128"
}
],
"state_mutability": "view"
},
]
const strkStakingAbi = {}
strkStaking.forEach(i => strkStakingAbi[i.name] = i)

module.exports = {
strkStakingAbi,
}
17 changes: 17 additions & 0 deletions projects/zklend-strk-staking/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { call } = require('../helper/chain/starknet')
const { strkStakingAbi } = require('./abi');

const stakingContract = '0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7'

async function tvl(api) {
const stakedAmount = await call({ target: stakingContract, abi: strkStakingAbi.get_total_stake })
api.add(ADDRESSES.starknet.STRK, stakedAmount)
}

module.exports = {
methodology: 'The TVL is calculated as a sum of total STRK deposited into zkLend\'s staking contract',
starknet: {
tvl,
},
}

0 comments on commit c4084ef

Please sign in to comment.