Rename _rrevert to rrevert
This commit is contained in:
@@ -31,7 +31,7 @@ contract Authorizable is
|
||||
/// @dev Only authorized addresses can invoke functions with this modifier.
|
||||
modifier onlyAuthorized {
|
||||
if (!authorized[msg.sender]) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.SenderNotAuthorizedError(msg.sender));
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.SenderNotAuthorizedError(msg.sender));
|
||||
}
|
||||
_;
|
||||
}
|
||||
@@ -47,12 +47,12 @@ contract Authorizable is
|
||||
{
|
||||
// Ensure that the target is not the zero address.
|
||||
if (target == address(0)) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.ZeroCantBeAuthorizedError());
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.ZeroCantBeAuthorizedError());
|
||||
}
|
||||
|
||||
// Ensure that the target is not already authorized.
|
||||
if (authorized[target]) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.TargetAlreadyAuthorizedError(target));
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.TargetAlreadyAuthorizedError(target));
|
||||
}
|
||||
|
||||
authorized[target] = true;
|
||||
@@ -67,7 +67,7 @@ contract Authorizable is
|
||||
onlyOwner
|
||||
{
|
||||
if (!authorized[target]) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.TargetNotAuthorizedError(target));
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.TargetNotAuthorizedError(target));
|
||||
}
|
||||
|
||||
delete authorized[target];
|
||||
@@ -92,16 +92,16 @@ contract Authorizable is
|
||||
onlyOwner
|
||||
{
|
||||
if (!authorized[target]) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.TargetNotAuthorizedError(target));
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.TargetNotAuthorizedError(target));
|
||||
}
|
||||
if (index >= authorities.length) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.IndexOutOfBoundsError(
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.IndexOutOfBoundsError(
|
||||
index,
|
||||
authorities.length
|
||||
));
|
||||
}
|
||||
if (authorities[index] != target) {
|
||||
LibRichErrors._rrevert(LibAuthorizableRichErrors.AuthorizedAddressMismatchError(
|
||||
LibRichErrors.rrevert(LibAuthorizableRichErrors.AuthorizedAddressMismatchError(
|
||||
authorities[index],
|
||||
target
|
||||
));
|
||||
|
@@ -54,7 +54,7 @@ library LibAddressArray {
|
||||
// `freeMemPtr` > `addressArrayEndPtr`: Some value occupies memory after `addressArray`
|
||||
// `freeMemPtr` < `addressArrayEndPtr`: Memory has not been managed properly.
|
||||
if (freeMemPtr < addressArrayEndPtr) {
|
||||
LibRichErrors._rrevert(LibAddressArrayRichErrors.MismanagedMemoryError(
|
||||
LibRichErrors.rrevert(LibAddressArrayRichErrors.MismanagedMemoryError(
|
||||
freeMemPtr,
|
||||
addressArrayEndPtr
|
||||
));
|
||||
|
@@ -180,14 +180,14 @@ library LibBytes {
|
||||
// Ensure that the from and to positions are valid positions for a slice within
|
||||
// the byte array that is being used.
|
||||
if (from > to) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired,
|
||||
from,
|
||||
to
|
||||
));
|
||||
}
|
||||
if (to > b.length) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired,
|
||||
to,
|
||||
b.length
|
||||
@@ -222,14 +222,14 @@ library LibBytes {
|
||||
// Ensure that the from and to positions are valid positions for a slice within
|
||||
// the byte array that is being used.
|
||||
if (from > to) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.FromLessThanOrEqualsToRequired,
|
||||
from,
|
||||
to
|
||||
));
|
||||
}
|
||||
if (to > b.length) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.ToLessThanOrEqualsLengthRequired,
|
||||
to,
|
||||
b.length
|
||||
@@ -253,7 +253,7 @@ library LibBytes {
|
||||
returns (bytes1 result)
|
||||
{
|
||||
if (b.length == 0) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanZeroRequired,
|
||||
b.length,
|
||||
0
|
||||
@@ -280,7 +280,7 @@ library LibBytes {
|
||||
returns (address result)
|
||||
{
|
||||
if (b.length < 20) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired,
|
||||
b.length,
|
||||
20 // 20 is length of address
|
||||
@@ -329,7 +329,7 @@ library LibBytes {
|
||||
returns (address result)
|
||||
{
|
||||
if (b.length < index + 20) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired,
|
||||
b.length,
|
||||
index + 20 // 20 is length of address
|
||||
@@ -364,7 +364,7 @@ library LibBytes {
|
||||
pure
|
||||
{
|
||||
if (b.length < index + 20) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsTwentyRequired,
|
||||
b.length,
|
||||
index + 20 // 20 is length of address
|
||||
@@ -413,7 +413,7 @@ library LibBytes {
|
||||
returns (bytes32 result)
|
||||
{
|
||||
if (b.length < index + 32) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired,
|
||||
b.length,
|
||||
index + 32
|
||||
@@ -443,7 +443,7 @@ library LibBytes {
|
||||
pure
|
||||
{
|
||||
if (b.length < index + 32) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsThirtyTwoRequired,
|
||||
b.length,
|
||||
index + 32
|
||||
@@ -503,7 +503,7 @@ library LibBytes {
|
||||
returns (bytes4 result)
|
||||
{
|
||||
if (b.length < index + 4) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsFourRequired,
|
||||
b.length,
|
||||
index + 4
|
||||
@@ -544,7 +544,7 @@ library LibBytes {
|
||||
// Assert length of <b> is valid, given
|
||||
// length of nested bytes
|
||||
if (b.length < index + nestedBytesLength) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors
|
||||
.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsNestedBytesLengthRequired,
|
||||
b.length,
|
||||
@@ -574,7 +574,7 @@ library LibBytes {
|
||||
// Assert length of <b> is valid, given
|
||||
// length of input
|
||||
if (b.length < index + 32 + input.length) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors
|
||||
.InvalidByteOperationErrorCodes.LengthGreaterThanOrEqualsNestedBytesLengthRequired,
|
||||
b.length,
|
||||
@@ -603,7 +603,7 @@ library LibBytes {
|
||||
uint256 sourceLen = source.length;
|
||||
// Dest length must be >= source length, or some bytes would not be copied.
|
||||
if (dest.length < sourceLen) {
|
||||
LibRichErrors._rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibRichErrors.rrevert(LibBytesRichErrors.InvalidByteOperationError(
|
||||
LibBytesRichErrors
|
||||
.InvalidByteOperationErrorCodes.DestinationLengthGreaterThanOrEqualSourceLengthRequired,
|
||||
dest.length,
|
||||
|
@@ -47,7 +47,7 @@ library LibRichErrors {
|
||||
|
||||
/// @dev Reverts an encoded rich revert reason `errorData`.
|
||||
/// @param errorData ABI encoded error data.
|
||||
function _rrevert(bytes memory errorData)
|
||||
function rrevert(bytes memory errorData)
|
||||
internal
|
||||
pure
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@ library LibSafeMath {
|
||||
}
|
||||
uint256 c = a * b;
|
||||
if (c / a != b) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_MULTIPLICATION_OVERFLOW,
|
||||
a,
|
||||
b
|
||||
@@ -31,7 +31,7 @@ library LibSafeMath {
|
||||
returns (uint256)
|
||||
{
|
||||
if (b == 0) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_DIVISION_BY_ZERO,
|
||||
a,
|
||||
b
|
||||
@@ -47,7 +47,7 @@ library LibSafeMath {
|
||||
returns (uint256)
|
||||
{
|
||||
if (b > a) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_SUBTRACTION_UNDERFLOW,
|
||||
a,
|
||||
b
|
||||
@@ -63,7 +63,7 @@ library LibSafeMath {
|
||||
{
|
||||
uint256 c = a + b;
|
||||
if (c < a) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_ADDITION_OVERFLOW,
|
||||
a,
|
||||
b
|
||||
|
@@ -18,7 +18,7 @@ contract Ownable is
|
||||
|
||||
modifier onlyOwner() {
|
||||
if (msg.sender != owner) {
|
||||
LibRichErrors._rrevert(LibOwnableRichErrors.OnlyOwnerError(
|
||||
LibRichErrors.rrevert(LibOwnableRichErrors.OnlyOwnerError(
|
||||
msg.sender,
|
||||
owner
|
||||
));
|
||||
@@ -31,7 +31,7 @@ contract Ownable is
|
||||
onlyOwner
|
||||
{
|
||||
if (newOwner == address(0)) {
|
||||
LibRichErrors._rrevert(LibOwnableRichErrors.TransferOwnerToZeroError());
|
||||
LibRichErrors.rrevert(LibOwnableRichErrors.TransferOwnerToZeroError());
|
||||
} else {
|
||||
owner = newOwner;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ contract ReentrancyGuard {
|
||||
// If the counter value is different from what we remember, the function
|
||||
// was called more than once and an illegal reentrancy occured.
|
||||
if (localCounter != reentrancyGuardCounter) {
|
||||
LibRichErrors._rrevert(
|
||||
LibRichErrors.rrevert(
|
||||
LibReentrancyGuardRichErrors.IllegalReentrancyError()
|
||||
);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ contract SafeMath {
|
||||
}
|
||||
uint256 c = a * b;
|
||||
if (c / a != b) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_MULTIPLICATION_OVERFLOW,
|
||||
a,
|
||||
b
|
||||
@@ -31,7 +31,7 @@ contract SafeMath {
|
||||
returns (uint256)
|
||||
{
|
||||
if (b == 0) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_DIVISION_BY_ZERO,
|
||||
a,
|
||||
b
|
||||
@@ -47,7 +47,7 @@ contract SafeMath {
|
||||
returns (uint256)
|
||||
{
|
||||
if (b > a) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_SUBTRACTION_UNDERFLOW,
|
||||
a,
|
||||
b
|
||||
@@ -63,7 +63,7 @@ contract SafeMath {
|
||||
{
|
||||
uint256 c = a + b;
|
||||
if (c < a) {
|
||||
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibRichErrors.rrevert(LibSafeMathRichErrors.SafeMathError(
|
||||
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_ADDITION_OVERFLOW,
|
||||
a,
|
||||
b
|
||||
|
Reference in New Issue
Block a user