Skip to content

Boda805/elmo

Repository files navigation

Hardhat Hackathon Boilerplate

This repository contains a sample project that you can use as the starting point for your Ethereum project. It's also a great fit for learning the basics of smart contract development.

This project is intended to be used with the Hardhat Beginners Tutorial, but you should be able to follow it by yourself by reading the README and exploring its contracts, tests, scripts and frontend directories.

Quick start

The first things you need to do are cloning this repository and installing its dependencies:

git clone https://github.com/boda805/elmo.git
cd elmo
yarn install-all

Then we can compile contracts for the EVM:

yarn compile

Start the optimistic ethereum L1/L2 locally. See pinned message in Discord for now.

In order to compile contracts for optimistic ethereum, we need to install the OVM compiler. We also need to install the OVM base contracts as well as a "watcher" utility that "helps watch and waits for messages to be relayed between L1 and L2":

yarn add @eth-optimism/hardhat-ovm \
  @eth-optimism/contracts \
  @eth-optimism/watcher
yarn compile-ovm

Then, on a new terminal, go to the repository's root folder and run this to deploy your contract:

yarn deploy-ovm

Finally, we can run the frontend with:

yarn start-frontend

Note: There's an issue in ganache-core that can make the npm install step fail.

If you see npm ERR! code ENOLOCAL, try running npm ci instead of npm install.

Open http://localhost:3000/ to see your Dapp. You will need to have Metamask installed and listening to localhost 8545.

User Guide

You can find detailed instructions on using this repository and many tips in its documentation.

For a complete introduction to Hardhat, refer to this guide.

What’s Included?

Your environment will have everything you need to build a Dapp powered by Hardhat and React.

Troubleshooting

  • Invalid nonce errors: if you are seeing this error on the npx hardhat node console, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed by Settings > Advanced > Reset Account.

Feedback, help and news

We'd love to have your feedback on this tutorial. Feel free to reach us through this repository or our Discord server.

Also you can follow us on Twitter.

Happy buidling!