Create Basic ERC20 token with Solidity, Brownie and Python


Check out Cornell Token on Rinnkeby network with Etherscan.


Install brownie with pipx

$ python3 -m pip install --user pipx
$ python3 -m pipx ensurepath
$ pipx install eth-brownie

# test installation
$ brownie 

Install ganache-cli with npm

npm install -g ganache-cli

Create the Project

Initialize the project

$ mkdir cornell_token ; cd cornell_token
$ brownie init

Create token contract in ./contracts/CornellToken.sol

  • inherit ERC20 implementation from OpenZeppelin to avoid re-inventing the wheel.

Add ./brownie-config.yaml

  1. create mapping @openzeppelin to the github repo
  2. add other config:
  • dotenv
  • private key of local dev

Add .env for the environment variables

  • dotenv  -> for private key stuff, as a safer way

Change the name of the Token (e.g. CornellToken)

Creat deploy script

  • define initial supply, token name, token sybol

Creat deploy script

  • get account function

Deploy to local blockchain development environment

$ brownie run scripts/deploy_cornell_token.sol

Deploy to live network

in brownie-config.yaml, add:

rinkeby: active

in .env, add:


To have infura project id, you need to create an infura account and a new project. The id is the endpoint to the live network.

To access your private key, you can check out the metamask -> account details

run the same script with an extra --network option

$ brownie run scripts/deploy_cornell_token.sol --network rinkeby

then wait for a moment to see the address being active on the live network.

add this token to metamask

  • Metamask -> assets -> import tokens
  • grab the token contract address and add it into metamask.
GitHub - ethanh6/Cornell-Token at
Create and deploy ERC20 token to live network. Contribute to ethanh6/Cornell-Token development by creating an account on GitHub.