# Hardhat: Deploy ERC20 Contract

Step 1. Enter `smart-contract-example/hardhat` folder

`$ cd smart-contract-example/hardhat`

Step 2. Run `npm install` inside the folder

`$ npm install`

Step 3. Make a copy of `.env.example` to `.env`

`$ cp .env.example .env`

Step 4. Modify `.env` and fill ONE of the field

`MNEMONIC=goose easy ivory ...`

`PRIVATE_KEY=XXXXXXX`

Step 5. Review Migration Script at `scripts/deploy-pool-token.js`

&#x20;`async function main() {`

&#x20;    `const PoolToken = await hre.ethers.getContractFactory("PoolToken");`

&#x20;    `const poolToken = await PoolToken.deploy("Pool Token", "CRT", "1000000000000000000000000");`

&#x20;     `await poolToken.deployed();`

&#x20;     `console.log("PoolToken deployed to:", poolToken.address);`

&#x20;`}`

Step 6. Endpoints setting

By default, the script will be using your local host `"127.0.0.1"` - If you are not running a localhost, you may leverage the public endpoint `http://13.213.36.146:6868/` by making changes to networks in `hardhat.config.js,` for example:

&#x20;`networks: {`

&#x20;  `development: {`

&#x20;    `url: "http://localhost:8545",`

&#x20;    `accounts: getHDWallet(),`

&#x20;   `},`

&#x20;  `testnet: {`

&#x20;    `url: "http://13.213.36.146:6868",`

&#x20;    `accounts: getHDWallet(),`

&#x20;  `},`

&#x20;`},`

Step 7. Deploy Contract

`npx hardhat run --network <your-network> scripts/deploy-pool-token.js`

Step 8. Obtain Contract address from the console and input to Metamask

The correct balance will be shown on the Metamask page.
