feat(contract_manager): add keeper balance to list entry (#1506)

* add keeper balance to list entry

* don't fix it as not sure
This commit is contained in:
Dev Kalra 2024-04-24 16:37:14 +05:30 committed by GitHub
parent d31cefb446
commit 9437d51843
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -13,15 +13,22 @@ const parser = yargs(hideBin(process.argv))
},
});
const KEEPER_ADDRESS = {
mainnet: "0xBcAb779fCa45290288C35F5E231c37F9fA87b130",
testnet: "0xa5A68ed167431Afe739846A22597786ba2da85df",
};
async function main() {
const argv = await parser.argv;
const entries = [];
const keeperAddress = KEEPER_ADDRESS[argv.testnet ? "testnet" : "mainnet"];
for (const contract of Object.values(DefaultStore.entropy_contracts)) {
if (contract.getChain().isMainnet() === argv.testnet) continue;
try {
const provider = await contract.getDefaultProvider();
const w3 = new Web3(contract.getChain().getRpcUrl());
const balance = await w3.eth.getBalance(provider);
const keeperBalance = await w3.eth.getBalance(keeperAddress);
let version = "unknown";
try {
version = await contract.getVersion();
@ -34,6 +41,7 @@ async function main() {
contract: contract.address,
provider: providerInfo.uri,
balance,
keeperBalance,
seq: providerInfo.sequenceNumber,
version,
});