Skip to content

BFYDigital/erc20-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

An ERC20 Token based on OpenZeppelin contracts


Table of Contents

About

It's an example of ERC20 Token that mintable, burnable, and has a max supply.

Getting Started

Remix IDE

Go to http://remix.ethereum.org and create a new workspace. Create a file under contracts folder, named "erc20token.sol" and paste the code.

Configuring Your Token

Set Max Supply

Set the max supply of your token by modifying the variable _maxSupply on line 9

    uint256 private _maxSupply = 10000000 * 10 ** decimals();

The max supply is set at 10000000 (10M) coins, change this accordingly to fit your needs. The max supply of tokens will never change after deployment as it will be hard-coded into the contract.

Name Your Coin

Change the name of your token by going to line 11 and changing the text inside the quotation.

    constructor() ERC20("BFY Digital", "BFY") {

The first quotation "BFY Digital" is the coin name. The second quotation "BFY" is the symbol of the coin. Change these according to your needs.

PreMint Amount

Change the premint amount by going to line 12 and changing the number

     _mint(msg.sender, 1000000 * 10 ** decimals());

Usage

Compile the code on Remix IDE using the 0.8.2 Solidity Compiler.

Deployment

Deploy your contract using Remix IDE. Ensure you have enough for gas fees and that you are connected to the correct network.

Mint Token

After deployment, you can call "mint" function from owner account with "erc20 address" and "amount" parameters. (on line: 19)

Burn Token

If you want to burn some token with your code, you can call "mint" function from owner account with "0x0000000000000000000000000000000000000000" (genesis address) and "amount" parameters. (on line: 19) or you can use "burn" function is come from "ERC20Burnable" package with amount parameters.

Built Using

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published