Users can mint as many Flat.money Points as they want
Summary
In the leverage module, the executeAdjust mints Flat.money Points if announcedAdjust.additionalSizeAdjustment >= 0. However a user can adjust the size both ways so every time they announce a positive adjustments they will receive points, which are not removed when they adjust the size down.This means that by adjusting the additional size up and down they will only increase their points being able to mint as much as they want.
Vulnerability Detail
In LeverageModule.sol users can mint as many Flat.money Points as they like only paying small fees - tradeFee and KeeperFee.
PoC:
novaman33
high
Users can mint as many
Flat.money Points
as they wantSummary
In the leverage module, the
executeAdjust
mints Flat.money Points if announcedAdjust.additionalSizeAdjustment >= 0. However a user can adjust the size both ways so every time they announce a positive adjustments they will receive points, which are not removed when they adjust the size down.This means that by adjusting the additional size up and down they will only increase their points being able to mint as much as they want.Vulnerability Detail
In
LeverageModule.sol
users can mint as manyFlat.money Points
as they like only paying small fees - tradeFee and KeeperFee. PoC:Impact
Users can mint as many
Flat.money Points
as they want - highCode Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/LeverageModule.sol?plain=1#L225-L230
Tool used
Manual Review
Recommendation
Maybe mint
Flat.money Points
only when closing a position.Duplicate of #187