return'This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.'
returnt`This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.`
case'TransferHelper: TRANSFER_FROM_FAILED':
case'TransferHelper: TRANSFER_FROM_FAILED':
return'The input token cannot be transferred. There may be an issue with the input token.'
returnt`The input token cannot be transferred. There may be an issue with the input token.`
case'UniswapV2: TRANSFER_FAILED':
case'UniswapV2: TRANSFER_FAILED':
return'The output token cannot be transferred. There may be an issue with the output token.'
returnt`The output token cannot be transferred. There may be an issue with the output token.`
case'UniswapV2: K':
case'UniswapV2: K':
return'The Uniswap invariant x*y=k was not satisfied by the swap. This usually means one of the tokens you are swapping incorporates custom behavior on transfer.'
returnt`The Uniswap invariant x*y=k was not satisfied by the swap. This usually means one of the tokens you are swapping incorporates custom behavior on transfer.`
case'Too little received':
case'Too little received':
case'Too much requested':
case'Too much requested':
case'STF':
case'STF':
return'This transaction will not succeed due to price movement. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.'
returnt`This transaction will not succeed due to price movement. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
case'TF':
case'TF':
return'The output token cannot be transferred. There may be an issue with the output token. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.'
returnt`The output token cannot be transferred. There may be an issue with the output token. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
default:
default:
if(reason?.indexOf('undefined is not an object')!==-1){
if(reason?.indexOf('undefined is not an object')!==-1){
console.error(error,reason)
console.error(error,reason)
return'An error occurred when trying to execute this swap. You may need to increase your slippage tolerance. If that does not work, there may be an incompatibility with the token you are trading. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.'
returnt`An error occurred when trying to execute this swap. You may need to increase your slippage tolerance. If that does not work, there may be an incompatibility with the token you are trading. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
}
}
return`Unknown error${
returnt`Unknown error${
reason?`: "${reason}"`:''
reason?`: "${reason}"`:''
}. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
}. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`