Rename _rrevert to rrevert
This commit is contained in:
		@@ -47,7 +47,7 @@ library LibMath {
 | 
			
		||||
                denominator,
 | 
			
		||||
                target
 | 
			
		||||
        )) {
 | 
			
		||||
            LibRichErrors._rrevert(LibMathRichErrors.RoundingError(
 | 
			
		||||
            LibRichErrors.rrevert(LibMathRichErrors.RoundingError(
 | 
			
		||||
                numerator,
 | 
			
		||||
                denominator,
 | 
			
		||||
                target
 | 
			
		||||
@@ -78,7 +78,7 @@ library LibMath {
 | 
			
		||||
                denominator,
 | 
			
		||||
                target
 | 
			
		||||
        )) {
 | 
			
		||||
            LibRichErrors._rrevert(LibMathRichErrors.RoundingError(
 | 
			
		||||
            LibRichErrors.rrevert(LibMathRichErrors.RoundingError(
 | 
			
		||||
                numerator,
 | 
			
		||||
                denominator,
 | 
			
		||||
                target
 | 
			
		||||
@@ -152,7 +152,7 @@ library LibMath {
 | 
			
		||||
        returns (bool isError)
 | 
			
		||||
    {
 | 
			
		||||
        if (denominator == 0) {
 | 
			
		||||
            LibRichErrors._rrevert(LibMathRichErrors.DivisionByZeroError());
 | 
			
		||||
            LibRichErrors.rrevert(LibMathRichErrors.DivisionByZeroError());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // The absolute rounding error is the difference between the rounded
 | 
			
		||||
@@ -205,7 +205,7 @@ library LibMath {
 | 
			
		||||
        returns (bool isError)
 | 
			
		||||
    {
 | 
			
		||||
        if (denominator == 0) {
 | 
			
		||||
            LibRichErrors._rrevert(LibMathRichErrors.DivisionByZeroError());
 | 
			
		||||
            LibRichErrors.rrevert(LibMathRichErrors.DivisionByZeroError());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // See the comments in `isRoundingError`.
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ contract MixinAssetProxyDispatcher is
 | 
			
		||||
        bytes4 assetProxyId = IAssetProxy(assetProxy).getProxyId();
 | 
			
		||||
        address currentAssetProxy = assetProxies[assetProxyId];
 | 
			
		||||
        if (currentAssetProxy != address(0)) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.AssetProxyExistsError(currentAssetProxy));
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyExistsError(currentAssetProxy));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Add asset proxy and log registration.
 | 
			
		||||
@@ -88,7 +88,7 @@ contract MixinAssetProxyDispatcher is
 | 
			
		||||
        if (amount > 0 && from != to) {
 | 
			
		||||
            // Ensure assetData length is valid
 | 
			
		||||
            if (assetData.length <= 3) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.AssetProxyDispatchError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyDispatchError(
 | 
			
		||||
                    IExchangeRichErrors.AssetProxyDispatchErrorCodes.INVALID_ASSET_DATA_LENGTH,
 | 
			
		||||
                    orderHash,
 | 
			
		||||
                    assetData
 | 
			
		||||
@@ -101,7 +101,7 @@ contract MixinAssetProxyDispatcher is
 | 
			
		||||
 | 
			
		||||
            // Ensure that assetProxy exists
 | 
			
		||||
            if (assetProxy == address(0)) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.AssetProxyDispatchError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyDispatchError(
 | 
			
		||||
                    IExchangeRichErrors.AssetProxyDispatchErrorCodes.UNKNOWN_ASSET_PROXY,
 | 
			
		||||
                    orderHash,
 | 
			
		||||
                    assetData
 | 
			
		||||
@@ -122,7 +122,7 @@ contract MixinAssetProxyDispatcher is
 | 
			
		||||
 | 
			
		||||
            // If the transaction did not succeed, revert with the returned data.
 | 
			
		||||
            if (!didSucceed) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.AssetProxyTransferError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyTransferError(
 | 
			
		||||
                    orderHash,
 | 
			
		||||
                    assetData,
 | 
			
		||||
                    revertData
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ contract MixinExchangeCore is
 | 
			
		||||
 | 
			
		||||
        // Ensure orderEpoch is monotonically increasing
 | 
			
		||||
        if (newOrderEpoch <= oldOrderEpoch) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.OrderEpochError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.OrderEpochError(
 | 
			
		||||
                makerAddress,
 | 
			
		||||
                orderSenderAddress,
 | 
			
		||||
                oldOrderEpoch
 | 
			
		||||
@@ -330,7 +330,7 @@ contract MixinExchangeCore is
 | 
			
		||||
    {
 | 
			
		||||
        // An order can only be filled if its status is FILLABLE.
 | 
			
		||||
        if (orderInfo.orderStatus != uint8(LibOrder.OrderStatus.FILLABLE)) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.OrderStatusError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.OrderStatusError(
 | 
			
		||||
                orderInfo.orderHash,
 | 
			
		||||
                LibOrder.OrderStatus(orderInfo.orderStatus)
 | 
			
		||||
            ));
 | 
			
		||||
@@ -339,7 +339,7 @@ contract MixinExchangeCore is
 | 
			
		||||
        // Validate sender is allowed to fill this order
 | 
			
		||||
        if (order.senderAddress != address(0)) {
 | 
			
		||||
            if (order.senderAddress != msg.sender) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.InvalidSenderError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.InvalidSenderError(
 | 
			
		||||
                    orderInfo.orderHash, msg.sender
 | 
			
		||||
                ));
 | 
			
		||||
            }
 | 
			
		||||
@@ -348,7 +348,7 @@ contract MixinExchangeCore is
 | 
			
		||||
        // Validate taker is allowed to fill this order
 | 
			
		||||
        if (order.takerAddress != address(0)) {
 | 
			
		||||
            if (order.takerAddress != takerAddress) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.InvalidTakerError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.InvalidTakerError(
 | 
			
		||||
                    orderInfo.orderHash, takerAddress
 | 
			
		||||
                ));
 | 
			
		||||
            }
 | 
			
		||||
@@ -367,7 +367,7 @@ contract MixinExchangeCore is
 | 
			
		||||
                    order,
 | 
			
		||||
                    orderInfo.orderHash,
 | 
			
		||||
                    signature)) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                    IExchangeRichErrors.SignatureErrorCodes.BAD_SIGNATURE,
 | 
			
		||||
                    orderInfo.orderHash,
 | 
			
		||||
                    makerAddress,
 | 
			
		||||
@@ -390,14 +390,14 @@ contract MixinExchangeCore is
 | 
			
		||||
        // Validate sender is allowed to cancel this order
 | 
			
		||||
        if (order.senderAddress != address(0)) {
 | 
			
		||||
            if (order.senderAddress != msg.sender) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.InvalidSenderError(orderInfo.orderHash, msg.sender));
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.InvalidSenderError(orderInfo.orderHash, msg.sender));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Validate transaction signed by maker
 | 
			
		||||
        address makerAddress = _getCurrentContextAddress();
 | 
			
		||||
        if (order.makerAddress != makerAddress) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.InvalidMakerError(orderInfo.orderHash, makerAddress));
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.InvalidMakerError(orderInfo.orderHash, makerAddress));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ contract MixinMatchOrders is
 | 
			
		||||
        // These equations can be combined to get the following:
 | 
			
		||||
        if (leftOrder.makerAssetAmount.safeMul(rightOrder.makerAssetAmount) <
 | 
			
		||||
            leftOrder.takerAssetAmount.safeMul(rightOrder.takerAssetAmount)) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.NegativeSpreadError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.NegativeSpreadError(
 | 
			
		||||
                leftOrderInfo.orderHash,
 | 
			
		||||
                rightOrderInfo.orderHash
 | 
			
		||||
            ));
 | 
			
		||||
@@ -196,24 +196,24 @@ contract MixinMatchOrders is
 | 
			
		||||
    {
 | 
			
		||||
        // Ensure that the left and right orders have nonzero lengths.
 | 
			
		||||
        if (leftOrders.length == 0) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
                IExchangeRichErrors.BatchMatchOrdersErrorCodes.ZERO_LEFT_ORDERS
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
        if (rightOrders.length == 0) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
                IExchangeRichErrors.BatchMatchOrdersErrorCodes.ZERO_RIGHT_ORDERS
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Ensure that the left and right arrays are compatible.
 | 
			
		||||
        if (leftOrders.length != leftSignatures.length) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
                IExchangeRichErrors.BatchMatchOrdersErrorCodes.INVALID_LENGTH_LEFT_SIGNATURES
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
        if (rightOrders.length != rightSignatures.length) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.BatchMatchOrdersError(
 | 
			
		||||
                IExchangeRichErrors.BatchMatchOrdersErrorCodes.INVALID_LENGTH_RIGHT_SIGNATURES
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -111,7 +111,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
            signatureType == SignatureType.Validator ||
 | 
			
		||||
            signatureType == SignatureType.EIP1271Wallet
 | 
			
		||||
        ) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                IExchangeRichErrors.SignatureErrorCodes.INAPPROPRIATE_SIGNATURE_TYPE,
 | 
			
		||||
                hash,
 | 
			
		||||
                signerAddress,
 | 
			
		||||
@@ -307,7 +307,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        // a correctly formatted but incorrect signature.
 | 
			
		||||
        if (signatureType == SignatureType.Invalid) {
 | 
			
		||||
            if (signature.length != 1) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                    IExchangeRichErrors.SignatureErrorCodes.INVALID_LENGTH,
 | 
			
		||||
                    hash,
 | 
			
		||||
                    signerAddress,
 | 
			
		||||
@@ -319,7 +319,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        // Signature using EIP712
 | 
			
		||||
        } else if (signatureType == SignatureType.EIP712) {
 | 
			
		||||
            if (signature.length != 66) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                    IExchangeRichErrors.SignatureErrorCodes.INVALID_LENGTH,
 | 
			
		||||
                    hash,
 | 
			
		||||
                    signerAddress,
 | 
			
		||||
@@ -340,7 +340,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        // Signed using web3.eth_sign
 | 
			
		||||
        } else if (signatureType == SignatureType.EthSign) {
 | 
			
		||||
            if (signature.length != 66) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                    IExchangeRichErrors.SignatureErrorCodes.INVALID_LENGTH,
 | 
			
		||||
                    hash,
 | 
			
		||||
                    signerAddress,
 | 
			
		||||
@@ -399,7 +399,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (signature.length == 0) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                IExchangeRichErrors.SignatureErrorCodes.INVALID_LENGTH,
 | 
			
		||||
                hash,
 | 
			
		||||
                signerAddress,
 | 
			
		||||
@@ -412,7 +412,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
 | 
			
		||||
        // Ensure signature is supported
 | 
			
		||||
        if (signatureTypeRaw >= uint8(SignatureType.NSignatureTypes)) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                IExchangeRichErrors.SignatureErrorCodes.UNSUPPORTED,
 | 
			
		||||
                hash,
 | 
			
		||||
                signerAddress,
 | 
			
		||||
@@ -426,7 +426,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        // it an explicit option. This aids testing and analysis. It is
 | 
			
		||||
        // also the initialization value for the enum type.
 | 
			
		||||
        if (SignatureType(signatureTypeRaw) == SignatureType.Illegal) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.SignatureError(
 | 
			
		||||
                IExchangeRichErrors.SignatureErrorCodes.ILLEGAL,
 | 
			
		||||
                hash,
 | 
			
		||||
                signerAddress,
 | 
			
		||||
@@ -481,7 +481,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
            return returnData.readBytes4(0) == LEGACY_WALLET_MAGIC_VALUE;
 | 
			
		||||
        }
 | 
			
		||||
        // Static call to verifier failed.
 | 
			
		||||
        LibRichErrors._rrevert(LibExchangeRichErrors.SignatureWalletError(
 | 
			
		||||
        LibRichErrors.rrevert(LibExchangeRichErrors.SignatureWalletError(
 | 
			
		||||
            hash,
 | 
			
		||||
            walletAddress,
 | 
			
		||||
            signature,
 | 
			
		||||
@@ -535,7 +535,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
            return returnData.readBytes4(0) == EIP1271_MAGIC_VALUE;
 | 
			
		||||
        }
 | 
			
		||||
        // Static call to verifier failed.
 | 
			
		||||
        LibRichErrors._rrevert(LibExchangeRichErrors.SignatureWalletError(
 | 
			
		||||
        LibRichErrors.rrevert(LibExchangeRichErrors.SignatureWalletError(
 | 
			
		||||
            hash,
 | 
			
		||||
            walletAddress,
 | 
			
		||||
            signature,
 | 
			
		||||
@@ -571,7 +571,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
        address validatorAddress = signature.readAddress(signatureLength - 21);
 | 
			
		||||
        // Ensure signer has approved validator.
 | 
			
		||||
        if (!allowedValidators[signerAddress][validatorAddress]) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.SignatureValidatorNotApprovedError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.SignatureValidatorNotApprovedError(
 | 
			
		||||
                signerAddress,
 | 
			
		||||
                validatorAddress
 | 
			
		||||
            ));
 | 
			
		||||
@@ -599,7 +599,7 @@ contract MixinSignatureValidator is
 | 
			
		||||
            return returnData.readBytes4(0) == EIP1271_MAGIC_VALUE;
 | 
			
		||||
        }
 | 
			
		||||
        // Static call to verifier failed.
 | 
			
		||||
        LibRichErrors._rrevert(LibExchangeRichErrors.SignatureValidatorError(
 | 
			
		||||
        LibRichErrors.rrevert(LibExchangeRichErrors.SignatureValidatorError(
 | 
			
		||||
            hash,
 | 
			
		||||
            signerAddress,
 | 
			
		||||
            validatorAddress,
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ contract MixinTransactions is
 | 
			
		||||
        // Check transaction is not expired
 | 
			
		||||
        // solhint-disable-next-line not-rely-on-time
 | 
			
		||||
        if (block.timestamp >= transaction.expirationTimeSeconds) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
                IExchangeRichErrors.TransactionErrorCodes.EXPIRED,
 | 
			
		||||
                transactionHash
 | 
			
		||||
            ));
 | 
			
		||||
@@ -99,7 +99,7 @@ contract MixinTransactions is
 | 
			
		||||
 | 
			
		||||
        // Prevent reentrancy
 | 
			
		||||
        if (currentContextAddress != address(0)) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
                IExchangeRichErrors.TransactionErrorCodes.NO_REENTRANCY,
 | 
			
		||||
                transactionHash
 | 
			
		||||
            ));
 | 
			
		||||
@@ -107,7 +107,7 @@ contract MixinTransactions is
 | 
			
		||||
 | 
			
		||||
        // Validate transaction has not been executed
 | 
			
		||||
        if (transactionsExecuted[transactionHash]) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.TransactionError(
 | 
			
		||||
                IExchangeRichErrors.TransactionErrorCodes.ALREADY_EXECUTED,
 | 
			
		||||
                transactionHash
 | 
			
		||||
            ));
 | 
			
		||||
@@ -121,7 +121,7 @@ contract MixinTransactions is
 | 
			
		||||
                    transaction,
 | 
			
		||||
                    transactionHash,
 | 
			
		||||
                    signature)) {
 | 
			
		||||
                LibRichErrors._rrevert(LibExchangeRichErrors.TransactionSignatureError(
 | 
			
		||||
                LibRichErrors.rrevert(LibExchangeRichErrors.TransactionSignatureError(
 | 
			
		||||
                    transactionHash,
 | 
			
		||||
                    signerAddress,
 | 
			
		||||
                    signature
 | 
			
		||||
@@ -136,7 +136,7 @@ contract MixinTransactions is
 | 
			
		||||
        transactionsExecuted[transactionHash] = true;
 | 
			
		||||
        (bool didSucceed, bytes memory returnData) = address(this).delegatecall(transaction.data);
 | 
			
		||||
        if (!didSucceed) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.TransactionExecutionError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.TransactionExecutionError(
 | 
			
		||||
                transactionHash,
 | 
			
		||||
                returnData
 | 
			
		||||
            ));
 | 
			
		||||
 
 | 
			
		||||
@@ -308,7 +308,7 @@ contract MixinWrapperFunctions is
 | 
			
		||||
            signature
 | 
			
		||||
        );
 | 
			
		||||
        if (fillResults.takerAssetFilledAmount != takerAssetFillAmount) {
 | 
			
		||||
            LibRichErrors._rrevert(LibExchangeRichErrors.IncompleteFillError(
 | 
			
		||||
            LibRichErrors.rrevert(LibExchangeRichErrors.IncompleteFillError(
 | 
			
		||||
                getOrderInfo(order).orderHash
 | 
			
		||||
            ));
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -27,6 +27,6 @@ contract TestLibRichErrors {
 | 
			
		||||
        external
 | 
			
		||||
        pure
 | 
			
		||||
    {
 | 
			
		||||
        LibRichErrors._rrevert(errorData);
 | 
			
		||||
        LibRichErrors.rrevert(errorData);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user