Skip to content

Commit

Permalink
Sometimes the boost is not created right away
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Aug 3, 2024
1 parent 490ab74 commit 0147bcf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vault-interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ function updateInvestorVaultData(vault: BeefyVault, investor: Investor): Investo
for (let i = 0; i < boosts.length; i++) {
const boostAddress = boosts[i]
const boostContract = BeefyBoostContract.bind(boostAddress)
rawSharesBalance = rawSharesBalance.plus(boostContract.balanceOf(investorAddress))
const boostBalanceRes = boostContract.try_balanceOf(investorAddress)
if (!boostBalanceRes.reverted) {
rawSharesBalance = rawSharesBalance.plus(boostBalanceRes.value)
} else {
log.warning("updateInvestorVaultData: boost balanceOf reverted {}", [boostAddress.toHexString()])
}
}
} else {
log.error("updateInvestorVaultData: vault config not found {}", [vault.id.toHexString()])
Expand Down

0 comments on commit 0147bcf

Please sign in to comment.