Integrating BSC Tokens Into Your Crypto Project

Written by nownodes | Published 2022/09/07
Tech Story Tags: defi | how-to-make-a-bsc-token | how-to-make-a-bep20-token-bsc | bsc | cryptocurrency | token | crypto | good-company

TLDRThe BNB Chain (BSC) aims to build the world’s virtual ecosystem infrastructure. BNB stands for “Build and Build,” which is the blockchain gas token that is utilized on the BNB chain. Any cryptocurrency that wants to get released on top of BSC needs to follow specific token standards, such as the BEP-20 token standard. You can easily integrate a BSC Token into your crypto project, and we are going to go over what you need to do.via the TL;DR App

Binance and the BNB Chain (BSC) have grown in popularity tremendously both in the eyes of developers as well as users.

If you have ever used Binance or just want to implement a cryptocurrency that follows the BEP-20 token standard and is a part of the BNB Chain (BSC), we have created a step-by-step guide as to how you can create and integrate a BNB Chain token to any project.

Key Points:

  • The BNB Chain (BSC) comprises the Binance Chain and the Binance Smart Chain, where it aims to build the world’s virtual ecosystem infrastructure; this is essentially the rebranding.

  • BNB stands for “Build and Build,” which is the blockchain gas token that is utilized on the BNB Chain.

  • Any cryptocurrency that wants to get released on top of BSC needs to follow specific token standards, such as the BEP-20 token standard.

  • You can easily integrate a BSC Token into your crypto project, and we are going to go over what you need to do in order to achieve this task.

Why Choose Binance Smart Chain Token?

The BNB Chain (BSC), formerly known as the Binance Smart Chain, has the main goal of building the infrastructure that power’s the virtual ecosystem, where BNB’s commitment is to be open, multi-chain, permissionless, decentralized, and much bigger than Binance.

The BNB Chain is composed of the BNB Beacon Chain, which was known as the Binance Chain, which is used for governance, voting, and staking. Then there’s the BNB Smart Chain, which was formerly known as the Binance Smart Chain, which is Ethereum Virtual Machine (EVM) compatible, features a consensus layer, and has hubs to multi-chains.

By building a token on top of the BNB Chain, developers can gain access to all of the advantages found within this ecosystem.

BSC runs in parallel to the BNB Chain and enables smart contracts for tokens on the blockchain. This results in cheap transaction fees, cross-chain decentralized finance (DeFi) mechanism that increases interoperability, a high-performance network holding the capability to produce a block every 3 seconds, a growing ecosystem, and a lot of other benefits.

How to Integrate BSC Token?

We are going to go over just about everything you need to do in order to integrate a BSC token into any project that you are working on step-by-step.

  • Step 1: Create and Configure the MetaMask Wallet

BEP-20 is essentially the BNB Chain equivalent to the ERC-20 token standard used on Ethereum (ETH). However, BEP-20 does not run on the Ethereum network.

What this means is that you need to install the MetaMask browser extension and add the BSC testnet to your MetaMask wallet.

To do so, open up MetaMask and click on the networks tab, after which you can click on “Custom RPC.” To Configure your wallet to connect to the BSC Testnet, you can fill out the form as follows:

  • NetworkName: BSC Testnet
  • RPC_URL: https://data-seed-prebsc-1-s1.binance.org:8545/
  • Chain_ID: 97
  • Currency_Symbol: BNB
  • BlockExplorerURL: https://testnet.bscscan.com

With that setup, you can add test BNB to your wallet. To do so, you need to head over to the “Binance Smart Chain Faucet” and import your BNB Chain address to get free BNB.

  • Step 2: Using Remix and OpenZeppelin

Due to the fact that BSC utilizes EVM, the code for the deployment of the ERC-20 token standard and the BEP-20 token standard is similar. Get the ERC-20 specification from OpenZeppelin, and use it in the smart contract. You will also need to visit the Remix IDE and start a new Workspace and create a file called BEP20.sol.'

In the file you just created, enter 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);
    }
}

This will create an InitialSupply amount of tokens in the WEI format. To create 100 tokens, you need to pass the function 100000000000000000000, for example.

  • Step 3: Deploying the BEP-20 Token

Within the Initial BEP20.sol file that has been written out, you can deploy it onto the BSC testnet. To do so, click on the BEP20.sol file and open the solidity compiler tab, where you can change the compiler version and click on “Compile.”

After the contract has been compiled successfully, you can now deploy it. To do so, click on the “Deploy & Run Transactions” tab and change the “Environment” tab to Injected Web 3. Here, you need to connect your MetaMask so that you can confirm the transaction.

  • Step 4: Adding the Token to The Wallet

You can now add the token to your wallet by clicking on “Add Token” under the “Assets” tab.

Here, you can paste the contract address from Remix, and you will see the fields get populated automatically. Then, all you have to do is just accept the token.

Final Words

Hopefully, now you know how you can create and integrate a BSC token into your crypto project. Once the cryptocurrencies are in your MetaMask wallet, you are free to implement them in any way you want to.

To keep track of everything as it happens during development, you can connect to a NOWNodes node or blockchain explorer as a means of getting an in-depth look at each transaction as it happens and ensuring that you are sending the cryptocurrencies to the right addresses.


Written by nownodes | NOWNodes is a blockchain-as-a-service solution that lets users get access to full Nodes and blockbook Explorers via API.
Published by HackerNoon on 2022/09/07