paint-brush
Create a BEP-20 token on BSC With Remix: A Step-By-Step Guideby@tanishbaansal
10,438 reads
10,438 reads

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

by Tanish BaansalAugust 8th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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.

Company Mentioned

Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Create a BEP-20 token on BSC With Remix: A Step-By-Step Guide
Tanish Baansal HackerNoon profile picture

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.