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
Python functions for opentargets.org API

What is opy_Targets? Opentargets.org uses GraphQL API to explore it's content via coding. This ensemble of functions aim is to make it easy to use the

1 Jan 10, 2022
Python wrapper for Stanford CoreNLP.

stanfordcorenlp stanfordcorenlp is a Python wrapper for Stanford CoreNLP. It provides a simple API for text processing tasks such as Tokenization, Par

884 Dec 25, 2022
A VCVideoPlayer Bot for Telegram made with 💞 By @TeamDeeCoDe

VC Video Player How To Host ✨ Heroku Deploy ✨ The easiest way to deploy this Bot is via Heroku. Credit 🔥 |🇮🇳 Louis |🇮🇳 Sammy |🇮🇳 Blaze |🇮🇳 S

TeamDeeCode 6 Feb 28, 2022
Personal Discord Python Bot based on Discord.py

Personal Discord bot using the discord.py library by Rapptz

2 Dec 14, 2022
A python script to acquire multiple aws ec2 instances in a forensically sound-ish way

acquire_ec2.py The script acquire_ec2.py is used to automatically acquire AWS EC2 instances. The script needs to be run on an EC2 instance in the same

Deutsche Telekom Security GmbH 31 Sep 10, 2022
Riffdog Terraform scanner - finding 'things' in the Real World (aka AWS) which Terraform didn't put there.

riffdog Riffdog Terraform / Reality scanner - finding 'things' in the Real World which Terraform didn't put there. This project works by firstly loadi

Riffdog 4 Mar 23, 2020
Subtitle Translater

Subtitle Translater

OshadhaVimukthi 2 Nov 29, 2021
Emo-Fun is a bot which emojifies the text you send it

About Emo-Fun is a bot which emojifies the text you send it. It is easier to understand by an example Input : Hey this is to show my working!! Output

Suvodeep Sinha 3 Sep 30, 2022
A simple terminal UI for viewing fund P/L analysis through TEFAS

Tefas UI A simple terminal UI for viewing fund P/L analysis through TEFAS. Features (that my own bank's UI lack): Daily and weekly P/L FX comparisons

Batuhan Taskaya 4 Mar 14, 2022
Andrei 1.4k Dec 24, 2022
OGE-2022-na-Python - Solving problems in python for the OGE 2022

OGE-2022-na-Python Решение задачек на питоне для ОГЭ 2022 Тут разобраны разные в

Slava 0 Oct 14, 2022
Discord Mafia Game Bot using nextcord

Mafia-Bot Discord Mafia Game Bot using nextcord Features Mafia Game Game Replays Installation Run the following command to install required modules: p

Nian 6 Nov 19, 2022
Official python API for Phish.AI public and private API to detect zero-day phishing websites

phish-ai-api Summary Official python API for Phish.AI public and private API to detect zero-day phishing websites How it Works (TLDR) Essentially we h

Phish.AI 168 May 17, 2022
Telegram RAT written in Python

teleRAT Python based RAT that uses Telegram for sending commands and receiving data to and from a victim computer. Setup.py Insert your API key into t

96 Jan 01, 2023
An all-purpose Discord bot written in Python featuring a diverse collection of practical utilities.

GlazeGlopBot Table of Contents About Setup Usage Commands Command Errors Cog Management Local Sound Files Cogs Mod QR RNG VC Weather Proposed Features

Edison Ye 0 May 12, 2022
The Fasted Proxyless Multi-Threaded Discord Call Crasher

Discord-Call-Crasher The Fasted Proxyless Multi-Threaded Discord Call Crasher (Created By Jonah) Requirements / Setting up There will be a few things

8ua 10 Jun 17, 2022
Best DDoS Attack Script Python3, Cyber Attack With 40 Methods

MXDDoS - DDoS Attack Script With 40 Methods (Code Lang - Python 3) Please Don't Attack '.gov' and '.ir' Websites :) Features And Methods 💣 Layer7 GET

7 Mar 07, 2022
WBMS automates sending of message to multiple numbers via WhatsApp Web

WhatsApp Bulk Message Sender - WBMS WBMS automates sending of message to multiple numbers via WhatsApp Web. Report Bug · Request Feature Love the proj

Akshay Parakh 3 Jun 26, 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
Blankly - 🚀 💸 Trade stocks, cryptos, and forex w/ one package. Easily build, backtest, trade, and deploy across exchanges in a few lines of code.

💨 Rapidly build and deploy quantitative models for stocks, crypto, and forex 🚀 View Docs · Our Website · Join Our Newsletter · Getting Started Why B

Blankly Finance 1.4k Jan 03, 2023