Skip to content

Commit

Permalink
resurface revert reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ConjunctiveNormalForm committed Dec 20, 2023
1 parent f00e616 commit 753d11a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/interfaces/IQuoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface IQuoter {
error InsufficientAmountOut();
error LockFailure();
error NotSelf();
error UnexpectedRevertBytes();
error UnexpectedRevertBytes(bytes revertData);

struct PoolDeltas {
int128 currency0Delta;
Expand Down
4 changes: 2 additions & 2 deletions contracts/lens/Quoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 753d11a

Please sign in to comment.