The AaveDIVAWrapperCore::_redeemPositionToken
calls the DIVA
protocol's redeemPositionToken
which burns the user's positionToken.
https://github.com/Cyfrin/2025-01-diva/blob/23cdc88da7e2a9341f453854e876eee82a18e53e/contracts/src/AaveDIVAWrapperCore.sol#L294C9-L294C10
However, this operation burns only one token (longToken
or shortToken
) at a time, based on the _positionToken
parameter.
Proof of Code:
Add This Test to the redeemPositionToken
test group.
This function will break the invariant short token supply
= long token supply
= wToken supply
.
https://github.com/Cyfrin/2025-01-diva/blob/main/DOCUMENTATION.md#invariants
This disruption compromises the core functionality and balance of the protocol.
Refactor the functionality to ensure that the invariant (short token supply
= long token supply
= wToken supply
) remains intact under all scenarios.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.