Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Severity
This issue is marked as P2 (We have an immediate fix for this, but require auditor's approval before re-deploying).
Summary
An issue was found in the the BeefyBridgeHandler file where the amount transferred after redeeming is correct but the value to be redeemed in the next step is wrong.
Details
Here we take example of issue token: moo-hop-usdt-lp We first redeem the moo tokens to get hop tokens. Then the next step would be to transfer the redeemed moo token amount to hop handler to be redeemed for base asset. But here we are transfering the new hop-lp token amount but in the redeeming parameter we sending old-amount as input. Thus, balances were left in the handler.
In the above code: We send first inputData._amount. Using the input we redeem into hop-tokens ans value is stored in LPTokens. But to redeem hop-tokens we are still sending inputData._amount instead of LPTokens. But we are transferring the new calculated amount. Thus, balances are left in the hop handler.
Similar issue after going again through the contracts was found in BeefyLP Handler on both ARB(Contract: 0xB1CB5f490339C0752D665C4e7bc3e5F2797690F0) and BSC(contract: 0x5Dec110904701E1888ff740362231f735b4D0487) chain.
Immediate Action
We have taken immediate action by disabling affected token in the frontend to prevent more exposure to users. We have also recovered the stuck funds through scripts.
Fix
We can fix this by changing the variable to new redeemed amount and redeploy and renable the handler for the moo-hop tokens. beefybridgeHandler-fix
Impact
This impacts user a lot since wrong values are getting redeemed and balances of user's are stuck in the handler contract.