BSC DAPP Dev Tutorial(2)- How to create a BEP20 Token

BSC DAPP Dev Tutorial Serie
http://blog.mathwallet.org/?tag=BSCdapp

Develop Environment

Please check the BSC DAPP Dev Tutorial(1)
http://blog.mathwallet.org/?p=2357

Compile and Deploy

Open https://remix.ethereum.org

Delete the default files, and create a new file: Token.sol

Copy the Token.sol code from below repo
https://github.com/mathwallet/BSC-Contracts/blob/main/Contracts/BEP20.sol

You need to modify BEP20Token code based on your needs, including name, symbol, decimals, totalSupply

Compile:
Go to 2nd tab, click Compile Token.sol

Deploy:
Go to 3rd tab
ENVIRONMENT select Injected Web3, Remix will connect to MathWallet which is need to sign the deployment transaction

Click ‘Deploy’ to start
In the popup MathWallet confirm window, click ‘Accept’

After few seconds, you can find your new smart contract on Bscscan

Verify Contract

Only after the contract is verified on Bscscan, everyone is able to see the source code of your contract and verify it. People can also query and write the contract on Bscscan directly.

On the contract page of Bscscan, go to ‘contract’ tab, click ‘Verify and Publish’

You need to select the contract information (for version information, you can get it from Remix)

Copy the code from Remix and leave the other fields as default

Click ‘Verify and Publish’

Config Contract

Go to ‘Write Contract’ and click ‘Connect to Web3’, Bscscan will connect to MathWallet

Mint Token
Find mint function, enter the address and amount (remember to add the decimals in the amount field)

Open transfer
Find unpause function, click ‘Write’, sign the transaction

Now your BEP20 token is ready to transfer

In the Bscscan contract URL, change contract to token, and you will able to review the detail token information.
https://testnet.bscscan.com/token/0x

Submit Token

Now you can deploy the contract in BSC mainnet, and submit your token to MathWallet so that more people can use it
https://m.maiziqianbao.net/submit/token?type=BSC

You may also create a icon for your token, size: 188*188px