Coder Social home page Coder Social logo

solidity_fundme's Introduction

Solidity Fund Me

Leaning smart contract whereby account users can fund and withdraw ETH ๐Ÿ“Š

Here are some features of this smart contract:

  • allows user to fund the smart contract with minimum amount of 50 USD
  • allows user to fully withdraw their fund, leaving the smart contract with balance of zero
  • ensures that only those who fund the smart contract can withdraw ETH

Website Preview

Alt text

What I learnt:

  • how to use ether.js and hardhat
  • fetching latest ETH price in USD from chainlink price feed
  • optimize gas cost by storing state variables from storage to memory
  • include Goerli RPC Endpoints using Alchemy
  • writing unit and staging test

To be improved:

  • Allow to switch between networks
  • Allow to switch between users

Quickstart

  1. Clone the repo
git clone https://github.com/meikei-99/hardhat-fund-me.git

  1. To execute a transaction, you will need to start a local hardhat blocchain
npx hardhat node / yarn hardhat node
  1. Update constants.js with new contract address
  2. Connect MetaMask to local hardhat blockchain (chainId:31337)

Credits go to @freeCodeCamp and @PatrickAlphaC who provide guidance in writing this piece.

solidity_fundme's People

Contributors

meikei-99 avatar

Watchers

 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.