Simple erc20 deployer using truffle js library.
Clone this repository to your local environment.
$ 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.
$ cd contracts
$ cp SimpleToken.sol MyToken.sol
$ # Edit MyToken.sol as required!
- 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);
};
- Install dependencies:
$ npm i
- Deploy new erc20 token:
$ truffle migrate --network rinkeby # This will deploy on rinkeby testnet!
- (Optional)Verify your erc20 token on etherscan:
$ truffle run verify MyToken --network rinkeby # This will use rinkeby testnet!