Skip to content

deadline parameter is no longer exists in SwapRouter02 contract #234

@thkdog

Description

@thkdog

Have you ever use the v3-sdk?

  const options: SwapOptions = {
    slippageTolerance: new Percent(50, 10_000), // 50 bips, or 0.50%
    deadline: Math.floor(Date.now() / 1000) + 60 * 20, // 20 minutes from the current Unix time
    recipient: walletAddress,
  }

  const methodParameters = SwapRouter.swapCallParameters(trade, options)

The exactInputSingle transaction built by the swapCallParameters in sdk-v3 will cause contract error, I checked the parameters in the contract used by the sdk
https://github.com/Uniswap/v3-periphery/blob/0682387198a24c7cd63566a2c58398533860a5d1/contracts/interfaces/ISwapRouter.sol#L15, there is deadline parameter.

But there is no deadline on the live contract https://etherscan.io/address/0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45#writeContract

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions