The fee-minted in the form of shares (svTokens) would not be subtracted from the amount of shares (svTokens) to be minted to the GMXVault's depositor.
Due to that, a depositor of the GMXVault could receive the amount of the shares (svTokens), which the amount of the fee-minted in the form of the shares (svTokens) via the GMXDeposit#mintFee()
was not subtracted.
This means that a depositor of the GMXVault can bypass paying the fee when the depositor deposit into the GMXVault.
Within the GMXDeposit#deposit()
, the GMXVault#mintFee()
would be called to mint the fee in the form of the svTokens like this:
https://github.com/Cyfrin/2023-10-SteadeFi/blob/main/contracts/strategy/gmx/GMXDeposit.sol#L119
Within the GMXVault#mintFee()
, the amount (GMXReader.pendingFee(_store)
) of the shares would be minted to the treasury (_store.treasury
) in the form of the svTokens like this:
https://github.com/Cyfrin/2023-10-SteadeFi/blob/main/contracts/strategy/gmx/GMXVault.sol#L335
When callback of deposit, the the GMXDeposit#processDeposit()
would be called via the GMXVault#deposit()
.
Within the GMXDeposit#processDeposit()
, the amount (self.depositCache.sharesToUser
) of shares (VaultTokens) would be minted to the GMXVault's depositor (self.depositCache.user
) like this:
https://github.com/Cyfrin/2023-10-SteadeFi/blob/main/contracts/strategy/gmx/GMXDeposit.sol#L172
Within the GMXDeposit#processDeposit()
above, the amount of the fee-minted in the form of the shares (svTokens) via the GMXDeposit#mintFee()
is supposed to be subtracted from the amount of the shares to be minted to the GMXVault's depositor via the GMXDeposit#processDeposit()
.
However, there is no logic to subtract the amount of the fee-minted in the form of the shares (svTokens) via the GMXDeposit#mintFee()
from the amount of the shares to be minted to the GMXVault's depositor in the form of the shares (svTokens) via the GMXDeposit#processDeposit()
.
The depositor could receive the amount of the shares (svTokens), which the amount of the fee-minted in the form of the shares (svTokens) via the GMXDeposit#mintFee()
was not subtracted.
This means that a depositor of the GMXVault can bypass paying the fee when the depositor deposit into the GMXVault.
Foundry
Within the GMXDeposit#processDeposit()
, consider adding a logic to subtract the amount of the fee-minted in the form of the shares (svTokens) via the GMXDeposit#mintFee()
from the amount of the shares to be minted to the GMXVault's depositor in the form of the shares (svTokens) via the GMXDeposit#processDeposit()
.
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.