1. Home
  2. /
  3. Brownie
  4. /
  5. ERC20 Token Deployment

ERC20 Token Deployment - Brownie Typing CST Test

Loading…

ERC20 Token Deployment — Brownie Code

Deploy a simple ERC20 token using Brownie.

# contracts/MyToken.sol
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';

contract MyToken is ERC20 {
    constructor(uint256 initialSupply) ERC20('MyToken','MTK') {
        _mint(msg.sender, initialSupply);
    }
}

# deploy.py
from brownie import MyToken, accounts

def main():
    acct = accounts[0]
    token = MyToken.deploy(1000*10**18, {'from': acct})
    print('Token deployed at:', token.address)

Brownie Language Guide

Brownie is an open-source Python-based framework for Ethereum smart contract development, testing, and deployment. It integrates with Ethereum networks and provides a full-featured environment for building decentralized applications (dApps).

Primary Use Cases

  • ▸Writing Ethereum smart contracts in Solidity
  • ▸Testing contracts using Python-based frameworks
  • ▸Deploying contracts to Ethereum testnets or mainnet
  • ▸Automating interaction with deployed contracts
  • ▸Integrating blockchain contracts with Python backend scripts

Notable Features

  • ▸Python-based development environment for Ethereum
  • ▸Built-in testing with pytest integration
  • ▸Network management for local, testnet, and mainnet
  • ▸Support for contract interaction and scripting
  • ▸Integration with Ganache and Infura for blockchain access

Origin & Creator

Brownie was created by Matt Lockyer in 2018 to simplify Ethereum smart contract development using Python, providing a familiar developer workflow for testing, deployment, and interaction.

Industrial Note

Brownie is widely used in DeFi, NFT, and other blockchain applications for rapid smart contract development and testing, particularly when Python-based workflows are preferred.

More Brownie Typing Exercises

Brownie Minimal Smart Contract DeploymentBrownie Smart Contract Interaction ExampleBrownie Event Listening ExampleBrownie Funding Contract ExampleBrownie Multi-Account Transaction ExampleBrownie Upgradeable Contract ExampleBrownie Testing Smart Contracts ExampleBrownie Interaction with ERC721 NFTBrownie Gas Estimation Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher