diff --git a/src/base/erc20.ts b/src/base/erc20.ts index 842b9dde..7a35f79b 100644 --- a/src/base/erc20.ts +++ b/src/base/erc20.ts @@ -25,7 +25,7 @@ export const baseERC20s = [ }), getCredits: async (ctx, block, address) => { const oToken = new otoken.Contract(ctx, block.header, baseAddresses.tokens.superOETHb) - return oToken.creditsBalanceOfHighres(address).then((credits) => credits._1) + return oToken.creditsBalanceOfHighres(address).then((credits) => credits._0) }, getCreditsPerToken: async (ctx, block) => { const oToken = new otoken.Contract(ctx, block.header, baseAddresses.tokens.superOETHb) diff --git a/src/mainnet/processors/erc20s.ts b/src/mainnet/processors/erc20s.ts index bf11fd17..037ed0fe 100644 --- a/src/mainnet/processors/erc20s.ts +++ b/src/mainnet/processors/erc20s.ts @@ -56,7 +56,7 @@ const rebasingTracks: Record { const oToken = new otoken.Contract(ctx, block.header, tokens.OETH) - return oToken.creditsBalanceOfHighres(address).then((credits) => credits._1) + return oToken.creditsBalanceOfHighres(address).then((credits) => credits._0) }, getCreditsPerToken: async (ctx, block) => { const oToken = new otoken.Contract(ctx, block.header, tokens.OETH) diff --git a/src/ousd/processors/erc20s.ts b/src/ousd/processors/erc20s.ts index e510c5c2..726cc2dc 100644 --- a/src/ousd/processors/erc20s.ts +++ b/src/ousd/processors/erc20s.ts @@ -18,14 +18,14 @@ const rebasingTracks: Record { const oToken = new otoken.Contract(ctx, block.header, tokens.OUSD) if (block.header.height < 13533937) { - return oToken.creditsBalanceOf(address).then((credits) => credits._1) + return oToken.creditsBalanceOf(address).then((credits) => credits._0 * 1000000000n) } - return oToken.creditsBalanceOfHighres(address).then((credits) => credits._1) + return oToken.creditsBalanceOfHighres(address).then((credits) => credits._0) }, getCreditsPerToken: async (ctx, block) => { const oToken = new otoken.Contract(ctx, block.header, tokens.OUSD) if (block.header.height < 13533937) { - return oToken.rebasingCreditsPerToken() + return oToken.rebasingCreditsPerToken().then((cpt) => cpt * 1000000000n) } return oToken.rebasingCreditsPerTokenHighres() },