Skip to content

ibourn/foundry-fund-me-html

Repository files navigation

foundry-fund-me-html

This is a section of the Cyfrin Foundry Solidity Course. ⭐️ (2:37:02) | Lesson 8: HTML Fund Me

This is a front end to interact with the contract of foundry-fund-me

This is a minimalistic example what you can find in the metamask docs.

Requirements

  • git
    • You'll know you've installed it right if you can run:
      • git --version
  • Metamask
    • This is a browser extension that lets you interact with the blockchain.

Quickstart

  1. Clone the repo
git clone https://github.com/ibourn/foundry-fund-me-html
cd foundry-fund-me-html
  1. Run the file.

You can usually just double click the file to "run it in the browser". Or you can right click the file in your VSCode and run "open with live server".

And you should see a small button that says "connect".

Hit it, and you should see metamask pop up.

Execute a transaction

If you want to execute a transaction follow this:

Make sure you have the following installed:

  1. You'll need to open up a second terminal and run:
git clone https://github.com/ibourn/foundry-fund-me
cd foundry-fund-me
make build
make anvil

Then, in a second terminal

make deploy

This will deploy a sample contract and start a local hardhat blockchain.

  1. Update your constants.js with the new contract address.

In your constants.js file, update the variable contractAddress with the address of the deployed "FundMe" contract. You'll see it near the top of the hardhat output.

  1. Connect your metamask to your local hardhat blockchain.

PLEASE USE A METAMASK ACCOUNT THAT ISNT ASSOCIATED WITH ANY REAL MONEY. I usually use a few different browser profiles to separate my metamasks easily.

In the output of the above command, take one of the private key accounts and import it into your metamask.

Additionally, add your localhost with chainid 31337 to your metamask.

  1. Refresh the front end, input an amount in the text box, and hit fund button after connecting

About

Cyfrin-Updraft foundry course

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •