Questions tagged [pancakeswap]

PancakeSwap is a Binance Smart Chain-based DEX launched by anonymous devs with a penchant for breakfast foods and rabbits. It looks a bit like Ethereum's SushiSwap (community governance, the ability to farm liquidity provider tokens), but also incorporates many other features that let you earn rewards.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

get exact input/output amount pancake swap inside my contract

Pancake frontend using below method to get exact input and output amount for swap. public getOutputAmount(inputAmount: TokenAmount): [TokenAmount, Pair] { invariant(this.involvesToken(inputAmount....
0
votes
1answer
29 views

swapExactTokensForTokensSupportingFeeOnTransferTokens swap to BNB even if I set in path WBNB

I have a deployed contract with two basic swap functions. For the "buy" the contract swap WBNB-> Token For the "sell" it use the same function(...
0
votes
1answer
28 views

Wrong balance after swap

It is probably more related to BSC than ETH but it was swapped from ETH though. I made two transactions, one swap ETH for 15k Forever FOMO tokens (didn't check the wallet balance after). Then second ...
0
votes
2answers
81 views

Swap exact ETH for min tokens not accurate?

Just swapped some tokens on an AMM. AMM said minimum I will receive was around 282 tokens, I really recevied around 254 tokens. I had slippage at 12% as the token I was trading takes 10% reflections. ...
0
votes
0answers
72 views

How to sync liquidity pool on Pancakeswap with the BSC Testnet?

I'm using this PCS clone on the testnet: https://pancake.kiemtienonline360.com/#/swap And I'm trying to understand how an elastic token works. I'm looking at Gravitoken (https://bscscan.com/address/...
0
votes
0answers
13 views

Locking liquidity on pancake, trading fees

I want to lock the liquidity tokens (LP), so people trust more my token. My concern: So, when you hold the LP tokens in your wallet, you will get trading fees when people trade in your liquidity pool, ...
0
votes
0answers
5 views

Unable to display APR value while forking Pankcakeswap on testnet

I have Forked PancakeSwap on Bsc Testnet successfully. I have even added the Farm feature which works as well but the only problem is that the APR value doesn't get displayed on the FarmCard. I have ...
0
votes
0answers
14 views

Trying to get buy and sell fee for any BEP20/ERC20

I'm trying to understand how https://honeypot.is/?address=0x317a214777a04576b0287fc8abc98738b27815c8 works. I'll link all info from the BSC checker but is almost the same for ETH They are using a ...
0
votes
0answers
26 views

Uniswap doesn't work with my fee function - looking for some assistance

I'm really stumped on this one, and hoping someone might be able to point out my mistakes. I'm far from experienced with Solidity, but was unable to find any kind of solution online for this specific ...
0
votes
0answers
72 views

Uniswap - Pancakeswap Sdk, Retrive Tokens Route

How can i retrive the Route for two tokens that have not a pair ? The following code uses two tokens that doesn't have a pair on uniswap, and during the execution encouter an error that is reported ...
0
votes
1answer
32 views

Understanding Deployment and contract design for BSC and pancakeswap

I understand that for the Ethereum Mainnet you need to create an ERC20 Token and for BSC you need a BEP20 Token. Let's say I want to create a simple smart contract and deploy it on Pancakeswap. In ...
0
votes
0answers
15 views

How to check if swap was successful?

This is a part of my payable function that is causing a problem. What happens is we receive Eth and swap it to a specific token. It works great in testnet. But on mainnet the "require" check ...
0
votes
1answer
144 views

PancakeSwap's "getAmountsOut" suggests infinite liquidity; UniSwap equivalent works as expected

TDLR: the same code that works with UniSwap is capable of returning an infinite "amountOut" when querying PancakeSwap router function "getAmountsOut". I'm using web3.py to call the ...
0
votes
0answers
11 views

How to test in local, a contract if call an AMM contract?

I'm trying to test a smart contract but i have inside of my contract a call to PancakeSwap and i would like to test it, but i dont find what is the good way to do it: i have to mock router´s contract?...
0
votes
0answers
11 views

Failed tx/swap, 5 UNI in limbo, no Transfer Event Emitted. How to get UNI unstuck?

I attempted to swap 5 UNI for 40something SHI3lD. Tx failed, execution reverted but UNI wasnt sent back. 2nd Tx: 5 UNI for 41SHI3LD was successful. But I thought the 2nd would use the missing 5 UNI ...
0
votes
0answers
25 views

The method 'debug_traceTransaction' does not exist / is not available. Remix in BSC test net

I deployed with Remix a contract on BSC testnet successfully. I have tried to use the remix debugger with a failed transaction (swap in pancakeswap) but I get the following error message in Remix: ...
0
votes
1answer
80 views

swapExactETHForTokens function execution

Please, help me. I try to do swapExactETHForTokens function from PancakeSwap Router contract. It's my code: def swap_exact_eth(router_contract_sample, token_contract, ...
0
votes
0answers
30 views

Why is my transaction Failed - BSC Web3 Python

I tried to execute this code below, It went through but it failed after 20 seconds. https://bscscan.com/tx/0x8da9fbde14a5252a6c8f037ad39fa0db69e77b93990fe7f65d2c305dd208cd99 Can someone Please help me ...
0
votes
0answers
17 views

How can I get this mapping function in an interface? [duplicate]

I have this mapping in a smart contract: mapping (uint256 => mapping (address => UserInfo)) public userInfo; I want to call this in a interface like function view returns: Can someone tell me ...
0
votes
1answer
126 views

Pancake Swap Factory smart contract error

I am using web3js to call PancakeFactory v2 contract (bscscan): contract address: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73 Anytime I want to call any function present in the contract I end up with ...
0
votes
0answers
25 views

Pancakeswap Liquidity error on Testnet

I am trying to add liquidity on pcs testnet. Here is the code snippet: function _addLiquidity() payable public { uint256 _amountToken = balanceOf(address(this))...
0
votes
1answer
30 views

I accidently send unrequited Token to Pancakeswap Pool. My Tokens liquidity stolen

I am an owner of bep20 token and locked the liquidity with mudra locker. I accidentally send token from outside to pancakeswap pair address and 2k dolar WBNB transferred to an unknown wallet. My ...
0
votes
1answer
170 views

What happens when disconnect my wallet from Pancakeswap

Suppose I have a Binance Chain Wallet and I use that to connect to Pancakeswap or similar site to do staking and yield farming. I successfully set up everything and start yield farming. So far so good....
0
votes
2answers
44 views

Send lp tokens to burn address

is there any repo or links where i can learn how to burn lp tokens. If someone added liquidity i want the contract itself to burn the lp tokens instead of sending it to user.
0
votes
0answers
15 views

Addliquidity function

If I want only owner can add liquidity no one else. Is this possible using only owner modifier in addliquidty function or is there any other way?
0
votes
0answers
39 views

How to send bnb programmatically in different scenarios

I am trying to add a price pool in bnb for my token and I did the following code: function swap(uint256 amount, address destination) private { uint256 bnbBalance = address(this).balance; ...
0
votes
1answer
76 views

Way to tackle arbitrage bots

I deployed a token ABC and created a liquidity pool in pancakeswap with pair ABC/BNB. But arbitraged bots attacked and stole a large sum of money. How to stop this and why is this occurring? I think ...
0
votes
1answer
49 views

Setting the value of AmountOutIn

I have been running this small script to buy through the PCS router contract and as it works, the slippage is set to 0. I need to know how to find the value and what it expects so that i can set ...
0
votes
0answers
44 views

SwapExactTokensForETH is called instead of TransferFrom

I developed a smart contract which calls PCS router V2 to get some data, however I don't know what I did to change the way it works and now when I interact with it via PancakeSwap the method called is ...
0
votes
1answer
41 views

What does to way multi approval transaction?

I am going to running swap transactions. At first, we are going to running an approval transaction. And then we are going to running a swap transaction. These repeat. I made the transaction data. ...
0
votes
1answer
30 views

Delegate Call Reverting for Unknown Reason

I'm trying to make a delegatecall to the PancakeSwap Routerv2 from my contract, to perform a swap, but for some reason it's not working. Here's my code: // pancakeswap router address address public ...
0
votes
0answers
28 views

Question about swapExactETHForTokens() in uniswap Router02

Is calling the function on the uniswap router v2 function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external ...
0
votes
0answers
977 views

The transaction cannot succeed due to error: execution reverted: PancakeRouter: INSUFFICIENT_OUTPUT_AMOUNT

Why i cant exchange my fckn tokens on pancakeSwap?
1
vote
1answer
78 views

PancakeSwap charges a fee to mint LP according to their code?

I am looking at the PancakeSwap contract for LP's and I noticed they charge a fee for creating LP's. No where in their documentation does it say there is a fee for depositing liquidity. What is ...
0
votes
0answers
36 views

Tokenomics don't work

I have a problem with the tokenomics of my token. Since yesterday when I tried to increase the auto LP fee, tokenomics are not working on transactions from PCS (burn, redistribution and auto LP). ...
1
vote
0answers
19 views

Uniswap (pair/liquidity) creation in contrat constructor. How is it possible?

Many of the new tokens create pair on Pancakeswap/Uniswap at the token constructor. I understand that the token constructor runs when the contract is created. constructor() public { ...
1
vote
1answer
150 views

How to differentiate AddLiquidity from SwapExactTokensForETH on contract function execution on UniSwap fork

we are trying to process a fee when tokens are "Sold" on PancakeSwap. For now "Sold" is when the user swaps their tokens for BNB. Initially our current logic would also charge a ...
0
votes
0answers
38 views

Adding initial liquidity to a token

We've had a bit of a struggle finding an answer to this question online: When creating a brand new token, and adding initial liquidity to it from the creator address(e.g. 100BNB), should we add that ...
0
votes
0answers
161 views

Unable to remove liquidity using method removeLiquidityETHSupportingFeeOnTransferTokens

I'm trying to deploy a token with transaction fee on Remix, I deployed my own factory and router, and I copied the code of safemoon with some changes with _name, _symbol, _tTotal, _maxTxAmount and ...
0
votes
0answers
36 views

How do I get the token symbol, token name, and size of liquidity pool for a newly minted pair using Node.js and Web3?

//original code courtesy of EatTheBlocks factory.on('PairCreated', async (token0, token1, pairAddress) => { console.log(` New pair detected on PancakeSwap ================= ...
0
votes
0answers
58 views

PancakeSwap Approve error 401

I'm trying to use the contract approve function, but I have this 401 error : events.js:352 throw er; // Unhandled 'error' event ^ Error: Unexpected server response: 401 at ClientRequest. (H:\bot\...
0
votes
0answers
30 views

How to determine current(=pending) Uniswap V2 Pair's price?

Are there any ways to get the current/latest price of an Uniswap Pair (V2)? I've understood that getReserve and getAmountsOut calculates the the return values based on the latest mined block? But for ...
0
votes
0answers
110 views

tx.wait() never resolves using ethers library

I am using ethers library in my nodejs , and trying to call a function in smartcontract which looks like: const tx = await router.swapETHForExactTokens( amountOut, [bnb,...
0
votes
1answer
491 views

Testing Token with Uniswap liquidity provisioning using hardhat

I'm attempting to fork Safemoon (or really NotSafeMoon), and use it as a vehicle to learn smart contract development. (I've got a substantial amount of what you might call "Web 2.0" dev ...
0
votes
0answers
343 views

bot sniping tokens on pancakeswap by watching the mempool

i seen a video on youtube of a sniper bot buying tokens as soon as the token launches on pancakeswap and gets in on the same block. i have tried to use another bot that buys the tokens when the pair ...
1
vote
1answer
198 views

How To Read LP Tokens Held By Address After Being Staked On Pancakeswap

My understanding is that after a user provides liquidity to a farm on pancakeswap they are given a Liquidity Pool token (which is added to their wallet) but once they stake this LP token it is no ...
0
votes
1answer
1k views

How to conduct a flash loan on PancakeSwap?

Apparently it's possible to take a flash loan on PancakeSwap, being that it's a fork of Uniswap. However, I haven't found any examples anywhere of a flash loan on PancakeSwap, nor do the docs mention ...
0
votes
1answer
826 views

Web3 Python token sell pancakeswap

I am trying to sell my tokens via python web3. But sometimes I get an error "execution reverted: Pancake: K". I researched this error and it has to do with the slippage but pancake swap docs ...
0
votes
0answers
22 views

How to create liquidity with code [duplicate]

I'm currently working on a BEP20 token. I am trying to figure out this whole liquidity thing works. I know that you can add liquidity manually in the Pancake swap. I'm wondering is there a way to do ...
0
votes
0answers
111 views

Error 'ds-math-sub-underflow' when trying to use pancakeswap router contract

I'm coding a simple app in node.js to retrieve token prices. I am using router contract '0x10ED43C718714eb63d5aA57B78B54704E256024E' and ethers.js library Most addresses seem to work correctly, but ...