0

Here is the error message.

Fail with error 'PancakeRouter: EXPIRED'

Here is the transaction details

I suspect its because of the deadline attribute? I have no clue on how to do a block.timestamp , so I try to time it by checking when is the "nearest" blocktime from https://testnet.bscscan.com/block/countdown/

Does anyone know why im getting this error, and is there a way to fix it?

2

Yes, I believe this problem is due to the deadline parameter of the addLiquidity method.

In your tx you have submitted a deadline of 7741799 which corresponds (https://www.epochconverter.com/) to Tuesday, March 31, 1970 2:29:59 PM

You can go to the pancakeswap router contract (https://testnet.bscscan.com/address/0xd99d1c33f9fc3444f8101754abc46c52416550d1) and successful transactions that use this method, such as https://testnet.bscscan.com/tx/0x6b5f2c486dcfb6f2c40410242e8e63360d2b374a13545e2cda70063e7c444e5f.

In this tx you see the deadline is 1672491599 corresponding to Saturday, December 31, 2022 12:59:59 PM which ahead of the time when this transaction was processed.

7
  • 1
    Hey man thanks for the comment, I changed the deadline but im having another error: TRANSFER_FROM_FAILED , do you have any idea what might be wrong here?
    – neowenshun
    May 26 at 14:14
  • did you find any solutions?
    – Burak
    May 28 at 4:12
  • @Burak unfortunately, not yet, do you have any clue?
    – neowenshun
    May 28 at 16:51
  • @neowenshun, in order to solve TRANSFER_FROM_FAILED I had to approve the amount I want to use from my contract. In the approve function, use the router's address and your desired amount. After, I used addLiquidityETH from the router's contact and it worked like a charm!
    – Burak
    May 28 at 17:47
  • That's weird, i tried this as well but it still does not work. It clearly says from the allowance method that i had granted the router the desired amount to spend
    – neowenshun
    May 30 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.