From 1d8f10d103f645b767f0f9045d6efa3c635f743e Mon Sep 17 00:00:00 2001 From: Karan Shahani Date: Wed, 13 Apr 2022 14:28:27 -0400 Subject: [PATCH] Pass contract into resolveReserve (#139) --- .../helpers/position/single-vault.token-helper.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app-toolkit/helpers/position/single-vault.token-helper.ts b/src/app-toolkit/helpers/position/single-vault.token-helper.ts index 21493563d..0c209e58c 100644 --- a/src/app-toolkit/helpers/position/single-vault.token-helper.ts +++ b/src/app-toolkit/helpers/position/single-vault.token-helper.ts @@ -17,7 +17,12 @@ type SingleVaultTokenHelperParams = { dependencies?: AppGroupsDefinition[]; resolveContract: (opts: { address: string; network: Network }) => T; resolveUnderlyingTokenAddress: (opts: { contract: T }) => string | Promise; - resolveReserve?: (opts: { underlyingToken: Token; address: string; network: Network }) => Promise; + resolveReserve?: (opts: { + contract: T; + underlyingToken: Token; + address: string; + network: Network; + }) => Promise; resolvePricePerShare?: (opts: { reserve: number; supply: number; @@ -71,7 +76,7 @@ export class SingleVaultTokenHelper { multicall.wrap(tokenContract).totalSupply(), ]); - const reserveRaw = await resolveReserve({ underlyingToken, address, network }); + const reserveRaw = await resolveReserve({ contract, underlyingToken, address, network }); const supply = Number(supplyRaw) / 10 ** decimals; const reserve = Number(reserveRaw) / 10 ** underlyingToken.decimals; const pricePerShare = await resolvePricePerShare({ reserve, supply, address, network });