In @0x/contracts-utils
add natspec comments RichErrors.StandardError
This commit is contained in:
parent
5781ab5436
commit
e54f5d563f
@ -25,6 +25,11 @@ contract RichErrors is
|
|||||||
MRichErrors
|
MRichErrors
|
||||||
{
|
{
|
||||||
// solhint-disable func-name-mixedcase
|
// solhint-disable func-name-mixedcase
|
||||||
|
/// @dev ABI encode a standard, string revert error payload.
|
||||||
|
/// This is the same payload that would be included by a `revert(string)`
|
||||||
|
/// solidity statement. It has the function signature `Error(string)`.
|
||||||
|
/// @param message The error string.
|
||||||
|
/// @return The ABI encoded error.
|
||||||
function StandardError(
|
function StandardError(
|
||||||
string memory message
|
string memory message
|
||||||
)
|
)
|
||||||
@ -32,13 +37,14 @@ contract RichErrors is
|
|||||||
pure
|
pure
|
||||||
returns (bytes memory)
|
returns (bytes memory)
|
||||||
{
|
{
|
||||||
return abi.encodePacked(
|
return abi.encodeWithSelector(
|
||||||
STANDARD_ERROR_SELECTOR,
|
STANDARD_ERROR_SELECTOR,
|
||||||
uint256(0x20),
|
uint256(0x20),
|
||||||
bytes(message).length,
|
bytes(message).length,
|
||||||
bytes(message)
|
bytes(message)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// solhint-enable func-name-mixedcase
|
||||||
|
|
||||||
/// @dev Reverts an encoded rich revert reason `errorData`.
|
/// @dev Reverts an encoded rich revert reason `errorData`.
|
||||||
/// @param errorData ABI encoded error data.
|
/// @param errorData ABI encoded error data.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user