Skip to content

Fixed Beefyhandler Redeem#59

Open
Havoc19 wants to merge 1 commit intoarbitrumfrom
beefyHandlers-redeem-fix
Open

Fixed Beefyhandler Redeem#59
Havoc19 wants to merge 1 commit intoarbitrumfrom
beefyHandlers-redeem-fix

Conversation

@Havoc19
Copy link
Contributor

@Havoc19 Havoc19 commented Mar 7, 2024

BeefyBridge and BeefyLP Incident
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.

image

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

image

Impact
This impacts user a lot since wrong values are getting redeemed and balances of user's are stuck in the handler contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant