Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions projects/utopia/abi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const abi = Object.freeze({
getBalance: {
name: 'getBalance',
type: 'function',
stateMutability: 'view',
inputs: [],
outputs: [{ type: 'uint256', name: '' }],
},
});

module.exports = { abi };
19 changes: 19 additions & 0 deletions projects/utopia/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { abi } = require('./abi');

const UTOPIA_MINER_CONTRACT = '0x61ea85A817344789d836fbC18B9099bB280b383D';

async function tvl(api) {
const contractBalance = await api.call({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use sdk.api.eth.getBalance()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok used the sdk directly as requested

abi: abi.getBalance,
target: UTOPIA_MINER_CONTRACT,
});

api.addGasToken(contractBalance);
}

module.exports = {
methodology: 'TVL is calculated as the total BNB balance locked in the Utopia Miner contract.',
bsc: {
tvl,
},
};
Loading