From 386a95780bf28b0ee8db7c0d4b29f864c22da07b Mon Sep 17 00:00:00 2001 From: ConjunctiveNormalForm Date: Wed, 20 Dec 2023 17:43:54 -0500 Subject: [PATCH] clean up validateRevert --- contracts/lens/Quoter.sol | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/contracts/lens/Quoter.sol b/contracts/lens/Quoter.sol index 09d4d216..08614c4c 100644 --- a/contracts/lens/Quoter.sol +++ b/contracts/lens/Quoter.sol @@ -28,9 +28,6 @@ contract Quoter is IQuoter, ILockCallback { /// @dev custom error function selector length uint256 internal constant MINIMUM_CUSTOM_ERROR_LENGTH = 4; - /// @dev function selector + length of bytes as uint256 + min length of revert reason padded to multiple of 32 bytes - uint256 internal constant MINIMUM_REASON_LENGTH = 68; - /// @dev min valid reason is 3-words long /// @dev int128[2] + sqrtPriceX96After padded to 32bytes + intializeTicksLoaded padded to 32bytes uint256 internal constant MINIMUM_VALID_RESPONSE_LENGTH = 96; @@ -123,19 +120,7 @@ contract Quoter is IQuoter, ILockCallback { /// @dev check revert bytes and pass through if considered valid; otherwise revert with different message 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) { - assembly { - revert(reason, 4) - } - } - if (reason.length < MINIMUM_REASON_LENGTH) { - revert UnexpectedRevertBytes(reason); - } - assembly { - reason := add(reason, 0x04) - } - revert(abi.decode(reason, (string))); + revert UnexpectedRevertBytes(reason); } return reason; }