Skip to content

tdavis3/mountcarlo

Repository files navigation

Mount Carlo

This repository contains the Mount Carlo project.

Quick start

Once installed, run Hardhat's testing network:

npx hardhat node

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

npx hardhat run scripts/deploy.js --network localhost

Finally, we can run the frontend with:

cd client
npm install
npm start

Use the faucet to send yourself some test eth:

npx hardhat --network localhost faucet <address here>

You can also interact with the contract in the console (https://docs.openzeppelin.com/learn/deploying-and-interacting)

$ npx hardhat console --network localhost

> const MountC = await ethers.getContractFactory("MountCarlo")
> undefined
>
> const mc = await MountC.attach("<address>")
> undefined
>
> await box.retrieve()
> BigNumber { _hex: '0x2a', _isBigNumber: true }

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 the Dapp. You will need to have Metamask installed and listening to localhost 8545.

The environment?

Powered by Hardhat and React.

  • Hardhat: An Ethereum development task runner and testing network.
  • Mocha: A JavaScript test runner.
  • Chai: A JavaScript assertion library.
  • ethers.js: A JavaScript library for interacting with Ethereum.
  • Waffle: To have Ethereum-specific Chai assertions/mathers.

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.

About

A Fomo3D spin-off on Ethereum

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published