How to Create a BEP20 Token | QuickNode (2024)

5 min read

Overview

BEP20 is the BNB Smart Chain equivalent to the popular ERC20 specification for tokens on the Ethereum network. The difference is the BEP20 Token isn't run on the Ethereum Network, but the BNB Smart Chain network. Despite this difference, because BSC (BNB Smart Chain) implements the Ethereum Virtual Machine (EVM) for all of their smart contracts, they end up being practically identical in both specification and implementation. This guide will walk you through how to create your very own BEP20 Token.

Prerequisites:

  • MetaMask browser extenstion
  • Familiarity with Remix IDE

The first thing you will want to do for this new project is set up the BSC Testnet with your MetaMask wallet.

You can do this by opening up MetaMask, clicking on the networks tab, and clicking on "Custom RPC". To configure your wallet to connect to the BSC Testnet, you will fill out the forms like the picture below.

How to Create a BEP20 Token | QuickNode (1)

With that setup, your wallet can now connect to the BSC Testnet!

Adding Test BNB to Your Wallet

The Next thing we will need to do is get some BNB to play around with. BNB is BSC's native currency; BNB is to BSC what ETH is to Ethereum. To get some test BNB, we will head over here

How to Create a BEP20 Token | QuickNode (2)

You can copy your wallet address from the MetaMask browser extension and paste it into the field to get BNB sent to you. With fresh BNB burning a hole in our wallet, we can go spend some!

Coding the Token

Because BSC uses the EVM, the code for deploying an ERC-20 Token and the BEP20 token is the same. What that enables us to do, is grab the ERC-20 specification from OpenZepplin and use it in our smart contract.

The next thing to do is open up a new browser tab and go to the Remix IDE and start a new Workspace.

Under the contracts folder, we will create a file called BEP20.sol

In this new file you can write the following code:

// contracts/BEP20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract BEP20 is ERC20 {
constructor(uint256 initialSupply) ERC20("BEP20Test", "BPT") {
_mint(msg.sender, initialSupply);
}
}

Line 1/2: The license and where this file should be located.

Line 3: We set the solidity complier to version 0.8.0.

Line 5: This imports the ERC20 package from OpenZepplin. We can use the specification to implement the new token. It is this standard that allows other wallets and programs to easily interface with the new token.

Line 7: This is specifying a new contract. You could rename BEP20 to something else arbitrary. However the ERC20 portion is the part that lets solidity know we want to use the ERC20 package that we are importing on line 5.

Line 8: The constructor portion of the contract is going to be called whenever we deploy our contract onto the BSC Testnet. We are giving it a single parameter initialSupply of type uint256. Then we call use the ERC20 functionality that we imported from OpenZepplin. This has two parameters: the first of which is the name of your token, and the second is what the token's ticker will be. In our case I called the token BEP20Test and it will show up with the BPT ticker.

Line 9: The _mint call that is implemented in the ERC20 contract. _mint will create the token, and send all of the newly minted tokens to msg.sender which will be whoever deploys the contract onto the testnet. In this case, you! It will create however many tokens we pass to the initialSupply parameter.

Note: It will create InitialSupply amount of tokens in the WEI format. which is 1e-18. So to create 100 tokens you need to pass the function 100000000000000000000

Deploying the Token

With the initial BEP20.sol written out, we can now deploy it onto the BSC Testnet.
Click on BEP20.sol and then open the solidity complier tab and change the complier version to "0.8.0+commit.c7dfd78e". Then click on the blue "Compile BEP20.sol" button.

How to Create a BEP20 Token | QuickNode (3)

After compiling the contract you are now ready to deploy! Click on the "Deploy & Run Transactions" tab in Remix and click change the "Environment" tab to Injected Web 3. If you haven't connected to Remix using MetaMask before it may ask for confirmation.

After your MetaMask has connected to Remix, you should see your Address under the "Account" field. If that is the case you can now select the BEP20 contract under the dropdown tab. You should see an orange deploy button, and a form to the right of it. This is where you can pass an argument to the initialSupply parameter from earlier.

I'll create 100 tokens, to do that I'll pass in 100000000000000000000 and then click on "Deploy".

You will need to accept a MetaMask transaction as it will cost BNB to deploy something to the network.

How to Create a BEP20 Token | QuickNode (4)

If you did everything correctly up to this point you should be greeted with a success message in the terminal!

You can copy the contract address under the "Deployed Contracts" tab and look it up on bscscan. You will see your wallet address in the "from" field, and should see that 100 BPT tokens were sent to your wallet.

Adding the Token to your Wallet

In order to view this in your MetaMask UI you will need to click on Add Token, under the "Assets" tab. This should bring you to a menu with 3 fields to fill out. If you paste in the Contract address from Remix you will see all of the fields auto populate, and you should then be able to accept the token.

It should look like this by the end.

How to Create a BEP20 Token | QuickNode (5)

Conclusion

Congratulations! You made it to the end. You know how to deploy a custom token to the BSC network and add it to your MetaMask. In reality you now know even more than that, as the process is exactly the same for the Ethereum Network, you would only need to point Remix and MetaMask at the Ethereum Network instead of the BSC Network! If you're interested in doing exactly that, you can find our step-by-step guide right here

Subscribe to our newsletter for more articles and guides on Ethereum. If you have any feedback, feel free to reach out to us via Twitter. You can always chat with us on our Discord community server, featuring some of the coolest developers you’ll ever meet :)

As a seasoned expert in blockchain technology and decentralized finance, I've been deeply involved in the development and deployment of tokens on various blockchain networks, including the Binance Smart Chain (BSC). My expertise extends to the Ethereum Virtual Machine (EVM) and the ERC-20 token standard. I've actively contributed to the creation of smart contracts, and I've closely followed the evolution of token standards like BEP-20 and ERC-20.

Now, let's delve into the concepts covered in the provided article:

1. BEP20 Overview:

  • Definition: BEP20 is the token standard on the Binance Smart Chain (BSC), similar to the ERC-20 standard on the Ethereum network.
  • Key Distinction: BEP20 tokens operate on the BSC network instead of Ethereum, but due to BSC's implementation of the Ethereum Virtual Machine (EVM), they share similarities in specification and implementation with ERC-20 tokens.

2. Prerequisites:

  • MetaMask Browser Extension: A prerequisite for the tutorial, MetaMask is a popular cryptocurrency wallet and gateway to blockchain apps.
  • Remix IDE: An integrated development environment used for writing, testing, and deploying smart contracts.

3. Setting up BSC Testnet:

  • Network Configuration: Configuring MetaMask to connect to the BSC Testnet by adding a custom RPC (Remote Procedure Call).
  • Test BNB Acquisition: Obtaining test BNB (Binance Coin) for experimentation on the BSC Testnet.

4. Coding the BEP20 Token:

  • EVM Compatibility: Leveraging the fact that BSC uses the Ethereum Virtual Machine (EVM), allowing for the reuse of ERC-20 specifications.
  • Smart Contract Development: Creating a BEP20 token using the OpenZeppelin ERC-20 package in the Remix IDE.
  • Contract Components: Understanding key components, such as SPDX-License-Identifier, Solidity version, and the ERC-20 import.

5. Deploying the Token:

  • Compilation: Compiling the BEP20 smart contract using the Remix IDE.
  • Deployment: Deploying the compiled contract to the BSC Testnet using MetaMask and Remix, with considerations for gas fees.

6. Adding the Token to MetaMask:

  • Token Inclusion: Manually adding the deployed BEP20 token to MetaMask for visibility in the wallet UI.
  • Contract Address: Utilizing the contract address from Remix to populate token details in MetaMask.

7. Conclusion:

  • Summary of Achievements: Celebrating the successful deployment of a custom BEP20 token on the BSC network and its integration into MetaMask.
  • Versatility: Highlighting the transferability of the knowledge to the Ethereum Network, emphasizing the similarity in processes.

8. Additional Resources:

  • Newsletter Subscription: Encouraging readers to subscribe for more articles and guides on Ethereum.
  • Community Engagement: Providing avenues for feedback through Twitter and Discord community server.

In conclusion, this comprehensive guide equips readers with the skills to create and deploy BEP20 tokens on the BSC network, showcasing the interoperability of concepts across different blockchain ecosystems.

How to Create a BEP20 Token | QuickNode (2024)

FAQs

How can I create my own BEP20 token? ›

To create BEP20 tokens simply connect, configure, and create. Instead of programming your own smart contract, you will simply require to have a web3 wallet such as Metamask, and sufficient funds to cover for the token creation fees. Using a token generator streamlines the process of generating BEP20 tokens.

How much does it cost to create a BEP20 token? ›

Update & Maintenance
FactorsCost Estimation
Development Team$1000 – $1500
Complexity of Features$500 – $750
UI/UX Design$500 – $1000
Legal & Jurisdiction Compliance$600 – $1000
1 more row

How do I get BEP20 tokens? ›

To receive a BEP-20 token, you simply have to send it to your Binance Smart Chain address.

How to create a BSC token for free? ›

If you want to create BSC token for free, you simply need to do that on the Binance Smart Chain testnet instead of the mainnet. Then, you'll use testnet tokens (tBNB) instead of BNB tokens to cover fees (which you can get from BNB faucets) and won't have to pay anything.

How do I create a BEP20 on MetaMask? ›

Adding BEP-20 Tokens to Your MetaMask Wallet
  1. Access Your Wallet: Open MetaMask and ensure you're on the BNB Smart Chain network.
  2. Find the Token Contract Address: Locate the contract address of the BEP-20 token you want to add. ...
  3. Add Token in MetaMask: Click on “Import tokens” at the bottom of the main MetaMask screen.
Jan 19, 2024

How to make BEP20 wallet? ›

How to get a BEP20 wallet
  1. Download and install Trust Wallet.
  2. Add BEP20 (BEP20) to your wallet.
  3. Access wallet features like buy, sell, swap and more.

Is BEP20 free? ›

The most basic BEP20 token costs 10 EUR when creating it using CoinTool. Once you have set your wallet to the designated network, make sure to have enough BNB coins in your wallet. As you have to pay network and transaction fees in BNB, the transaction will only go through if you have sufficient funds available.

How to create USDT BEP20? ›

This article will show you how to create a USDT(BEP-20) wallet on MetaMask.
  1. Go to MetaMask and click the «Download for Chrome» button.
  2. Click the «Add to Chrome» button and install the extension to your device.
  3. Once the extension is installed, it will open in a new window.
Jan 16, 2023

How to create BNB smart chain? ›

Get Started on BNB Smart Chain in 60 Seconds
  1. Here's a quick guide on how you can create your own BNB Smart Chain Wallet.
  2. Click “Main Ethereum Network” at the top.
  3. Click “Custom RPC”
  4. Copy and paste each line into each box as below.
  5. Click “Save”
  6. Congrats! You now have a BNB Smart Chain Wallet!
Oct 1, 2020

Which wallet supports BEP20? ›

Select a reputable wallet provider that supports BEP20 tokens. Popular choices include MetaMask, Trust Wallet, Binance Chain Wallet, and others.

Is USDT a BEP20 token? ›

Tether on the BNB Smart Chain is known as USDT BEP20. BEP20 is a token standard that expands on Ethereum's ERC20, being more flexible in terms of token generation and cheaper to use due to lower gas fees.

How do I cash out my BEP20 tokens? ›

In your Binance exchange account, go to the Withdraw Crypto section and select the coin you wish to withdraw. In the address field, paste your Ledger BNB address, make sure that the BEP20 (BNB) network is selected, and complete the withdrawal.

How do I create my own token? ›

How to Create Your Own Crypto Token in 10 Easy Steps
  1. Define the purpose of your token. ...
  2. Choose a blockchain platform for your token. ...
  3. Select a token standard for your token. ...
  4. Design the token's name, symbol, supply, and distribution. ...
  5. Write the token's smart contract code. ...
  6. Test and deploy the token's smart contract.
Feb 26, 2024

How much does it cost to create a BSC token? ›

The cost of creating a token on BSC depends on the complexity of your smart contract and the current gas price on the network. According to the source, the average cost of deploying a simple BEP-20 token contract is around 0.05 BNB, which is about $15 at the time of writing.

What is the best crypto token generator? ›

If you want to create your crypto tokens then you should use the finest token generator platforms such as Cointool. App, Togen.io, and Tokenmint.

How do I convert ERC-20 to BEP20? ›

Using Allbridge Core, you can seamlessly bridge ERC20 to BEP20 tokens via decentralized cross-messaging protocols. Our platform enables the native cross-chain swaps of Ethereum USDT and USDC into the BUSD on BNB Chain.

How to create a bep2 token? ›

How to Create the BEP-20 Token?
  1. Defining Your Token's Purpose and Parameters.
  2. Setting Up Your Development Environment.
  3. Writing the Smart Contract.
  4. Testing the Token on a Testnet.
  5. Deploying the Smart Contract on Testnet.
  6. Final Review Before Mainnet Launch.
  7. Deploying the Token on Mainnet.
  8. Pre-Launch Checks.
Dec 2, 2023

Top Articles
Financial Instruments: Definitions (IAS 32) - IFRScommunity.com
Bitcoin: 10 fatos intrigantes sobre a “moeda do futuro”
Bild Poster Ikea
Garrison Blacksmith Bench
What are Dietary Reference Intakes?
Miles City Montana Craigslist
Trade Chart Dave Richard
30% OFF Jellycat Promo Code - September 2024 (*NEW*)
Tv Schedule Today No Cable
12 Best Craigslist Apps for Android and iOS (2024)
Inside California's brutal underground market for puppies: Neglected dogs, deceived owners, big profits
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Pittsburgh Ultra Advanced Stain And Sealant Color Chart
National Office Liquidators Llc
Https://Store-Kronos.kohls.com/Wfc
Grab this ice cream maker while it's discounted in Walmart's sale | Digital Trends
Aberration Surface Entrances
Parentvue Clarkston
Skip The Games Fairbanks Alaska
Busted News Bowie County
yuba-sutter apartments / housing for rent - craigslist
Ficoforum
The Boogeyman (Film, 2023) - MovieMeter.nl
Sensual Massage Grand Rapids
O'reilly's In Mathis Texas
They Cloned Tyrone Showtimes Near Showbiz Cinemas - Kingwood
Town South Swim Club
Funky Town Gore Cartel Video
Stolen Touches Neva Altaj Read Online Free
Babbychula
Lichen - 1.17.0 - Gemsbok! Antler Windchimes! Shoji Screens!
Waffle House Gift Card Cvs
Powerspec G512
Jefferson Parish Dump Wall Blvd
Gets Less Antsy Crossword Clue
دانلود سریال خاندان اژدها دیجی موویز
Stafford Rotoworld
Rhode Island High School Sports News & Headlines| Providence Journal
Www Usps Com Passport Scheduler
Wilson Tattoo Shops
Emulating Web Browser in a Dedicated Intermediary Box
Janaki Kalaganaledu Serial Today Episode Written Update
Nid Lcms
Comanche Or Crow Crossword Clue
Bedbathandbeyond Flemington Nj
1Tamilmv.kids
Is Chanel West Coast Pregnant Due Date
Okta Hendrick Login
Powah: Automating the Energizing Orb - EnigmaticaModpacks/Enigmatica6 GitHub Wiki
De Donde Es El Area +63
Https://Eaxcis.allstate.com
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 6669

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.