QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Duplicate Import of ScalarQuantAMMBaseStorage

Summary

https://github.com/Cyfrin/2024-12-quantamm/blob/a775db4273eb36e7b4536c5b60207c9f17541b92/pkg/pool-quantamm/contracts/QuantAMMWeightedPool.sol#L31

https://github.com/Cyfrin/2024-12-quantamm/blob/a775db4273eb36e7b4536c5b60207c9f17541b92/pkg/pool-quantamm/contracts/QuantAMMWeightedPool.sol#L35

If ScalarQuantAMMBaseStorage contains state variables, importing it more than once can lead to storage collisions. This can cause unexpected behavior, such as overwritten variables or inconsistent state management.

Vulnerability Details

The QuantAMMWeightedPool contract contains a duplicate import statement for the ScalarQuantAMMBaseStorage contract from the same file. Specifically, the contract imports

State variables may be unintentionally overwritten, leading to inconsistent or corrupted contract states.

Impact

Importing the ScalarQuantAMMBaseStorage contract twice can lead to storage collisions. If ScalarQuantAMMBaseStorage contains state variables, duplicating its import may cause overlapping storage slots. This overlap can corrupt the contract's state, leading to unpredictable behavior, incorrect data retrieval, and potential vulnerabilities where critical state variables are inadvertently altered or bypassed.

Tools Used

Recommendations

liminate one of the duplicate import statements for ScalarQuantAMMBaseStorage to ensure it is imported only once.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas / Admin is trusted / Pool creation is trusted / User mistake / Suppositions

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!