diff --git a/contracts/exchange-libs/contracts/src/LibExchangeRichErrors.sol b/contracts/exchange-libs/contracts/src/LibExchangeRichErrors.sol index b1f6885821..04ce429e21 100644 --- a/contracts/exchange-libs/contracts/src/LibExchangeRichErrors.sol +++ b/contracts/exchange-libs/contracts/src/LibExchangeRichErrors.sol @@ -53,7 +53,6 @@ library LibExchangeRichErrors { } enum TransactionErrorCodes { - NO_REENTRANCY, ALREADY_EXECUTED, EXPIRED } @@ -136,6 +135,10 @@ library LibExchangeRichErrors { bytes4 internal constant TRANSACTION_GAS_PRICE_ERROR_SELECTOR = 0xa26dac09; + // bytes4(keccak256("TransactionInvalidContextError(bytes32,address)")) + bytes4 internal constant TRANSACTION_INVALID_CONTEXT_ERROR_SELECTOR = + 0xdec4aedf; + // bytes4(keccak256("IncompleteFillError(uint8,uint256,uint256)")) bytes4 internal constant INCOMPLETE_FILL_ERROR_SELECTOR = 0x18e4b141; @@ -610,6 +613,21 @@ library LibExchangeRichErrors { ); } + function TransactionInvalidContextError( + bytes32 transactionHash, + address currentContextAddress + ) + internal + pure + returns (bytes memory) + { + return abi.encodeWithSelector( + TRANSACTION_INVALID_CONTEXT_ERROR_SELECTOR, + transactionHash, + currentContextAddress + ); + } + function IncompleteFillError( IncompleteFillErrorCode errorCode, uint256 expectedAssetFillAmount,