Skip to content

Commit

Permalink
refactor: update changed values for bsctestnet
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 5, 2024
1 parent ff1de9a commit 4e9a506
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
22 changes: 20 additions & 2 deletions subgraphs/venus/src/constants/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
import { Address } from '@graphprotocol/graph-ts';

import { comptrollerAddress as comptrollerAddressString } from './config';
import {
comptrollerAddress as comptrollerAddressString,
vwbETHAddress as vwbETHAddressString,
vTRXAddress as vTRXAddressString,
vTUSDOldAddress as vTUSDOldAddressString,
} from './config';

export const comptrollerAddress = Address.fromString(comptrollerAddressString);

export const nullAddress = Address.fromString('0x0000000000000000000000000000000000000000');
export const nullAddressString = '0x0000000000000000000000000000000000000000';
export const nullAddress = Address.fromString(nullAddressString);

export const nativeAddress = Address.fromString('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE');

export const vwbETHAddress = Address.fromString(
vwbETHAddressString.length > 0 ? vwbETHAddressString : nullAddressString,
);

export const vTRXAddressAddress = Address.fromString(
vTRXAddressString.length > 0 ? vTRXAddressString : nullAddressString,
);

export const vTUSDOldAddress = Address.fromString(
vTUSDOldAddressString.length > 0 ? vTUSDOldAddressString : nullAddressString,
);
6 changes: 6 additions & 0 deletions subgraphs/venus/src/constants/config-template
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Use yarn prepare commands to generate config typescript file per env

export const comptrollerAddress = '{{ comptrollerAddress }}';

export const vwbETHAddress = '{{ vwbETHAddress }}';

export const vTRXAddress = '{{ vTRXAddress }}';

export const vTUSDOldAddress = '{{ vTUSDOldAddress }}';
7 changes: 6 additions & 1 deletion subgraphs/venus/src/operations/getOrCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { BEP20 } from '../../generated/templates/VToken/BEP20';
import { Comptroller } from '../../generated/templates/VToken/Comptroller';
import { VToken } from '../../generated/templates/VToken/VToken';
import { zeroBigInt32 } from '../constants';
import { nativeAddress, vwbETHAddress, vTRXAddressAddress, vTUSDOldAddress } from '../constants/addresses';
import {
nativeAddress,
vwbETHAddress,
vTRXAddressAddress,
vTUSDOldAddress,
} from '../constants/addresses';
import {
getUnderlyingPrice,
valueOrNotAvailableAddressIfReverted,
Expand Down

0 comments on commit 4e9a506

Please sign in to comment.