From 753d11a91ea14316f8194b9d53c6b7d3de5292f6 Mon Sep 17 00:00:00 2001 From: ConjunctiveNormalForm Date: Tue, 19 Dec 2023 19:16:09 -0500 Subject: [PATCH] resurface revert reason --- contracts/interfaces/IQuoter.sol | 2 +- contracts/lens/Quoter.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/interfaces/IQuoter.sol b/contracts/interfaces/IQuoter.sol index faeaeea8..90a390fc 100644 --- a/contracts/interfaces/IQuoter.sol +++ b/contracts/interfaces/IQuoter.sol @@ -17,7 +17,7 @@ interface IQuoter { error InsufficientAmountOut(); error LockFailure(); error NotSelf(); - error UnexpectedRevertBytes(); + error UnexpectedRevertBytes(bytes revertData); struct PoolDeltas { int128 currency0Delta; diff --git a/contracts/lens/Quoter.sol b/contracts/lens/Quoter.sol index 84753cd5..09d4d216 100644 --- a/contracts/lens/Quoter.sol +++ b/contracts/lens/Quoter.sol @@ -124,13 +124,13 @@ contract Quoter is IQuoter, ILockCallback { function validateRevertReason(bytes memory reason) private pure returns (bytes memory) { if (reason.length < MINIMUM_VALID_RESPONSE_LENGTH) { //if InvalidLockAcquiredSender() - if (reason.length == MINIMUM_CUSTOM_ERROR_LENGTH) { + if (reason.length <= MINIMUM_CUSTOM_ERROR_LENGTH) { assembly { revert(reason, 4) } } if (reason.length < MINIMUM_REASON_LENGTH) { - revert UnexpectedRevertBytes(); + revert UnexpectedRevertBytes(reason); } assembly { reason := add(reason, 0x04)