Skip to content

RevertErrorTracking#

Revert error tracking contract.

A contract to track and store revert errors.

Events#

ContractRevertError#

Defined in RevertErrorTracking (Docs, Source).

event ContractRevertError(
    address theContract,
    uint256 atBlock,
    string theMessage
)

Emitted when a contract reverts.

Parameters Type Description
theContract address The culprit's address.
atBlock uint256 Block number where the error happened.
theMessage string Reason for the revert, as reported by the contract.

Functions#

showLastRevertedError#

Defined in RevertErrorTracking (Docs, Source).

function showLastRevertedError(
) external view returns (
    uint256[] _lastErrorBlock,
    uint256[] _numErrors,
    string[] _errorString,
    address[] _erroringContract,
    uint256 _totalRevertedErrors);

Returns latest error information. All arrays will contain only one entry.

Returns Type Description
_lastErrorBlock uint256[] Array of block numbers where the errors occurred.
_numErrors uint256[] Array of number of times same error with same contract address has been reverted.
_errorString string[] Array of revert error messages.
_erroringContract address[] Array of addresses of the reverting contracts.
_totalRevertedErrors uint256 Total number of revert errors across all contracts.

showRevertedErrors#

Defined in RevertErrorTracking (Docs, Source).

function showRevertedErrors(
    uint256 startIndex,
    uint256 numErrorTypesToShow
) public view returns (
    uint256[] _lastErrorBlock,
    uint256[] _numErrors,
    string[] _errorString,
    address[] _erroringContract,
    uint256 _totalRevertedErrors);

Returns latest errors.

Parameters Type Description
startIndex uint256 Starting index in the error list array.
numErrorTypesToShow uint256 Number of errors to show. The total amount can be found in errorData.
Returns Type Description
_lastErrorBlock uint256[] Array of block numbers where the errors occurred.
_numErrors uint256[] Array of number of times same error with same contract address has been reverted.
_errorString string[] Array of revert error messages.
_erroringContract address[] Array of addresses of the reverting contracts.
_totalRevertedErrors uint256 Total number of revert errors across all contracts.

Structures#

LastErrorData#

Defined in RevertErrorTracking (Docs, Source).

struct LastErrorData {
  uint192 totalRevertedErrors;
  uint64 lastErrorTypeIndex;
}

RevertedError#

Defined in RevertErrorTracking (Docs, Source).

struct RevertedError {
  uint192 lastErrorBlock;
  uint64 numErrors;
  address fromContract;
  uint64 errorTypeIndex;
  string errorMessage;
}

Variables#

errorData#

Defined in RevertErrorTracking (Docs, Source).

    struct RevertErrorTracking.LastErrorData errorData

Most recent error information.


Last update: 2024-03-01