pancake-swap-interface-v1 icon indicating copy to clipboard operation
pancake-swap-interface-v1 copied to clipboard

Can't provide initial liquidity on Bscscan testnet

Open kdeasymoneysniper opened this issue 3 years ago • 35 comments

I have created a token on the bsc testnet, and have also created a liquidity pool. I am trying to provide initial liquidity but an error is shown whenever I try to do so.

The error message is below.

code: -32603, message: "Internal JSON-RPC error." data: { code: 32000, message: "gas required exceeds allowance (29885420) or always failing transaction" }

I have already called the 'initialise' method with the two tokens shown below, and have tried providing liquidity based on those two tokens, am I missing out on some steps?

I am using the pancake-swap-interface https://github.com/pancakeswap/pancake-swap-interface

For the tokens, I copied the token from https://github.com/goosedefi/goose-contracts/blob/master/contracts/EggToken.sol

My token address: 0xA6dE8E037201c6Ff9ff58e7fB72fE1Dbd15D1888 My psuedo BUSD address (copied from real BUSD): 0xA9bcCacD1D3f2EE7CA525f59c779F8c716965978 My LP token address: 0xb513219b46307eDDcaeFd1Aac99EB16394746B28

Thank you all! Also, I'm new to blockchain development hence if there are any resources on how to properly create a yield farming token, that would be great too, thanks all!

kdeasymoneysniper avatar Mar 25 '21 01:03 kdeasymoneysniper

Right, i have the same problem. Do you have pancakeswap on bsc testnet?

OnerooDev avatar Mar 26 '21 16:03 OnerooDev

Same problem here. Any thoughts?

mcoelho80 avatar Apr 07 '21 15:04 mcoelho80

How did you deployed the LP contract on the Testnet, from where did you get the source code?

redigaffi avatar Apr 10 '21 20:04 redigaffi

I got the same problem, so I tried to clone pancake-swap-interface and adapt to new router address + abi, then it's worked.

nguyenphu27 avatar Apr 11 '21 08:04 nguyenphu27

I have same issue but I've also replaces router and factory contracts + INIT_HASH_CODE but still getting the error above you can check it here https://swap.extraffix.com

H1l4nd0r avatar Apr 19 '21 11:04 H1l4nd0r

You don't need to replace init_code_hash, just update the router, weth and factory address. Make sure your changes to be reflected. Update them in the pancakeswap-libs/sdk

nguyenphu27 avatar Apr 20 '21 14:04 nguyenphu27

You don't need to replace init_code_hash, just update the router, weth and factory address. Make sure your changes to be reflected. Update them in the pancakeswap-libs/sdk

Why do I need another copy of WETH? I see no code inside it depending on router or factory? do you mean all of them should be deployed on same owner address?

H1l4nd0r avatar Apr 24 '21 13:04 H1l4nd0r

I got the same problem, so I tried to clone pancake-swap-interface and adapt to new router address + abi, then it's worked.

What do you mean by 'router address + abi' I mean what abi data have you updated? I tried to update router and factory

H1l4nd0r avatar Apr 24 '21 13:04 H1l4nd0r

Same problem here.

TheRealKonxx avatar Apr 24 '21 18:04 TheRealKonxx

"Update them in the pancakeswap-libs/sdk" >> As I said before. You just need clone this sdk, replace these addresses, then publish to your npm, replace "pancakeswap-libs/sdk" package in pancake-swap-interface by your package that you just pushed.

PancakeRouter: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1 WETH: 0xae13d989dac2f0debff460ac112a837c89baa7cd Factory: 0x6725f303b657a9451d8ba641348b6761a6cc7a17

nguyenphu27 avatar Apr 25 '21 16:04 nguyenphu27

Well. I did as you said

copied old pancake front (now it is updated with some migration) redeployed own factory router and weth replaced in pancake front copy ROUTER and FACTORY but I didn't find where i Can replace WET but still get that error (see on attached picture)

What is left to do?

On Sun, Apr 25, 2021 at 7:08 PM Phu Nguyen @.***> wrote:

"Update them in the pancakeswap-libs/sdk" >> As I said before. You just need clone this sdk, replace these addresses, then publish to your npm, replace "pancakeswap-libs/sdk" package in pancake-swap-interface by your package that you just pushed.

PancakeRouter: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1 WETH: 0xae13d989dac2f0debff460ac112a837c89baa7cd Factory: 0x6725f303b657a9451d8ba641348b6761a6cc7a17

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pancakeswap/pancake-swap-interface-v1/issues/304#issuecomment-826348352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQDOVSPHAUCEVI3H3AAFQDTKQ467ANCNFSM4ZYM75QQ .

H1l4nd0r avatar Apr 25 '21 16:04 H1l4nd0r

"Update them in the pancakeswap-libs/sdk" >> As I said before. You just need clone this sdk, replace these addresses, then publish to your npm, replace "pancakeswap-libs/sdk" package in pancake-swap-interface by your package that you just pushed.

PancakeRouter: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1 WETH: 0xae13d989dac2f0debff460ac112a837c89baa7cd Factory: 0x6725f303b657a9451d8ba641348b6761a6cc7a17

and yes a replaced it in pancakeswap-libs/sdk (FACTORY) and ROUTE in front part

H1l4nd0r avatar Apr 25 '21 16:04 H1l4nd0r

Mine Are ROuter: 0xDDb822FF1e75444b9cabCB1bB643F7Ab25ebeaD7 WETH: 0xBB10034EC64C4Cd2F5DcA63c94a64d966E33A10F Factory: 0x6Fe6392C248595f73f3271218a3610428604Bd46

But I didn't find where to replace WETH because it is passed to router on deployment so it is already there.

H1l4nd0r avatar Apr 25 '21 16:04 H1l4nd0r

"Update them in the pancakeswap-libs/sdk" >> As I said before. You just need clone this sdk, replace these addresses, then publish to your npm, replace "pancakeswap-libs/sdk" package in pancake-swap-interface by your package that you just pushed.

PancakeRouter: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1 WETH: 0xae13d989dac2f0debff460ac112a837c89baa7cd Factory: 0x6725f303b657a9451d8ba641348b6761a6cc7a17

Can we have a talk somewhere else? telegram or email? mine is [email protected]

H1l4nd0r avatar Apr 25 '21 16:04 H1l4nd0r

I changed tetstnet WETH constract address here but it didn't help (@pancakeswap-libs/sdk/dist/sdk.cjs.development.js etc) var WETH = (_WETH = {}, _WETH[exports.ChainId.MAINNET] = /#PURE/new Token(exports.ChainId.MAINNET, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'), _WETH[exports.ChainId.BSCTESTNET] = /#PURE/new Token(exports.ChainId.BSCTESTNET, '0xBB10034EC64C4Cd2F5DcA63c94a64d966E33A10F', 18, 'WBNB', 'Wrapped BNB'), _WETH);

H1l4nd0r avatar Apr 25 '21 23:04 H1l4nd0r

[email protected]

Do you have telegram id , Can we discuss the issue - It appears to be that we are having the same problem - Help is appreciated!

skumar2030 avatar Apr 26 '21 00:04 skumar2030

Same problem here. Any thoughts?

Is this resolved now? We are facing the similar problem!

skumar2030 avatar Apr 26 '21 00:04 skumar2030

ROuter: 0xDDb822FF1e75444b9cabCB1bB643F7Ab25ebeaD7

@H1l4nd0r are you sure this is PancakeRouter address on bsc testnet? https://testnet.bscscan.com/token/0xDDb822FF1e75444b9cabCB1bB643F7Ab25ebeaD7 ??

nguyenphu27 avatar Apr 26 '21 10:04 nguyenphu27

ROuter: 0xDDb822FF1e75444b9cabCB1bB643F7Ab25ebeaD7

@H1l4nd0r are you sure this is PancakeRouter address on bsc testnet? https://testnet.bscscan.com/token/0xDDb822FF1e75444b9cabCB1bB643F7Ab25ebeaD7 ??

Oh sorry I misspelled the address The right one is 0x6EF53411545BeC56998AeE35F39406472ec2FeD0

H1l4nd0r avatar Apr 27 '21 21:04 H1l4nd0r

[email protected]

Do you have telegram id , Can we discuss the issue - It appears to be that we are having the same problem - Help is appreciated!

yeah @h1l4nd0r

H1l4nd0r avatar Apr 27 '21 21:04 H1l4nd0r

yeah my telegram @devsolidity

BlockCrafterX avatar Apr 27 '21 23:04 BlockCrafterX

I got the same problem, so I tried to clone pancake-swap-interface and adapt to new router address + abi, then it's worked.

where did you update the abi?

kaiffeetasse avatar Apr 29 '21 20:04 kaiffeetasse

Hi, since the pancakeswap router upgraded to V2, below is summary what I did to clone it on testnet:

  1. Deploy PancakeFactoryV2.sol contract, update feeTo and feeToSetter address
  2. Copy created INIT_CODE_PAIR_HASH and update to "library PancakeLibrary" of PancakeRouterV2.sol
  3. Deploy PancakeRouterV2 contract with new Factory address and WETH address (0xae13d989dac2f0debff460ac112a837c89baa7cd)
  4. Clone pancakeswap-libs/sdk and replace WETH, INIT_CODE_HASH to new address
  5. Clone pancake-swap-interface and replace router, factory address
  6. That's it. I checked the PancakeRouterV2 contract and see that they just update the function code, there is no any new function, so we don't need to update the ABI. The old ABI still working as normal.

nguyenphu27 avatar Apr 30 '21 04:04 nguyenphu27

Hi, since the pancakeswap router upgraded to V2, below is sumary what I did to clone it on testnet:

  1. Deploy PancakeFactoryV2.sol contract, update feeTo and feeToSetter address
  2. Copy created INIT_CODE_PAIR_HASH and update to "library PancakeLibrary" of PancakeRouterV2.sol
  3. Deploy PancakeRouterV2 contract with new Factory address and WETH address (0xae13d989dac2f0debff460ac112a837c89baa7cd)
  4. Clone pancakeswap-libs/sdk and replace WETH, INIT_CODE_HASH to new address
  5. Clone pancake-swap-interface and replace router, factory address
  6. That's it. I checked the PancakeRouterV2 contract and see that they just update the function code, there is no any new function, so we don't need to update the ABI. The old ABI still working as normal.

Were you able to add initial liquidity successfully afterwards?

mahamzaidi avatar Apr 30 '21 05:04 mahamzaidi

Yes, add initial liquidity, swap, remove,... Everything works well

nguyenphu27 avatar Apr 30 '21 06:04 nguyenphu27

Yes, add initial liquidity, swap, remove,... Everything works well

And you used pancakeswap-sdk-v2 right? or the old one

mahamzaidi avatar Apr 30 '21 06:04 mahamzaidi

@nguyenphu27 which git branch can use to on test network?

0xwhatly avatar Apr 30 '21 07:04 0xwhatly

Hi, since the pancakeswap router upgraded to V2, below is summary what I did to clone it on testnet:

  1. Deploy PancakeFactoryV2.sol contract, update feeTo and feeToSetter address
  2. Copy created INIT_CODE_PAIR_HASH and update to "library PancakeLibrary" of PancakeRouterV2.sol
  3. Deploy PancakeRouterV2 contract with new Factory address and WETH address (0xae13d989dac2f0debff460ac112a837c89baa7cd)
  4. Clone pancakeswap-libs/sdk and replace WETH, INIT_CODE_HASH to new address
  5. Clone pancake-swap-interface and replace router, factory address
  6. That's it. I checked the PancakeRouterV2 contract and see that they just update the function code, there is no any new function, so we don't need to update the ABI. The old ABI still working as normal.

Can you share repository with this changes? 🙏

OnerooDev avatar Apr 30 '21 07:04 OnerooDev

I have same issue but I've also replaces router and factory contracts + INIT_HASH_CODE but still getting the error above you can check it here https://swap.extraffix.com

It is saying me you cannot add liqduity in v1, please tell me how you do this.

AliWisam avatar Apr 30 '21 21:04 AliWisam

Hi, since the pancakeswap router upgraded to V2, below is summary what I did to clone it on testnet:

  1. Deploy PancakeFactoryV2.sol contract, update feeTo and feeToSetter address
  2. Copy created INIT_CODE_PAIR_HASH and update to "library PancakeLibrary" of PancakeRouterV2.sol
  3. Deploy PancakeRouterV2 contract with new Factory address and WETH address (0xae13d989dac2f0debff460ac112a837c89baa7cd)
  4. Clone pancakeswap-libs/sdk and replace WETH, INIT_CODE_HASH to new address
  5. Clone pancake-swap-interface and replace router, factory address
  6. That's it. I checked the PancakeRouterV2 contract and see that they just update the function code, there is no any new function, so we don't need to update the ABI. The old ABI still working as normal.

You point here INIT_CODE_PAIR_HASH in pt2 and INIT_CODE_HASH in pt4 INIT_CODE_PAIR_HASH is from factory contract but where is from INIT_CODE_HASH?

H1l4nd0r avatar May 01 '21 07:05 H1l4nd0r