openzeppelin-contracts
openzeppelin-contracts copied to clipboard
Adds certora spec for Ownable2Step
Adds a certora spec for formally verifying Ownable2Step. Includes the rules:
transferOwnershipSetsPendingOwneronlyCurrentOwnerCanCallOnlyOwner: verifies that transfer, renounce, and user functions decorated with onlyOwner can indeed only be called by the current owneronlyPendingOwnerCanAcceptrenounceDoesNotRequireTwoSteps
What about a rule like
oldOwner = owner();
oldPendingOwner = pendingOwner();
env e;
method f;
calldataarg args;
f(e, args);
assert (
owner() != oldOwner ||
pendingOwner() != oldPendingOwner
) => (
msg.sender == oldOwner ||
msg.sender == oldPendingOwner
);
assert owner() != oldOwner => pendingOwner() == address(0);
@Amxx added!
Superceded by https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4094.