hats-finance / Metrom-0xfdfc6d4ac5807d7460da20a3a1c0c84ef2b9c5a2

Smart contracts for the Metrom project.
GNU General Public License v3.0
0 stars 0 forks source link

Lack of check for existing specificFee before overwrite #60

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

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

Description: Description\ The setSpecificFee function does not check if a specific fee already exists for the given _account before setting a new one. It simply overwrites the existing SpecificFee struct for that account with the new values.

The current implementation does not distinguish between initializing a new specific fee for an account and updating an existing one. This lack of distinction could make it harder to track changes, or implement different behaviors for initialization and updates.

Consider adding a check to determine if a specific fee already exists for the given _account before setting a new one. This would allow handling the initialization and update cases separately.

ololade97 commented 5 months ago

@luzzif could you please specify why it is marked invalid?

luzzif commented 5 months ago

I simply don't think this is a true vulnerability and I would classify this as "informational" more than low.

ololade97 commented 5 months ago

@luzzif it's okay if it's marked informational if overwriting (and keeping account of this) isn't considered a bug. However, if overwriting is not intended, I think it should be a low.

luzzif commented 5 months ago

It was definitely intended in this case.