Introducing the Binance Smart Chain platform (For blockchain dev)

Tram Ho

Binance smart chain in the present time is emerging as an extremely powerful force with BTC, ETH, Polkadot, …

In this article, I will introduce to you what Binance smart chain (BSC) is and how to build apps on it.

General introduction

Before I introduce BSC, I will go through a bit about Binance chain. So what was the Binance chain before it became smart ?

First we will talk about Binance Chain:

Binance chain is proposed and built with the main goal of creating a decentralized asset for Binance (Binnace DEX): https://www.binance.org/en

The original goal was to facilitate transactions so there was a trade-off in being able to build DApps for the primary goal of exchange between tokens. Users can issue tokens on Binance Chain themselves, access transaction information through the BC SDKs, but cannot build Dapps on it.

And to handle the problem of not being able to build Dapps, Binance smart chain was born.

Binance smart chain

The first difference that the binance smart chain brings is that it has an EVM virtual machine, so it can run the same smart contracts above, besides, BSC also changed a bit about the consensus, increasing the number of validators. BSC is a chain running parallel to the Binance chain and does not generate any more native tokens, the native token will still be the BNB that is mine from Binace Chain.

Below will be the comparison parameters between these 2 chains:

Projects on Binance smart chain , because they are latecomers but with strong potential in both community and finance, BSC is like a hungry tiger coming to the party table late, spending heavily financially to reclaim defi market share, and also There have been some outstanding results as tokens are pegged to:

https://bscscan.com/tokens

And there are also Dapps similar to the Ethereum side appeared on Binance:

Building applications on BSC

This will be a very simple part for anyone who has ever dev smart contracts on Ethereum will be very familiar with the steps below.

Build a contract

First we will use MathWallet to faucet a bit of binance which supports testing:

Switch network to Binance Smart Chain – testnet and then take a little bit of test at the following website:

https://testnet.binance.org/faiffon-smart

Okei is ready, we will use directly on remix to deploy a test contract:

https://remix.ethereum.org/

Try the following Owner.sol deploy contract:

Connect MathWallet wallet with remix:

Then deploy directly using remix and we have an instance that can be directly interacted:

Interaction with the contract

Interacting with DApps through MathWallet, in this article I will introduce a way to interact with Dapps on BSC, in addition you can also learn how to use with TrustWallet or Metamask by configuring web3

To be able to interact with the contract, we will use the following package:

and simply use the useWallet hook provided by that package to interact with the wallet:

Lastly, thank you for watching my post

Source:

Share the news now

Source : Viblo