Overview
ERC-7751 defines a standard error for wrapping revert reasons from external calls with additional context about the call that failed. Useful for:- Debugging complex multi-contract interactions
- Preserving original error while adding call context
- Standardized error wrapping across protocols
WrappedError Format
API
encodeWrappedError
encodeWrappedError(params: WrappedErrorParams): Uint8Array
Encodes a wrapped error with context.
Parameters:
decodeWrappedError
decodeWrappedError(data: Uint8Array): WrappedErrorData
Decodes a wrapped error to extract context.
Returns:
Usage Patterns
Contract Error Handler
Error Tracer
Constants
WRAPPED_ERROR_SELECTOR
WrappedError(address,bytes4,bytes,bytes).

