Policy that incorrectly returns active status can cause policy at inndex zero to get deleted.
If a policy that has it's isActive value set to true without going through _activatePolicy
then it hasnt been registered in the getPolicyIndex
mapping, so in line 289 when it tries to read the getPolicyIndex
value for policy_
it will return zero, therefore the policy at index zero will be the one getting deactivated.
MEDIUM - policy at index zero can be deleted
Foundry tests:
test/mocks/MockPolicy.sol
test/SomeTestFile.sol
Check that activePolicies[idx]
is equal to the policy that is being passed to the _deactivatePolicy
function.
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.