pancake-swap-interface-v1
pancake-swap-interface-v1 copied to clipboard
PancakeSwap on Testnet with some liquidity using token from testnet faucet
Problem encountered :
When trying to develop protocol and apps using BSC it's blocking to don't be able to test some various swap though PCS in testnet. Uniswap seem like to support testnet swap already. There's always the solution to fork ourself PCS front-end and contracts on testnet but this is an individual version and it's more complicated to get more affinated data when we are alone on our testnet interface... There are already a Testnet PCS provided by the community but they or don't work, are dead, or just don't have liquidity at all... In short there's no viable solution for now...
Exemple : https://kiemtienonline360.github.io/bsc-swap-simulation/pancake/#/swap
Feature request :
Even if the testnet doesn't bring value to the PCS dev team. It could be really helpful to consider implementing PCS ecosystem (At least the swap/liquidity feature) to the BSC Testnet and provide liquidity to it ! 👍 The default liquidity should use the tokens from this official faucet and adopt them as a standard for BSC Testnet : https://testnet.binance.org/faucet-smart
More info about the situation :
The solution to fork the mainnet on a localnet doesn't seem like to work by using ganache-cli. Connecting the wallet in testnet on mainnet PCS Swap Application work but after you can't provide liquidity yourself or swap.
agree with the above.
Connecting the wallet in testnet on mainnet PCS Swap Application work but after you can't provide liquidity yourself or swap.
Had this same issue. Also tried running pancake swap on my local machine from the source code. But cannot run the version 2 stuff as all the V2 links redirect to the public internet. And the V1 stuff does not allow adding liquidity.
Also I can't find in the source-code where to put the address of the pancake swap router for binance testnet. Maybe i'm not looking hard enough but I would have thought this should live in the .env.development file.
Edit: ah, found in another comment router address is in the pancake-swap-interface-v1-master\src\constants\index.ts file.
well, if anyone else is facing this issue, you have to reverse the changes from this check-in to be able to test on testnet. That is until pancake-swap makes v2 available on github I presume.
https://github.com/pancakeswap/pancake-swap-interface-v1/pull/390/files/17f9b3102f44ab312c4e29805d9638bf6b364f08
The router address to put in this file (pancake-swap-interface-v1-master\src\constants\index.ts) for testnet is: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
.env file can contain the following:
REACT_APP_NETWORK_URL="https://data-seed-prebsc-1-s1.binance.org:8545" REACT_APP_CHAIN_ID="97" REACT_APP_GTAG = "GTM-PXLD3XW"
Edit: actually above still does not work. All I succeeded in doing was to create the liquidity pool and add liquidity to it. The swap & liquidity screens still can't find the pool after that pool is created. I've tried updating the WBNB address in the pancake code to it's testnet address (0xae13d989dac2f0debff460ac112a837c89baa7cd) where I could find it, as I was thinking the reason it can't find the pair after creation is because it is passing the wrong WBNB address into the function that generates the pair address. But I couldn't get that to work either.
Currently i'm trying this test version that someone deployed. https://kiemtienonline360.github.io/ It's router address is at 0x9ac64cc6e4415144c455bd8e4837fea55603e5c3.
~~hi @DaManJ , how did you "create the liquidity pool and add liquidity to it"?~~
simply call addLiquidityETH
, pool will be auto-created if not existed yet
Did you manage to withdraw liquidity? Removing liquidity gives me a ds-math-sub-underflow'
error similar to this:
Pancakeswap Router: https://testnet.bscscan.com/tx/0x116536e075875c04223b0bf88247dc7c693f1323d4f5542e4a4e6972673d7159
Router that was posted above (0x9ac64.....): https://testnet.bscscan.com/tx/0x6f7400e899b3e14532cfc31e0e7878809f701ead9cceaf430a2890145d6df438
We've managed to run PancakeSwap testnet. Here's a source code
https://github.com/neptune-mutual/pancakeswap-testnet
and the hosted version
https://pancake-test.pages.dev/
I managed to add liquidity for my token on the test net using the link above. However once i receive the lp tokens, pancakeswap cannot see the liquidity pool so I cannot unstake
I managed to add liquidity for my token on the test net using the link above. However once i receive the lp tokens, pancakeswap cannot see the liquidity pool so I cannot unstake
yes same problem
https://pancake.kiemtienonline360.com try this , this works fine
Hey @kowsikgelli, How did you solve it? Thanks in advance
https://pancake.kiemtienonline360.com try this , this works fine
Is there a reason it's using 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
contract as a router address instead of the 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
?
https://pancake.kiemtienonline360.com
can I get its setup detail and github?
Is there pancakeswap for testnet because there is no need for a platform to demo and test, if while developing and testing on main, the fee is too expensive, many times deploy
We've managed to run PancakeSwap testnet. Here's a source code
https://github.com/neptune-mutual/pancakeswap-testnet
and the hosted version
https://pancake-test.pages.dev/
Lifesaver!
Hi, @safezerolife I've created a test token TFT2 0x0531d452343ce449d570999ea339cb906844800a and added liquidity pool on https://pancake.kiemtienonline360.com for the full amount of token to 1BNB however, when I try to swap some BNB with it via a different Wallet it only says "The transaction cannot succeed due to error: undefined. This is probably an issue with one of the tokens you are swapping."
Would you know what this could be causing?
@newcreativegamer - what Router address are you using for https://pancake-test.pages.dev/ ?
@Tim5123 have you tried to increase the slippage? (That's the first answer that google gives me)
Thanks @derekzx . yes I did increase the slippage to 11%. I guess I wanted to receive too much. Lower amount had worked. Now I'm wondering why the LP is not increasing or decreasing. Shouldn't it move down by the amount which someone has swapped for my token and move up for the bought amount on BNB?
Hi, @safezerolife I've created a test token TFT2 0x0531d452343ce449d570999ea339cb906844800a and added liquidity pool on https://pancake.kiemtienonline360.com for the full amount of token to 1BNB however, when I try to swap some BNB with it via a different Wallet it only says "The transaction cannot succeed due to error: undefined. This is probably an issue with one of the tokens you are swapping."
Would you know what this could be causing?
@newcreativegamer - what Router address are you using for https://pancake-test.pages.dev/ ?
Yeah, I encountered that issue and fixed it by using the other one posted: https://pancake.kiemtienonline360.com/#/swap and updating the router address to the one in their docs: https://bsc.kiemtienonline360.com/ 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
Hello,
Could someone give me please a hint, I'm trying to provide liquidity and it does not work:
I've used in my code this router 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3 and to create the pair, I've used the 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd WBNB (based on https://bsc.kiemtienonline360.com/), there is something I just don't get
Hello, Could someone give me please a hint, I'm trying to provide liquidity and it does not work:
I've used in my code this router 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3 and to create the pair, I've used the 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd WBNB (based on https://bsc.kiemtienonline360.com/), there is something I just don't get
I also hit this one. Did you approve the router address? Approve it for your full supply first. Don't forget to include the number of zero's equal to your decimal places when approving.
I just did, but the result is the same :(
use Tenderly to debug your transactions (google it)
use Tenderly to debug your transactions (google it)
I did'nt know, great, thanks a lot for the tip
well, if anyone else is facing this issue, you have to reverse the changes from this check-in to be able to test on testnet. That is until pancake-swap makes v2 available on github I presume.
https://github.com/pancakeswap/pancake-swap-interface-v1/pull/390/files/17f9b3102f44ab312c4e29805d9638bf6b364f08
The router address to put in this file (pancake-swap-interface-v1-master\src\constants\index.ts) for testnet is: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
.env file can contain the following:
REACT_APP_NETWORK_URL="https://data-seed-prebsc-1-s1.binance.org:8545" REACT_APP_CHAIN_ID="97" REACT_APP_GTAG = "GTM-PXLD3XW"
Edit: actually above still does not work. All I succeeded in doing was to create the liquidity pool and add liquidity to it. The swap & liquidity screens still can't find the pool after that pool is created. I've tried updating the WBNB address in the pancake code to it's testnet address (0xae13d989dac2f0debff460ac112a837c89baa7cd) where I could find it, as I was thinking the reason it can't find the pair after creation is because it is passing the wrong WBNB address into the function that generates the pair address. But I couldn't get that to work either.
Currently i'm trying this test version that someone deployed. https://kiemtienonline360.github.io/ It's router address is at 0x9ac64cc6e4415144c455bd8e4837fea55603e5c3.
You have to do these things.
- clone https://www.npmjs.com/package/@pancakeswap-libs/sdk
- change WETH address and factory
- cahnge WETH here entities -> token.ts
- cahnge FACTORY_ADDRESS and INIT_CODE_HASH here constants.ts file
- npm run build
- install local lib to pancakeswap frontend
0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
I am using this router address in my token code 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3 . I still get this undefined error at the website https://pancake.kiemtienonline360.com/#/swap . I am using the standard testnet address from the binance website. https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain
or do i need to use another testnet? am i doin something wrong?
thx
i tried to use now bakery testnet pancakeswap from this website https://bsc.kiemtienonline360.com/
Now I am getting this error
edit
I was able to get the error message away because of Caps/lowcase mistakes
now I am still getting this message while deploying...
@newcreativegamer @derekzx do you also have issues removing liquidity from your own liquidity pool?
For me its always failing. Getting until the "Confirm" button shows up and then when clicking it nothing happens. Checked the Chrome Developer Extension and it shows below
- estimateGas failed 1 removeLiquidityETHWithPermitSupportingFeeOnTransferTokens
-
- "execution reverted: Pancake: TRANSFER_FAILED"
- estimateGas failed 0 removeLiquidityETHWithPermit
-
- "execution reverted: Pancake: TRANSFER_FAILED"
- This transaction would fail. Please contact support.
i tried to use now bakery testnet pancakeswap from this website https://bsc.kiemtienonline360.com/ Now I am getting this error
edit I was able to get the error message away because of Caps/lowcase mistakes now I am still getting this message while deploying...
What happens if you hit "Send Transaction"? Did you try to set the "Slippage tolerance" higher on the Swap settings? like 12 or 13%?
You have to do these things.
clone https://www.npmjs.com/package/@pancakeswap-libs/sdk
change WETH address and factory
- cahnge WETH here entities -> token.ts
- cahnge FACTORY_ADDRESS and INIT_CODE_HASH here constants.ts file
npm run build
install local lib to pancakeswap frontend
For anyone interested, loosely based on the instructions from @vtn-dev2016, I forked pancake-swap-interface-v1
as well as pancakeswap-sdk-v2
and modified both to be able to work with any testnet v2 router (the v1/v2 interfaces aren't really that different).
~~I'm probably going to host an online instance~~ hosted an online instace against the 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
router at https://pancakeswap.ibhagwan.workers.dev. You can also build it yourself with detailed instructions in my repo.
If you clone both my repos you can avoid any editing and work right away with the 0xD99D1c33F9fC3444f8101754aBC46c52416550D1
router, unfortuntely it doesn't have much liquidity, I tested adding liquidity and it works, you're welcome to add more so we can have a proper testnet environment.
Alternatively the 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3
already has some decent liquidity pools, you can edit the files as per my instructions (very easy) to work with this router instead or use https://pancake.kiemtienonline360.com directly.
EDIT: added published instance at https://pancakeswap.ibhagwan.workers.dev
We've managed to run PancakeSwap testnet. Here's a source code
https://github.com/neptune-mutual/pancakeswap-testnet
and the hosted version
https://pancake-test.pages.dev/
Hey. Do I need to change my IUniswapV2Router02 address to add liquidity? Because when I paste my token address nothings happens.
We've managed to run PancakeSwap testnet. Here's a source code https://github.com/neptune-mutual/pancakeswap-testnet and the hosted version https://pancake-test.pages.dev/
Hey. Do I need to change my IUniswapV2Router02 address to add liquidity? Because when I paste my token address nothings happens.
Can you try https://pancakeswap.ibhagwan.workers.dev and let me know if it works for you?