Can't add liquidity on PancakeSwap with burnable ERC20 token

@LSparkzwz I can assist with this.
I deployed a similar contract to SafeMoon and was able to create liquidity.

This assumes you have the SafeMoon tokens in your Wallet along with some BNB.

Step 1. Approval

First navigate to your contract’s “Write Contract” tab. I’ll use SafeMoon’s contract as an example. https://bscscan.com/token/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#writeContract

Connect to Web3

Using function 1. Approve, you are going to Approve the amount to allow Pancake Swap to spend for you.

spender (address) = Pancake Swap’s Router Address, for our example it will be 0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F for the live address.

amount (uint256) = The amount of token required. You will need to do some math to figure out what amount this needs to be. If you have 9 decimals, then to add 100 tokens, you would multiply 100 x 10^9 to get the amount you need to input here, 100,000,000,000.

Consult the screen shot below for guidance.

After making sure your parameters are correct, click Write

Then confirm if the transaction is valid.

Step 2. Create the LP Pair on Pancake Swap

Navigate to https://bscscan.com/address/0x05fF2B0DB69458A0750badebc4f9e13aDd608C7F

Which is the Router Address for Pancake Swap.

Go to the Contract tab.

Connect to Web3

Assuming you are starting a brand new LP token, you will use function 2 “addLiquidityETH” and fill out the below functions.

addLiquidityETH = The amount of BNB you want to use when creating the LP.

token (address) = Your token’s contract address. If using a proxy, use the proxy address, not the implementation. We will use SafeMoon’s address as an example. 0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3

amountTokenDesired (uint256) = The amount of token required as done in the Approval step. 100,000,000,000.

amountTokenMin (uint256) = This should be the same as above. 100,000,000,000.

amountETHMin (uint256) = This should be the same as your input amount in addLiquidityETH.

to (address) = The address you want to send your LP tokens to, in general this will be your wallet.

deadline (uint256) = This is how long it should take for the transaction to take as a UnixTime stamp. If the transaction’s deadline hits, then it will revert. I normally give it a day. I create my UnixTime stamp from https://www.unixtimestamp.com/ see the below screenshot for guidance. The example timestamp I will use is 1619341416

See the below screenshot for guidance on using this function.

After making sure your parameters are correct, click Write

Then confirm if the transaction is valid.

NOTE - You can test this!

You can do this using BSC’s test net using Pancake’s Test Router Address, 0xD99D1c33F9fC3444f8101754aBC46c52416550D1.

You can also do this in for Uniswap on any testnet, I prefer Rinkeby. The Uniswap Test Router Address is 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, but you should verify with the actual Uniswap documentation that this is still true.

I hope this helps and it works, if it doesn’t then post screen shots with what the error says, and include your contract you are trying to do this with.

5 Likes