Create Basic ERC20 token with Solidity, Brownie and Python

Overview

Create Basic ERC20 token with Solidity, Brownie and Python

Demo

Check out Cornell Token on Rinnkeby network with Etherscan.

demo

Installation

  1. Install brownie with pipx

    $ python3 -m pip install --user pipx
    $ python3 -m pipx ensurepath
    $ pipx install eth-brownie
    
    # test installation
    $ brownie 
  2. Install ganache-cli with npm

    npm install -g ganache-cli

Create the Project

  1. Initialize the project

    $ mkdir cornell_token ; cd cornell_token
    $ brownie init
  2. Create token contract in ./contracts/CornellToken.sol

    • inherit ERC20 implementation from OpenZeppelin to avoid re-inventing the wheel.
  3. Add ./brownie-config.yaml

    1. create mapping @openzeppelin to the github repo
    2. add other config:
      • dotenv
      • private key of local dev
  4. Add .env for the environment variables

    • dotenv -> for private key stuff, as a safer way
  5. Change the name of the Token (e.g. CornellToken)

  6. Creat deploy script deploy_cornell_token.py

    • define initial supply, token name, token sybol
  7. Creat deploy script helper.py

    • get account function

Deploy to local blockchain development environment

$ brownie run scripts/deploy_cornell_token.sol

Deploy to live network

  1. in brownie-config.yaml, add:

    networks:
    rinkeby: active
  2. in .env, add:

    export WEB3_INFURA_PROJECT_ID=<YOUR INFURA PROJECT ID>
    export PRIVATE_KEY=<YOUR PRIVATE KEY>

    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

  3. 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.

  4. add this token to metamask

    • Metamask -> assets -> import tokens
    • grab the token contract address and add it into metamask.
Owner
Ethan Huang
Ethan Huang
๐€ ๐ฆ๐จ๐๐ฎ๐ฅ๐š๐ซ ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ ๐†๐ซ๐จ๐ฎ๐ฉ ๐ฆ๐š๐ง๐š๐ ๐ž๐ฆ๐ž๐ง๐ญ ๐›๐จ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ฎ๐ฅ๐ญ๐ข๐ฆ๐š๐ญ๐ž ๐Ÿ๐ž๐š๐ญ๐ฎ๐ซ๐ž๐ฌ !!

๐‡๐จ๐ฐ ๐“๐จ ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ For easiest way to deploy this Bot click on the below button ๐Œ๐š๐๐ž ๐๐ฒ ๐’๐ฎ๐ฉ๐ฉ๐จ๐ซ๐ญ ๐†๐ซ๐จ๐ฎ๐ฉ ๐’๐จ๐ฎ๐ซ๐œ๐ž๐ฌ ๐†๐ž๐ง๐ž?

Mukesh Solanki 1 Dec 10, 2021
This is to notify you via Discord whenever there is a new beacon.

BeaconNotifier-Discord This is to notify you via Discord whenever there is a new beacon. Make sure you have python3 installed Steps: Create a Discord

26 Dec 28, 2022
Georeferencing large amounts of data for free.

Geolocate Georeferencing large amounts of data for free. Special thanks to @brunodepauloalmeida and the whole team for the contributions. How? It's us

Gabriel Gazola Milan 23 Dec 30, 2022
A Code that can make your Discord Account 24/7!

Online-Forever Make your Discord Account Online 24/7! A Code written in Python that helps you to keep your account 24/7. The main.py is the main file.

Phantom 556 Dec 29, 2022
Another secured and Yet Fastest telegram userbot

Vision-UserBot A stable, simple Telegram UserBot in Pyrogram! Support Variables โžจ TG_APP_ID - Your Telegram Api id. โžจ TG_API_HASH - Your Telegram Api

TeamVision 40 Oct 24, 2022
๐Ÿ“– GitHub action schedular (cron) that posts a Hadith every hour on Twitter & Facebook.

Hadith Every Hour ๐Ÿ“– A bot that posts a Hadith every hour on Twitter & Facebook (Every 3 hours for now to avoid spamming) Follow on Twitter @HadithEve

Ananto 13 Dec 14, 2022
Telegram Link Shortener Bot (With 20 Shorteners)

Telegram ShortenerBot ShortenerBot: ๐Ÿ‡ฌ๐Ÿ‡ง Telegram Link Shortener Bot (11 + 9 Shorteners) ๐Ÿ‡น๐Ÿ‡ท Telegram Link Kฤฑsaltฤฑcฤฑ Bot (11 + 9 Kฤฑsaltฤฑcฤฑ) All suppo

Hรผzรผnlรผ Artemis [HuzunluArtemis] 10 May 24, 2022
Vhook: A Discord webhook spammer / deleter open source coded by vesper

Vhook_Spammer Vhook is a advanced Discord webhook spammer / deleter with embeds,

Vesper 17 Nov 13, 2022
Me and @nathanmargni did a small analysis on what are the best strategies to win more games of League of Legends.

Me and @nathanmargni did a small analysis on what are the best strategies to win more games of League of Legends.

Christian Berchtold 2 Jan 19, 2022
A multipurpose, semi-modular Discord bot written in Python with the new discord.py module.

Discord.py Reaction Bot MIRAI KURIYAMA A multipurpose, semi-modular Discord bot written in Python with the new discord.py module. Installing dependenc

1 Dec 02, 2021
Rich presence app for playstation 3. Display what game you are playing on the PS3 via Discord

PS3-Rich-Presence-for-Discord Discord Rich Presence script for PS3 consoles on HFW&HEN or CFW. Written in Python. Display what you are playing on your

17 Dec 11, 2022
Tools for Twitter

Tools for Twitter Data This is a start of a collection of tools to use for collecting data via the Twitter API. If you do not have a Twitter Developer

DiscoverText 36 Oct 13, 2022
Simple library for logging to Loggly

#Hoover A python wrapper used to hit the Loggly. API For more information on Hoover see http://wiki.loggly.com/hooverguide ##Install With this git rep

Hoover Loggly 34 May 19, 2021
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run First add src to PYTHONPATH: export PYTHONPATH=${PWD} Then run: pyt

Ali Hejazizo 12 Dec 24, 2022
PyDottie is a version of Dottie.js written in Python 3.

PyDottie is a version of Dottie.js written in Python 3.

Jose Noriega 2 Nov 21, 2021
A python notification tool used for sending you text messages when certain conditions are met in the game, Neptune's Pride.

A python notification tool used for sending you text messages when certain conditions are met in the game, Neptune's Pride.

Paul Clarke 1 Jan 16, 2022
A simple discord bot based on python

A simple discord bot based on python

SENPAI LEGEND 2 Jul 24, 2022
An API or getting Optifine VersionsList/Version/Download-URL.

Optifine-API An API for getting Optifine VersionsList/Versions/Download-URL. Table of contents Get Versions List Get Specify Versions Download Optifin

2 Dec 04, 2022
๐Ÿš€ A fast, flexible and lightweight Discord API wrapper for Python.

Krema A fast, flexible and lightweight Discord API wrapper for Python. Installation Unikorn unikorn add kremayard krema -no-confirmation Pip pip insta

Krema 20 Sep 04, 2022