Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Error Message Used in Operation Cancellation (Wrong Error Enum)

Link to Affected Code:

// contracts/core/governance/proposals/TimelockController.sol
function cancel(bytes32 id) external override onlyRole(CANCELLER_ROLE) {
if (_operations[id].timestamp == 0) {
revert OperationNotFound(id);
}
if (_operations[id].executed) {
revert OperationAlreadyScheduled(id); // Wrong error used
}

Description:
The cancel() function uses the wrong error message when checking if an operation has already been executed. It reverts with OperationAlreadyScheduled when it should use OperationAlreadyExecuted. This inconsistency between the error message and the actual condition being checked could cause confusion during error handling and debugging.

Impact:

  • Incorrect error reporting

  • Confusion during error handling

Recommended Mitigation:

function cancel(bytes32 id) external override onlyRole(CANCELLER_ROLE) {
if (_operations[id].timestamp == 0) {
revert OperationNotFound(id);
}
if (_operations[id].executed) {
revert OperationAlreadyExecuted(id); // Correct error
}
delete _operations[id];
emit OperationCancelled(id);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.