hats-finance / Fenix--0x9d7765a7ebd5b6322a30797a44a5428531970d3d

0 stars 1 forks source link

permanentTotalSupply may be increased twice as much when depositing #1

Open hats-bug-reporter[bot] opened 1 month ago

hats-bug-reporter[bot] commented 1 month ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0xd5ba0d8ce1c0cf49dc3bb204eed4455a25f66e470e8f1aa5bf48cecb1043e2a8 Severity: low

Description: Description\ When _deposit_for, lockPermanent, unlockPermanent, onAttachToManagedNFT and onDettachFromManagedNFT are called, the variable permanentTotalSupply gets updated. At the function _deposit_for it's updated when the old_locked.isPermanentLocked is true, the condition is checked both at the start of the function and at the boost check. here

So if the deposit is boosted, the lock time is correct and the boostedValue is greater than zero, the permanentTotalSupply will be increased for a second time by _value.

Attack Scenario\ The permanentTotalSupply may be increased twice as much when deposit_for is called.

Attachments

  1. Proof of Concept (PoC) File As this is a low finding, the PoC will be provided on demand.

  2. Revised Code File (Optional) Remove the second check of old_locked.isPermanentLocked here

0xmahdirostami commented 1 month ago

for now, I will judge these submissions as well

0xmahdirostami commented 1 month ago

Thanks valid