As LPToken trusts VaderPoolV2 a cheaper way to do this would be to burn them directly from the user's balance. This avoids the cost of approving VaderPoolV2 to take the tokens and transferring them
Recommended Mitigation Steps
Allow VaderPoolV2 to directly burn LP tokens from users accounts and skip the transfer.
Handle
TomFrench
Vulnerability details
Impact
Gas costs
Proof of Concept
When burning ERC20 LP tokens
VaderPoolV2
first transfers them from the user to itself and then burns them.https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex-v2/pool/VaderPoolV2.sol#L365-L366
As
LPToken
trustsVaderPoolV2
a cheaper way to do this would be to burn them directly from the user's balance. This avoids the cost of approvingVaderPoolV2
to take the tokens and transferring themRecommended Mitigation Steps
Allow
VaderPoolV2
to directly burn LP tokens from users accounts and skip the transfer.