鏈

主鏈

BNB 智能鏈

快速、實惠、EVM 相容

BNB 信標鏈

已完成停用

BNB 生態系的質押與治理層

塑造鏈

質押

透過保護網路獲得獎勵

文件水龍頭BscScanBSCTrace文件水龍頭橋接opBNBScan文件水龍頭橋接GreenfieldScanDCellar了解 Fusion 更多資訊代幣恢復工具Beacon Chain 瀏覽器原生質押流動性質押

建構

開始使用

提交去中心化應用程式

探索

加速

查看所有計畫

連結

加入我們

職缺🔥

探索 BNB Chain 的機會

BNB Chain 職缺生態系工作

Binance Smart Chain DAPP Dev Tutorial - Part II How to create a BEP20 Token

2020.11.9  •  3 分鐘閱讀
Blog post image.
This blog is from Math Wallet

This is part 2 of a Binance Smart Chain development series. Read part 1 here.

Develop Environment

Please check the BSC DAPP Dev Tutorial(1)

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

分享