https://github.com/ocdbytes/fund_me_brownie
This contract is deployed using brownie. It is a library which helps us in deploying our contracts and testing them in a very easy and efficient way in various environments
https://github.com/ocdbytes/fund_me_brownie
brownie ethereum python solidity solidity-contracts
Last synced: 4 months ago
JSON representation
This contract is deployed using brownie. It is a library which helps us in deploying our contracts and testing them in a very easy and efficient way in various environments
- Host: GitHub
- URL: https://github.com/ocdbytes/fund_me_brownie
- Owner: ocdbytes
- Created: 2022-02-11T16:56:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-12T14:34:54.000Z (about 4 years ago)
- Last Synced: 2025-06-15T18:25:45.328Z (8 months ago)
- Topics: brownie, ethereum, python, solidity, solidity-contracts
- Language: Solidity
- Homepage:
- Size: 3.07 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README

# Brownie Fund Me
In this session we will deploy our fund me contract on etherium network with Brownie
### What we have to do in order to download our chainlink packages in our project ?
Because unlike remix here brownie doesn’t know that how to import these packages but brownie does know that from where it can download the packages so we have to specify that in “**brownie-config.yaml**” file
```yaml
dependencies:
# - @
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
solc:
remappings:
- "@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1"
dotenv: .env
wallets:
from_key: ${PRIVATE_KEY}
```
## How to deploy our contract on Rinkeby Test Network with our source code visible →
### Manual Method :

Click “Verify and Publish” and further enter the required details
### Automatic Method :
- Login on etherscan main website
- Generate a API key for verification
- Add API key in your “.env” file
- while publishing your contract write “publish_source” as true Eg:
```python
fund_me = FundMe.deploy({"from": account}, publish_source=True)
```
## Now in order to develop our contract we need to have price feed but we are not going to deploy our contract again and again on the Rinkeby chain so we need a mock →
### Here we will see how to use mock contract in development
- Make a folder named “Test” in contracts folder
- Make a contract with name “Mock_anything”
- Now go to Github link → https://github.com/smartcontractkit/chainlink-mix
- find the mock contract which we need
- And paste it in the file made in our test folder
- And import it whenever needed in a file
## Now we have tested our network in local networks and now we need to test it on a virtual Real Blockchain on our system we use a technique called “Mainnet Forking”
- First We need to add our network in brownie-config.yaml file
- We need to setup our account at “Alchemy”
[Login](https://dashboard.alchemyapi.io/)
- Now we need to copy the keys from our application dashboard

- Add the url to our network adding command
```bash
brownie networks add development mainnet-fork-dev cmd=ganache-cli host=http://127.0.0.1 fork
=URL_HERE accounts=10 mnemonic=brownie port=8545
```
- Now we can run and deploy both on our mainnet-fork network
### our final brownie config file →
```yaml
dependencies:
# - @
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
solc:
remappings:
- "@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1"
dotenv: .env
networks:
rinkeby:
eth_usd_price_feed: "0x839F42a69Cc24F391DC4F09273f494578653edEC"
verify: True
mainnet-fork-dev:
eth_usd_price_feed: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
verify: False
development:
verify: False
ganache-local-gui:
verify: False
wallets:
from_key: ${PRIVATE_KEY}
```
# 🎉 Our another Brownie contract completed