Skip to content

Commit a59e031

Browse files
authored
Merge branch 'main' into 902-traefik-image-upgrade
2 parents 1bbf96d + 7a1791d commit a59e031

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

pages/treasury.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { fetchWebconfig } from "../services/webconfig";
1212
export async function getServerSideProps() {
1313
const webconfig = fetchWebconfig();
1414
const results = await Promise.all([
15-
Treasuries.fetchList(),
15+
// V1 no longer used
16+
Treasuries.fetchList().then(list => list.filter(type => type !== 'V1')),
1617
Blocks.fetchLast(),
1718
]);
1819
const names = results[0];

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)