QuantAMM

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

Inconsistent pragmas between main contracts and tests

Summary

Main contracts and tests implement different pragma versions.

Vulnerability Details

Main contracts in the repo implement the following pragma:

pragma solidity ^0.8.24;

Whereas 16 tests in pkg/pool-quantamm/test implement a newer pragma:

pragma solidity ^0.8.26;

The tests include:

pkg/pool-quantamm/test/foundry/MultiHopOracle.t.sol:
pkg/pool-quantamm/test/foundry/OracleWrapper.t.sol:
pkg/pool-quantamm/test/foundry/QuantAMMStorage.t.sol:
pkg/pool-quantamm/test/foundry/UpdateWeightRunner.t.sol:
pkg/pool-quantamm/test/foundry/utils.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMAntiMomentum.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMChannelFollowing.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMDifferenceMomentum.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMMinVariance.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMMomentum.t.sol:
pkg/pool-quantamm/test/foundry/rules/QuantAMMPowerChannel.t.sol:
pkg/pool-quantamm/test/foundry/rules/UpdateRule.t.sol:
pkg/pool-quantamm/test/foundry/rules/base/Covariance.t.sol:
pkg/pool-quantamm/test/foundry/rules/base/Gradient.t.sol:
pkg/pool-quantamm/test/foundry/rules/base/MathGuard.t.sol:
pkg/pool-quantamm/test/foundry/rules/base/Variance.t.sol:

Impact

Different pragmas in main contracts and tests can lead to the following issues:

  1. Discrepancies in how the contract behaves when tested versus deployed.

  2. The tests might fail or pass incorrectly due to differences in behavior between the compiled versions of the contracts and the tests.

  3. Deployment inconsistencies.

Tools Used

Cursor and manual inspection.

Recommendations

Change all the test pragmas to pragma solidity ^0.8.24 to match the pragmas in the main contracts.

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.