Skip to content

Commit 06e4820

Browse files
committed
Remove RPC call for now-unused V1 treasury
1 parent 6a0e5a3 commit 06e4820

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

services/treasuries.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ export const Treasuries = {
6767
? null
6868
: new ethers.Contract(token.address, abiERC20, jsonRpc);
6969
for (const [contractAddress, contractType] of mapAddresses.entries()) {
70-
const tokenBalance = tokenContract
71-
? await tokenContract.balanceOf(contractAddress)
72-
: await jsonRpc.getBalance(contractAddress);
70+
let tokenBalance;
71+
// The V1 treasury no longer holds any tokens
72+
if (contractType === TreasuryType.V1) {
73+
tokenBalance = 0;
74+
} else {
75+
tokenBalance = tokenContract
76+
? await tokenContract.balanceOf(contractAddress)
77+
: await jsonRpc.getBalance(contractAddress);
78+
}
7379

7480
const value = withDecimals(tokenBalance.toString(), token.decimals);
7581
console.log(contractType, tokenSymbol, value);

0 commit comments

Comments
 (0)