Skip to content

Commit b0607c7

Browse files
committed
feat: add Utopia Miner contract ABI and TVL calculation
1 parent ecbc53e commit b0607c7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

projects/utopia/abi.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const abi = Object.freeze({
2+
getBalance: {
3+
name: 'getBalance',
4+
type: 'function',
5+
stateMutability: 'view',
6+
inputs: [],
7+
outputs: [{ type: 'uint256', name: '' }],
8+
},
9+
});
10+
11+
module.exports = { abi };

projects/utopia/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { abi } = require('./abi');
2+
3+
const UTOPIA_MINER_CONTRACT = '0x61ea85A817344789d836fbC18B9099bB280b383D';
4+
5+
async function tvl(api) {
6+
const contractBalance = await api.call({
7+
abi: abi.getBalance,
8+
target: UTOPIA_MINER_CONTRACT,
9+
});
10+
11+
api.addGasToken(contractBalance);
12+
}
13+
14+
module.exports = {
15+
methodology: 'TVL is calculated as the total BNB balance locked in the Utopia Miner contract.',
16+
bsc: {
17+
tvl,
18+
},
19+
};

0 commit comments

Comments
 (0)