Open hats-bug-reporter[bot] opened 5 months ago
add the test in test/strategy/LMPStrategy.t.sol.
function test_inconsistent() public {
assertEq(defaultStrat.swapCostOffsetMinInDays(), 10);
assertEq(defaultStrat.swapCostOffsetTightenStepInDays(), 3);
assertNotEq(defaultStrat.swapCostOffsetMaxInDays(), 50);
assertNotEq(defaultStrat.swapCostOffsetRelaxThresholdInDays(), 30);
assertNotEq(defaultStrat.swapCostOffsetRelaxStepInDays(), 1);
}
the result:
$ forge test --mt test_inconsistent -vvv
[⠑] Compiling...
[⠆] Compiling 1 files with 0.8.17
[⠰] Solc 0.8.17 finished in 5.76sCompiler run successful!
[⠔] Solc 0.8.17 finished in 5.76s
Running 1 test for test/strategy/LMPStrategy.t.sol:LMPStrategyTest
[PASS] test_inconsistent() (gas: 9308)
Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 7.31ms
Ran 1 test suites: 1 tests passed, 0 failed, 0 skipped (1 total tests)
The values and their expected range has evolved slightly since the time of documentation based on simulation results. We now have range values that can be used for validating the strategy configuration parameters.
Github username: @lucasts95 Twitter username: -- Submission hash (on-chain): 0x14ccbf0c1b06650406d913619cd4dce02b4d1ee003a407e65ce364cdeabfbd2e Severity: low
Description: Description\
validate
currently lacks constraints to verify the values ofminInDays
,maxInDays
,relaxStepInDays
,relaxThresholdInDays
, andtightenStepInDays
.minInDays
,maxInDays
,relaxStepInDays
,relaxThresholdInDays
, andtightenStepInDays
, as defined in the test files (test/integration/strategy/LMPStrategy.t.sol / test/strategy/LMPStrategyTestHelpers.sol), are inconsistent with their declarations in the documentation, posing risks to the project's consistency.Doc:
Attack Scenario\
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional) If these parameters are established with expected data values, it is recommended to declare them as constants. This practice ensures code consistency and stability.