Herein errors raised in both RanDAO and Flashbots implementations are listed. Modifiers are presented with superior clarity on the corresponding page.
Common errors
These errors are shared in principle by RanDAO and Flashbots implementations since they inherit from the same contract (from Flashbots realisation, in fact).
OnlyOwner
//raised when an unauthorised user attempts to invoke Agent owner-only functionserrorOnlyOwner();
Scope (modifiers that raise this error):
_assertOnlyOwner
NonEOASender
//raised when a non-EoA account attempts to invoke execute_44g58pverrorNonEOASender();
Scope (modifiers that raise this error):
_msg_sender_is_EoA_assertion
InsufficientKeeperStake
//raised when the keeper does not possess sufficient stake to cover the globally (Agent-level) demanded minimal amount errorInsufficientKeeperStake();
Scope (modifiers that raise this error):
_executing_keeper_stake_sufficient_assertion
InsufficientJobScopedKeeperStake
//raised when the keeper does not possess sufficient stake to cover the Job-specific demanded minimal amount, if anyerrorInsufficientJobScopedKeeperStake();
Scope (modifiers that raise this error):
_keeper_satisfies_job_stake_demand_assertion
KeeperWorkerNotAuthorized
//raised when the message sender invoking execute_44g58pv is not the authorised worker for the keeper passed in calldata. Can be used to enforce compliance with keeper selection made by some algorithm.
errorKeeperWorkerNotAuthorized();
Scope (modifiers that raise this error):
_sender_is_authorised_as_keeper_assertion
InsufficientJobCredits
//raised when the job credits are not sufficient to disburse the required payment amounterrorInsufficientJobCredits(uint256 actual,uint256 wanted);
Scope (modifiers that raise this error):
_job_has_enough_credits_assertion
InsufficientJobOwnerCredits
//raised when the job owner credits are not sufficient to disburse the required payment amount, provided the payment is disbursed from his reserves
errorInsufficientJobOwnerCredits(uint256 actual,uint256 wanted);
Scope (modifiers that raise this error):
_job_owner_has_enough_credits_assertion
InactiveJob
//raised when an attempt is made to execute an inactive joberrorInactiveJob(bytes32 jobKey);
Scope (modifiers that raise this error):
_job_is_active_assertion
JobIdOverflow
//raised when an attempt is made to register a job for an address which also has the maximum available amount of jobs (type(uint24).max) registered
errorJobIdOverflow();
Scope (modifiers that raise this error):
_job_id_no_uint24_overflow_assertion
OnlyJobOwner
//raised when an attempt by an unauthorised account is made to set job parameters, withdraw job credits, or initiate an ownership transfer
errorOnlyJobOwner();
Scope (modifiers that raise this error):
_assertOnlyJobOwner
JobWithoutOwner
//raised when a job has no owner, that is, its owner is the zero addresserrorJobWithoutOwner();
Scope (modifiers that raise this error):
_target_job_has_owner_assertion
MissingJobAddress
//raised when an attempt to register a job with a zero address (i.e. without an address) is madeerrorMissingJobAddress();
Scope (modifiers that raise this error):
_job_address_exists_assertion
MissingMaxBaseFeeGwei
//raised when an attempt to set job params where no max block base gas fee admissible for computation of dynamic rewards is extant (i.e. it is zero) is made
errorMissingMaxBaseFeeGwei();
Scope (modifiers that raise this error):
_assertJobParams
NoFixedNorPremiumPctReward
//raised when an attempt to set job params where both fixed and dynamic rewards for the keeper are set to zero is madeerrorNoFixedNorPremiumPctReward();
Scope (modifiers that raise this error):
_assertJobParams
CreditsDepositOverflow
//raised when an attempt is made to set a job stake either at registration or deposit that would lead to overflow of the uint88 type used to stare this stake
errorCreditsDepositOverflow();
//raised when an attempt is made to set a keeper stake that is in excess of type(uint88).max; this type is used to store keeper stake data
errorStakeAmountOverflow();
Scope (modifiers that raise this error):
_stake_amount_does_not_overflow_assertion
CreditsWithdrawalUnderflow
//raised when an attempt is made to withdraw job/job owner credits in excess of what is available for withdrawalerrorCreditsWithdrawalUnderflow();
Scope (modifiers that raise this error):
_sufficient_credits_to_withdraw
MissingDeposit
//raised whenever an attempt is made to deposit a zero amount of credits via payable functions depositJobOwnerCredits and depositJobCredits
errorMissingDeposit();
Scope (modifiers that raise this error):
_assertNonZeroValue
MissingAmount
//raised when an operation involving tokens and non-payable functions (i.e. all token-related operations except for deposits) is performed, but the amount specified therein is zero
errorMissingAmount();
Scope (modifiers that raise this error):
_assertNonZeroAmount
IntervalNotReached
//raised whenever an an attempt is made to execute an interval job without waiting for the timeout interval to pass since the last execution timestamp
errorIntervalNotReached(uint256 lastExecutedAt,uint256 interval,uint256 _now);
Scope (modifiers that raise this error):
_execution_interval_reached_assertion
BaseFeeGtGasPrice
//raised whenever the block base gas fee is in excess of the job-specified maximal value, and the keeper has not passed the flag FLAG_ACCEPT_MAX_BASE_FEE_LIMIT, indicating his readiness to accept subpar recompense, as part of execution calldata
errorBaseFeeGtGasPrice(uint256 baseFee,uint256 jobMaxBaseFeeGwei);
//raised when one needs to catch a hypothetical error leading to no job type being picked despite the calldatasource being between 0 and 2 or when an attempt is made to register a job with the calldataSource value not being between 0 and 2 (0 corresponds to SELECTOR, 1 - to PRE_DEFINED, 2 - to RESOLVER, and no other types are extant)
errorInvalidCalldataSource();
//raised when a resolver type job is called with no function input calldata passederrorMissingInputCalldata();
Scope (modifiers that raise this error):
_calldata_passed_to_resolver_job_assert
SelectorCheckFailed
//raised when the resolver selector provided by the kepeer in the execution calldata is compared (which is a step togglable by the Job owner) with the resolver selector stored in the binary representation of the job itself and does not match
errorSelectorCheckFailed();
Scope (modifiers that raise this error):
_selector_check_assert
JobCallRevertedWithoutDetails
//raised inside of the job revert output handler function when the job reverted with no traceback message contained in the response
errorJobCallRevertedWithoutDetails();
Scope (modifiers that raise this error):
_job_revert_handler
_CustomTracebackErrorMessage
//raised inside of the job revert output handler function when the function returns some traceback in its resposne
bytes memory executionResponse;
if (!ok) {
assembly ("memory-safe") {
let size := returndatasize()
//function reverted with some message being returned
if gt(size, 0) {
//load free memory pointer
executionResponse := mload(0x40)
//store the message size at free memory pointer
mstore(executionResponse, size)
//add offset of 32 bytes, which is exactly the size of the message size, which is a uint256 value
let p := add(executionResponse, 0x20)
//copy "size" bytes of returndata, i.e. the entire message, starting from the first bytes, into memory starting at the offset pointer
returndatacopy(p, 0, size)
//store the new free memory pointer
mstore(0x40, add(executionResponse, add(32, size)))
}
}
}
//...//
//case of the preceding error
if (executionResponse_.length == 0) {
revert JobCallRevertedWithoutDetails();
} else {
//load the execution response and revert with it
assembly ("memory-safe") {
revert(add(32, executionResponse_), mload(executionResponse_))
}
Scope (modifiers that raise this error):
_job_revert_handler
InsufficientAmountToCoverSlashedStake
//raised when a keeper attempts to withdraw some of his stake, with the amount specified being insufficient to cover the totality of the slashed liability he has accrued
error InsufficientAmountToCoverSlashedStake(uint256 wanted, uint256 actual);
//raised when a keeper attempts to withdraw more stake than he has
error AmountGtStake(uint256 wanted, uint256 actualStake, uint256 actualSlashedStake);
Scope (modifiers that raise this error):
_amount_not_exceeds_stake_assertion
WithdrawalTimoutNotReached
//raised when a keeper attempts to finalise stake withdrawal before the Agent-specified timeout period pendingWithdrawalTimeoutSeconds elapses from the time of withdrawal initiation
error WithdrawalTimoutNotReached();
Scope (modifiers that raise this error):
_withdrawal_time_limit_elapsed_assertion
NoPendingWithdrawal
//raised when a keeper attempts to finalise stake withdrawal whilst having no stake actually pending withdrawal
error WithdrawalTimoutNotReached();
Scope (modifiers that raise this error):
_pending_withdrawal_extant_assertion
WithdrawAmountExceedsAvailable
//raised when a keeper attempts to withdraw more compensation (in native tokens) than he has accrued thus far
error WithdrawAmountExceedsAvailable(uint256 wanted, uint256 actual);
Scope (modifiers that raise this error):
_amount_not_exceeds_available_assertion
JobShouldHaveInterval
//raised when an attempt is made to set a job of an interval type (SELECTOR or PRE_DEFINED) to have no (zero) interval
error JobShouldHaveInterval();
Scope (modifiers that raise this error):
_assertInterval
ResolverJobCantHaveInterval
//raised when an attempt is made to set a job of a non-interval (RESOLVER) type to have a nonzero interval
error ResolverJobCantHaveInterval();
Scope (modifiers that raise this error):
_assertInterval
InvalidJobAddress
//raised when an attempt is made to register a job with the address being either the CVP token or this particular instance of Agent. This is made to prevent possible exploits.
error InvalidJobAddress();
Scope (modifiers that raise this error):
_job_address_not_cvp_or_agent_assertion
InvalidKeeperId
//raised when an attempt is made to increment the stake of a keeper with an ID greater than that of the last registered keeper, since such keepers cannot exist
error InvalidKeeperId();
Scope (modifiers that raise this error):
_assertKeeperIdExists
MissingResolverAddress
//raised when an attempt is made to set a job resolver with a zero (nonexistent) address
error MissingResolverAddress();
Scope (modifiers that raise this error):
_resolver_address_extant_assertion
NotSupportedByJobCalldataSource
//raised when a comparison between a provided calldataSource and the calldataSource of a job with a provided key do not match; used to make sure that e.g. one does not attempt to set predefined calldata for a non-PRE_DEFINED job.
error NotSupportedByJobCalldataSource();
Scope (modifiers that raise this error):
_assertJobCalldataSource
OnlyKeeperAdmin
//raised when an action available only to a keeper admin (worker address setting, finalising and initiating stake redemption) is attempted by an unauthorised user
error OnlyKeeperAdmin();
Scope (modifiers that raise this error):
_assertOnlyKeeperAdmin
OnlyKeeperAdminOrJobOwner
//raised when an action available only to a keeper admin or a job owner is attempted by an unauthorised party. Not used in Flashbots.
error OnlyKeeperAdminOrJobOwner();
Scope (modifiers that raise this error):
None
OnlyKeeperAdminOrWorker
//raised when an action available only to a keeper admin or a worker (compensation withdrawal) is attempted by an unauthorised party. Not used in Flashbots.
error OnlyKeeperAdminOrJobOwner();
Scope (modifiers that raise this error):
_assertOnlyKeeperAdminOrWorker
TimeoutTooBig
//raised when an attempt is made by Agent owner to set a pendingWithdrawalTimeoutSeconds value (governing the size of the time interval that must elapse between initating and finishing withdrawal of staked CVP tokens) in excess of a global (i.e. shared between all inheritors of the base contract) constant MAX_PENDING_WITHDRAWAL_TIMEOUT_SECONDS, which has a value of 30 days
error TimeoutTooBig();
//raised when an attempt is made by Agent owner to set a feePpm value (governing the fee in parts per million the Agent retains from each deposit made to either a job token reserve or that of a job owner) in excess of a global (i.e. shared between all inheritors of the base contract) constant MAX_FEE_PPM, which has a value of 5e4
error FeeTooBig();
//raised when an attempt is made to register a keeper with the initial CVP stake deposit being smaller than demanded by the Agent parameter minKeeperCvp
error InsufficientAmount();
Scope (modifiers that raise this error):
_minKeeperCvp_assertion
OnlyPendingOwner
//raised when any user other than a pending owner invokes the acceptJobTransfer function; since the job transfer is a two-part process, only the user targeted at the first step as a pending owner may accept the transfer
error OnlyPendingOwner();
Scope (modifiers that raise this error):
_msg_sender_is_pending_owner_assertion
WorkerAlreadyAssigned
//raised when an attempt is made to set for a Keeper a worker address which coincides with that of any other registered keeper. Used to prevent setting two different keepers to have the same address.
error WorkerAlreadyAssigned();
Scope (modifiers that raise this error):
_assertWorkerNotAssigned
RanDAO implementation errors
Herein errors specific to the RanDAO implementation are listed.
JobHasKeeperAssigned
//raised when an attempt is made to assign a keeper to a job that already has one assigned; no two keepers can share a job
error JobHasKeeperAssigned(uint256 keeperId);
Scope (modifiers that raise this error):
_job_has_no_keeper_assigned_assertion
SlashingEpochBlocksTooLow
//raised when an attempt is made to set the Agent parameter slashingEpochBlocks (determining the size of the divisor in the slasher assigment function, which has the meaning of the slashing epoch: the amount of blocks for which the only source of slasher distinctness is the job key for reason of all division rounding down to the nearest integer; during one slashing epoch each unique job always has the same slasher assigned to it, provided no changes in the keeper pool manifest) at a value less than 3 blocks
error SlashingEpochBlocksTooLow();
Scope (modifiers that raise this error):
_slashing_period_long_enough_assertion
InvalidPeriod1
//raised when an attempt is made to set the Agent parameter period1, which corresponds to the length of the grace period during which the keeper may not be slashed irrespectively of his executing the job and the possibility of execution thereof, at a value less than 15 seconds
error InvalidPeriod1();
Scope (modifiers that raise this error):
_grace_period_long_enough_assertion
InvalidPeriod2
//raised when an attempt is made to set the Agent parameter period2, which corresponds to the length of the admissibility period during which the job is not considered overdue and cannot be released, i.e. removed from a keeper's pending jobs (possibility of re-initating slashing is also tied to the job being overdue), at a value less than 15 seconds
error InvalidPeriod2();
Scope (modifiers that raise this error):
_admissibility_period_long_enough_assertion
InvalidSlashingFeeFixedCVP
//raised when an attempt is made to set the Agent parameter slashingFeeFixedCVP, which corresponds to the fixed slash a keeper undergoes (in essence the lower bound on the slashed amount during any given slashing event) is not in excess of one half of the (Agent-level) minimal acceptable Keeper stake
error InvalidSlashingFeeFixedCVP();
Scope (modifiers that raise this error):
_slashing_fee_not_too_great_assertion
SlashingBpsGt5000Bps
//raised when an attempt is made to set the Agent parameter slashingFeeBps, which corresponds to the portion of the keeper stake that is slashed during any given slash event (the dynamic slash value) in basis points, is not in excess of 5000 bps (corresp. to 50%, which is precisely why the fixed slashing amount is capped at one half: at no point may any keeper be slashed for more than his entire stake)
error SlashingBpsGt5000Bps();
Scope (modifiers that raise this error):
_slashing_bps_not_too_great_assertion
InvalidStakeDivisor
//raised when an attempt is made to set the Agent parameter stakeDivisor, which corresponds to the inverse of the coefficient by which stake of the keeper is multiplied to produce the fixed (wrt gas) component of the reward, is nonzero
error InvalidStakeDivisor();
Scope (modifiers that raise this error):
_fixed_reward_coeff_finite
InactiveKeeper
//raised if the keeper or slasher scoped by a function is not active (i.e. cannot slash or execute)
error InactiveKeeper();
Scope (modifiers that raise this error):
_keeper_active_assertion
KeeperIsAssignedToJobs
//raised if an attempt is made to disable or withdraw stake of a keeper that is currently assigned to jobs (and has them pending)
error KeeperIsAssignedToJobs(uint256 amountOfJobs);
Scope (modifiers that raise this error):
_keeper_releasable_assertion
OnlyCurrentSlasher
//raised if an attempt to initiate resolver job slashing or perform slashing of an interval job is made by a keeper distinct from the slasher currently assigned to this job
error OnlyCurrentSlasher(uint256 expectedSlasherId);
Scope (modifiers that raise this error):
_is_current_slasher_assertion
OnlyReservedSlasher
//raised if an attempt to perform slashing of a resolver job keeper is made by a slasher that did not initiate its slashing (that keeper is associated with the job key by means of the jobReservedSlasherId mapping)
error OnlyReservedSlasher(uint256 reservedSlasherId);
Scope (modifiers that raise this error):
_is_reserved_slasher_assertion
TooEarlyForSlashing
//raised if an attempt is made to slash a keeper of a resolver job is made before the grace period elapses
error TooEarlyForSlashing(uint256 now_, uint256 possibleAfter);
//raised if an attempt is made to slash a keeper of a resolver job is made without initiating slashing thereof first
error SlashingNotInitiated();
Scope (modifiers that raise this error):
_slashing_initiated_assertion
SlashingNotInitiatedExecutionReverted
//raised in the scope of _afterExecutionReverted if a resolver job has reverted, and it is found that slashing was not yet inititaed
error SlashingNotInitiatedExecutionReverted();
Scope (modifiers that raise this error):
_handle_revert_no_slashing
KeeperCantSlash
//raised if an attempt is made to make the keeper assigned to the job also a slasher thereof. Prevents people from dodging punishment by declaring the same worker both a keeper and a slasher.
error KeeperCantSlash();
Scope (modifiers that raise this error):
_keeper_no_slasher_assertion
KeeperIsAlreadyActive
//raised if an attempt is made to activate an already active keeper
error KeeperIsAlreadyActive();
Scope (modifiers that raise this error):
_keeper_not_active_assertion
KeeperIsAlreadyInactive
//raised if an attempt is made to deactivate an already inactive keeper
error KeeperIsAlreadyInactive();
Scope (modifiers that raise this error):
_keeper_not_inactive_assertion
UnexpectedCodeBlock
//raised as a safeguard: to check executability of a task without engendering any lasting state changes, an always-reverting function checkCouldBeExecuted is used, which on success reverts with the error JobCheckCanBeExecuted, and on fail - with the error JobCheckCanNotBeExecuted. If for some reason checkCouldBeExecuted does not revert, this is caught and handled by the UnexpectedCodeBlock error
error UnexpectedCodeBlock();
Scope (modifiers that raise this error):
_unexpected_nonrevert_safeguard
InitiateSlashingUnexpectedError
//raised to safeguard against an eventuality whereby checkCouldBeExecuted reverts, but the error selector does not match that of either of the two possible errors JobCheckCanBeExecuted and JobCheckCanNotBeExecuted
error InitiateSlashingUnexpectedError();
Scope (modifiers that raise this error):
_unexpected_selector_handler
NonIntervalJob
//raised when an attempt to initiate slashing of an interval job is made; the interval jobs do not require or even admit initiation of slashing, since for them the timestamp from which execution is possible is known exactly in advance
error NonIntervalJob();
Scope (modifiers that raise this error):
_no_initiating_for_interval_jobs
JobCheckResolverError
//raised when an attempt is made to initiate slashing for a job for which the resolver (currently) reverts. Used to prevent abuses from the slasher side.
error JobCheckResolverError(bytes errReason);
Scope (modifiers that raise this error):
_resolver_terminated_successfully_assertion
JobCheckResolverReturnedFalse
//raised when an attempt is made to initiate slashing for a job that is not currently executable (the resolver executes, but returns False for the field of execution admissibility). Used to prevent abuses from the slasher side.
error JobCheckResolverReturnedFalse();
Scope (modifiers that raise this error):
_resolver_returned_true_assertion
TooEarlyToReinitiateSlashing
//raised when an attempt is made to re-initiate slashing of a job that is already initiated and not yet overdue (i.e. at least period2 has not elapsed since the timestamp at which slashing became possible)
error TooEarlyToReinitiateSlashing();
Scope (modifiers that raise this error):
_slashing_period_elapsed_assertion
JobCheckCanBeExecuted
//A technical error used to revert checkCouldBeExecuted when job execution is possible (i.e. the call with the job calldata to a job address does not revert)
error JobCheckCanBeExecuted();
Scope (modifiers that raise this error):
_revert_with_true
JobCheckCanNotBeExecuted
//A technical error used to revert checkCouldBeExecuted when job execution is not possible (i.e. the call with the job calldata to a job address does revert)
error JobCheckCanNotBeExecuted(bytes errReason);
Scope (modifiers that raise this error):
_revert_with_false
TooEarlyToRelease
//raised when an attempt is made to release the job (i.e. unassign the keeper marked for execution) before the job is overdue (i.e. before the period1 elapsed, allowing slashing, and period2 elapsed, ending the admissibility period and unlocking the keeper)
error TooEarlyToRelease(bytes32 jobKey, uint256 period2End);
Scope (modifiers that raise this error):
_lockup_period_expired_assertion
TooEarlyForActivationFinalization
//raised when an attempt is made to finalise activation of a keeper before one can do so (i.e. before the keeperActivationCanBeFinalizedAt value)
error TooEarlyForActivationFinalization(uint256 now, uint256 availableAt);
Scope (modifiers that raise this error):
_keeper_activation_timeout_elapsed_assertion
CantRelease
//raised when an attempt is made to release the resolver job (i.e. unassign the keeper marked for execution) for which slashing has not yet been initiated
error CantRelease();
//raised if an attempt is made to slash a keeper of an interval job is made before the grace period elapses
error OnlyNextKeeper(
uint256 expectedKeeperId,
uint256 lastExecutedAt,
uint256 interval,
uint256 slashingInterval,
uint256 _now
);
//raised in the hypothetical case of an attempt to slash a keeper for more stake than he has. This should never happen, though, due to the way the maximal static and dynamic slash amounts are set.
error InsufficientKeeperStakeToSlash(
bytes32 jobKey,
uint256 expectedKeeperId,
uint256 keeperCurrentStake,
uint256 amountToSlash
);