Skip to content

Commit

Permalink
Update AccessControlDefaultAdminRulesHarness.sol
Browse files Browse the repository at this point in the history
To migrate the provided Solidity contract for formal verification (FV), you might need to make adjustments to align it with Certora or similar tools' requirements
  • Loading branch information
yuvashrikarunakaran authored Dec 18, 2024
1 parent bf4d40d commit 6ea70a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion certora/harnesses/AccessControlDefaultAdminRulesHarness.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// Import patched contract version
import {AccessControlDefaultAdminRules} from "../patched/access/extensions/AccessControlDefaultAdminRules.sol";

contract AccessControlDefaultAdminRulesHarness is AccessControlDefaultAdminRules {
Expand All @@ -14,32 +15,41 @@ contract AccessControlDefaultAdminRulesHarness is AccessControlDefaultAdminRules
_delayIncreaseWait = delayIncreaseWait;
}

// FV
// Formal Verification (FV) Helpers

/// @notice Get the pending default admin address
function pendingDefaultAdmin_() external view returns (address) {
(address newAdmin, ) = pendingDefaultAdmin();
return newAdmin;
}

/// @notice Get the schedule for the pending default admin
function pendingDefaultAdminSchedule_() external view returns (uint48) {
(, uint48 schedule) = pendingDefaultAdmin();
return schedule;
}

/// @notice Get the pending delay
function pendingDelay_() external view returns (uint48) {
(uint48 newDelay, ) = pendingDefaultAdminDelay();
return newDelay;
}

/// @notice Get the schedule for the pending delay
function pendingDelaySchedule_() external view returns (uint48) {
(, uint48 schedule) = pendingDefaultAdminDelay();
return schedule;
}

/// @notice Get the wait time for changing delay
/// @param newDelay The proposed new delay
function delayChangeWait_(uint48 newDelay) external view returns (uint48) {
return _delayChangeWait(newDelay);
}

// Overrides

/// @notice Returns the configured wait time for default admin delay increases
function defaultAdminDelayIncreaseWait() public view override returns (uint48) {
return _delayIncreaseWait;
}
Expand Down

0 comments on commit 6ea70a7

Please sign in to comment.