Code Monkey home page Code Monkey logo

k-konstantinidis / fund-me-brownie Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 9 KB

Smart contract that lets anyone deposit ETH. Only the owner of the contract can withdraw the ETH. Python scripts to deploy the contract, fund the contract and withdraw the money. Python tests to test the contract.

License: MIT License

Solidity 68.01% Python 31.99%
python solidity alchemyapi brownie brownie-eth etherscan-api ganache ganache-cli goerli infura-api

fund-me-brownie's Introduction

Fund-me-Brownie

FundMe.sol

A smart contract to:

  • Fund the contract
  • Add an EntranceFee
  • Withdraw the money if you are the owner
  • Convert sent money to USD
  • Get ETH current price

MockV3Aggregator.sol

  • Deploy mocks

Deploy.py

A python script to:

  • Connect to a Blockchain (Testnet, Mainnet)
  • Get an account safely
    • From a local or a forked local blockchain environment
    • A real one via the config & .env file
  • Pass the price feed address to our contract
    • A real one if we are on a real network
    • A mock one if we are on a local blockchain environment
  • Deploy our contract

Essential_Scripts.py

  • Get an account safely
    • From a local or a forked local blockchain environment
    • A real one via the config & .env file
  • Deploy mocks

Fund_And_Withdraw.py

  • Fund our contract
  • Withdraw the money from the contract

Test_Fund_Me.py

  • Test if we can fund and withdraw money
  • Test if only the owner can withdraw money

Help with the project

To run the code there are some requirements. You must install:

pipx

Install pipx by running the following on the command line: python -m pip install --user pipx then python3 -m pipx ensurepath

For more information check: Install pipx

Brownie

Install Brownie by running the following on the command line: pip install eth-brownie

For more information check: Install Brownie

This is the Lesson 6 of the freeCodeCamp.org tutorial: https://www.youtube.com/watch?v=M576WGiDBdQ with more comments.

fund-me-brownie's People

Contributors

k-konstantinidis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.