Checking policy_.isActive()
is not enough validation, policy could have functionality to return isActive as false.
The check at the beginning of the _activatePolicy
is not enough since a policy could return isActive as false and the proceed to be registered as a duplicate.
_deactivatePolicy()
would no longer work correctly, a duplicate policy would still be active.
Foundry tests:
test/mocks/MockPolicy2.sol
test/SomeTestFile.sol
Have checks in place to verify if the policy is already active checking if getPolicyIndex[policy_] != 0
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.