Open code423n4 opened 2 years ago
@oishun1112 When I change the code, 1 test case failed.
AssertionError: Expected transaction to be reverted with ERROR: INSURE_SPAN_BELOW_MIN, but other exception was thrown: Error: VM Exception while processing transaction: reverted with reason string 'ERROR: INSURE_MARKET_PENDING'
https://github.com/code-423n4/2022-01-insure/blob/main/test/unitary/PoolTemplate/pool.test.js#L1960
I'm not sure what behavior is correct.
this is a revert test when insurance market is in payout status.
please delete these lines https://github.com/code-423n4/2022-01-insure/blob/main/test/unitary/PoolTemplate/pool.test.js#L1956-L1960
Handle
pauliax
Vulnerability details
Impact
Statements should be ordered in a way that it costs less gas, that is, less operations are performed when the validating conditions are wrong. e.g. this can be reordered:
to something like this: