Skip to content

hhio618/simple-erc20-example

Repository files navigation

simple-erc20-example

Simple erc20 deployer using truffle js library.

Quickstart

Clone this repository to your local environment.

Create an env file

$ mv env.example .env
$ cat .env
INFURA_PROJECT_ID="xxxxxxxxxxxxxxxxxxxxxxxxx"
DEV_PRIVATE_KEY="your-ethereum-wallet-private-key-here"
ETHERSCAN_API_KEY="etherescan-api-key-here"
$ # Please update this .env file with your credentials!

Add your ERC20 token smart contract

  1. Add your erc20 token.
$ cd contracts
$ cp SimpleToken.sol MyToken.sol
$ # Edit MyToken.sol as required!
  1. Edit migrations/2_deploy_token.js file and add your newly created erc20 token.
$ cat migrations/2_deploy_token.js
const SimpleToken = artifacts.require("SimpleToken");

module.exports = function(deployer) {
      deployer.deploy(SimpleToken);
};

Deploy new erc20 token using truffle

  1. Install dependencies:
$ npm i
  1. Deploy new erc20 token:
$ truffle migrate --network rinkeby # This will deploy on rinkeby testnet!
  1. (Optional)Verify your erc20 token on etherscan:
$ truffle run verify MyToken --network rinkeby # This will use rinkeby testnet!

About

Simple erc20 deployer using truffle js library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published