Create a BEP-20 token on BSC With Remix: A Step-By-Step Guide

Written by tanishbaansal | Published 2021/08/08
Tech Story Tags: blockchain | solidity | programming | solidity-top-story | binance-smart-chain | binance-smart-chain-v-ethereum | how-to-make-a-bsc-token | how-to-make-a-bep20-token-bsc

TLDR BSC is relatively a lot faster and cheaper to use and that’s what we need. We will create and deploy a very basic and simple BEP20 token to the BSC testnet using Remix and MetaMask. We need some testnet BNB to pay for gas during contract creation which we can get from here — faucet (Just paste in your metamask generated BSC wallet address there) You can find your token address on the testnet too. You can use the same steps to deploy your token on Binance mainnet.via the TL;DR App

BEP20 is the Binance Smart Chain equivalent to the popular ERC20 specification for tokens on the Ethereum network. Compared to the Ethereum network BSC is relatively a lot faster and cheaper to use and that’s what we need.

We will create and deploy a very basic and simple BEP20 token to the BSC testnet using Remix and MetaMask.

Token Details:

Name: Legendary Token

Symbol: LGT

Total Supply: 1 million LGT

You can view the smart contract here

Pre-Requisite on how to install and connect metamask to BSC testnet

Let’s Create The Token:

#1. Open Remix IDE: https://remix.ethereum.org

#2. You can import the source contract code using this — Gist Link and paste this URL in load From Gist on remix main page or you can create a new file called Legendary.sol and add the code from Github.

#3. Compile it! Press Ctrl + S keys to compile the code. Also, you can navigate to the compilation page by clicking the second option on the navigation panel. Code’s solidity version is 0.8.4 as specified in the 3rd line of the code using pragma solidity, so we need to choose 0.8.4 as the compiler version too.

#4. Let’s Deploy It! now let’s deploy the code on the bsc testnet using metamask. Click on the 3rd icon and then select injected web3 as the ENVIRONMENT as we are using metamask to deploy.

Also, make sure that you have selected the LegendaryToken contract in the CONTRACT dropdown (above the Deploy button). We need some testnet BNB to pay for gas during contract creation which we can get from here — faucet (Just paste in your metamask generated BSC wallet address there).

Now Let’s deploy LGT token, just hit that deploy button and click confirm on the metamask popup for confirmation.

#5. Wait for few seconds, till our transaction is mined. Then we can see the logs, as well as the contract details under the Deployed Contracts section.

#6. Under Deployed Contract, click on the LEGENDARYTOKEN option and see the public methods and variables, with which we can test our deployment, so you don't need any external software to interact with your token. Let’s check our LGT token balance. Note: The value displayed is in 18 precision, which is 1M * 10¹⁸.

#7. You can find your token on the BSC testnet too, just copy your token address using the copy button

and then go to https://testnet.bscscan.com/token/(you token contract address) for example LegendaryToken.

#8. Let’s try transferring tokens to other addresses using the transfer method. Enter recipient address in _to field and enter (number of token * 10**18) in the _value field then click on transfer (or transact) button and confirm it on metamask popup. For example, let's send 1000 LGT Token.

In a few seconds, the transaction status can be seen on the Remix IDE logs. We can check the transaction status on BSCScan Testnet explorer as well using the transaction hash.

If you want you can use the same steps to deploy your token on Binance mainnet too, just change from Binance testnet to Binance mainnet in metamask and your token will be deployed to the mainnet (Real BNB need to be paid for contract creation though ✌️)

🥳 Voila now your legendary token is on Binance smart chain network.


Written by tanishbaansal | Blockchain & Full Stack Developer | Web3 Developer
Published by HackerNoon on 2021/08/08