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

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

August 8th 2021 5,932 reads
Read on Terminal Reader
Open TLDR
react to story with heart
react to story with light
react to story with boat
react to story with money
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.
image
Tanish Baansal HackerNoon profile picture

Tanish Baansal

Blockchain & Web developer

linkedin social icongithub social icon

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


image

#2. You can import the source contract code using this — 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.


image

#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.


image

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.


image

#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.


image

#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¹⁸.


image

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

image

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.


image

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.


image

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.

react to story with heart
react to story with light
react to story with boat
react to story with money
L O A D I N G
. . . comments & more!