Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
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 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).
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.