Giter Site home page Giter Site logo

event-challenge's Introduction

Starter Hardhat Project for Event Challenge

After cloning the github, you will want to do the following to get the code running on your computer.

  1. Inside the project directory, in the terminal type: npm i
  2. Open two additional terminals in your VS code
  3. In the second terminal type: npx hardhat node
  4. In the third terminal, type: npx hardhat run --network localhost scripts/deploy.js
  5. Back in the first terminal, type: npx hardhat console --network localhost
  6. Then we'll use this command to attach our smart contract to our console: const bank = await (await ethers.getContractFactory("Bank")).attach("0x5FbDB2315678afecb367f032d93F642f64180aa3")

Once the contract is attached, you can go ahead and call the smart contract functions!

Here is an example you can run using our hardhat provided accounts:

  1. await bank.deposit("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", 1)
  2. await bank.getBalance("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
  3. await bank.transfer("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", 1)
  4. await bank.getBalance("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
  5. await bank.getBalance("0x70997970C51812dc3A010C7d01b50e0d17dc79C8")
  6. await bank.withdraw("0x70997970C51812dc3A010C7d01b50e0d17dc79C8", 1)
  7. await bank.getBalance("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")

event-challenge's People

Contributors

metacrafterchris avatar gks2022004 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.