Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Deploy and fund a smart contract with Ether using Brownie.
# contracts/FundMe.sol
pragma solidity ^0.8.0;
contract FundMe {
uint256 public balance = 0;
function fund() public payable { balance += msg.value; }
}
# deploy.py
from brownie import FundMe, accounts
def main():
acct = accounts[0]
fund_me = FundMe.deploy({'from': acct})
fund_me.fund({'from': acct, 'value': 1000000000000000000}) # 1 ETH
print('Contract balance:', fund_me.balance())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.