The Fastest Way to Get Your BEP20 token onto PancakeSwap

TechJD
3 min readMar 28, 2022

Sometimes, you just want to go fast. I can help you get your token onto PancakeSwap today using Remix.

Go to remix.ethereum.org. Select Solidity. In the file explorer on the left-hand side, select the “New file” icon and create file <FILENAME>.sol

At the top of the file, include a comment regarding the licensing. For example:

// SPDX-License-Identifier: GPL-3.0

Below that specify the Solidity version, like so:

pragma solidity ^0.8.0;

Now include the import statement. In this case, we only need one:

import “@openzeppelin/contracts/token/ERC20/ERC20.sol”;

BEP20 Tokens are extensions of the ERC20 token. The difference is that they run on the Binance Smart Chain Network (BSC). More on this in a moment.

Add the following code:

contract Token is ERC20 {constructor(uint256 initialSupply) public ERC20 (“YOUR_TOKEN_NAME”, YOUR_SYMBOL”) {_mint(msg.sender, initialSupply);}}

Select the blue compile button. Once the contract is compiled successfully, go to the Deploy tab. Choose your test environment. To test on the Binance Test Network, you need to make sure that your wallet is connected to the test network. I recommend using Metamask as a chrome extension. Go to https://chainlist.org/ and select ‘Connect Wallet.’ Then make sure the Testnet toggle is switched on. Search ‘Binance’ and select the test network.

Next, you need to get test BNB in order to pay the gas fees required to deploy your contract. Go to https://testnet.binance.org/faucet-smart and input your Wallet address.

Copy and paste that wallet address and select ‘Give me BNB’. Your balance should update almost instantly.

Now return to Remix, and in the Environments dropdown in the Deploy tab, select Injected Web3. This will link to your Metamask. The account address and balance should be the same as what’s in your Metamask.

You should see an orange ‘Deploy’ button. Beside it, input the number of tokens you want to mint(your totalSupply) in WEI. NOTE: 1 ETH = 1018 wei. So, if you want 100 tokens, you must input 100000000000000000000. Once you press Deploy, Metamask should open again and ask you to accept the transaction and pay the gas fee. It will take a moment, but when the transaction is successful, you will be able to view it on BSCScan. Example here: https://testnet.bscscan.com/token/0xeff9938385863e01302415846f29067458525791

Our SONIC token has a supply of 100. It’s token address is: 0xEFf9938385863E01302415846F29067458525791

If you import the above address into your Metamask wallet, the token will then appear in your wallet. NOTE: Even if you don’t do this, your tokens still exist in your wallet, Metamask just doesn’t show them.

PART 2: LIST ON PANCAKESWAP

NOTE: In order to be able to list your token on pancakeswap, it must be a real token, not a test token. So, repeat the steps in Part 1, but on the BSC Mainnet.

Go to https://pancakeswap.finance/. Select Trade > Liquidity

Copy and paste your token address and select it. Then, decide which token you would like to pair it with (BNB, for example). Next, decide the price. (1 BNB = x SONIC).

For example, if you decide that 1 BNB = 100 SONIC, you will then be prompted to supply 1 BNB and 100 SONIC to the liquidity pool.

You’re done! If you made it this far, congratulations! But if you still need help, follow along with my video tutorial here.

--

--

TechJD

Law, programming, and everything in-between! Coming up with fun coding projects with real-world application.