The contract calculates the storage slot for the profit_max_unlock_time parameter using the expression :
instead of directly using the slot number as a bytes32 value. This miscalculation causes the contract to read from or write to an incorrect storage location, potentially leading to erroneous behavior in price updates and reward calculations.
In Solidity, fixed storage slots are accessed directly using the slot number. For a mapping or dynamic data structure, one might use keccak256 hashing to compute a storage slot. However, when the storage location is fixed (as with the profit_max_unlock_time variable stored at slot 37), the proper approach is to use:
This converts the slot number directly into a bytes32 value without applying any hash function.
}
The contract may retrieve an incorrect period value (profit_max_unlock_time), leading to miscalculations in updating the vault price parameters. This could result in inaccurate reward or profit distributions.
Replace :
With :
This change ensures that the contract references the correct storage slot directly.
See primary comments in issue #23
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.