Giter Club home page Giter Club logo

ethernaut's Introduction

Ethernaut

Twitter Follow OpenZeppelin Forum

Ethernaut is a Web3/Solidity based wargame inspired by overthewire, to be played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'.

The game acts both as a tool for those interested in learning ethereum, and as a way to catalogue historical hacks as levels. There can be an infinite number of levels and the game does not require to be played in any particular order.

Deployed Versions

You can find the current, official version at: ethernaut.openzeppelin.com

Install and Build

There are three components to Ethernaut that are needed to run/deploy in order to work with it locally:

  • Test Network - A testnet that is running locally, like gnache, hardhat network, geth, etc
  • Contract Deployment - In order to work with the contracts, they must be deployed to the locally running testnet
  • The Client/Frontend - This is a React app that runs locally and can be accessed on localhost:3000

In order to install, build, and run Ethernaut locally, follow these instructions:

  1. Clone the repo and install dependencies:

    git clone [email protected]:OpenZeppelin/ethernaut.git
    yarn install
  2. Start deterministic rpc

    yarn network
  3. Import one of the private keys from the ganache-cli output to your Metamask wallet.

  4. Compile contracts

    yarn compile:contracts
  5. Set client/src/constants.js ACTIVE_NETWORK to NETWORKS.LOCAL

  6. Deploy contracts

    yarn deploy:contracts
  7. Start Ethernaut locally

    yarn start:ethernaut

Running locally (ropsten network)

The same as using the local network but steps 2, 3 and 6 are not necessary.

In this case, replace point 5 with: 5. Set client/src/constants.js ACTIVE_NETWORK to NETWORKS.ROPSTEN

Running tests

yarn test:contracts

Building

yarn build:ethernaut

Deploying

To deploy the contracts on ropsten, first set the ACTIVE_NETWORK variable in constants.js and then edit gamedata.json. This file keeps a history of all level instances in each level data's deployed_ropsten array. To deploy a new instance, add an "x" entry to the array, like so:

"deployed_ropsten": [
  "x",
  "0x4b1d5eb6cd2849c7890bcacd63a6855d1c0e79d5",
  "0xdf51a9e8ce57e7787e4a27dd19880fd7106b9a5c"
],

Then run yarn deploy:contracts. This action will effectively deploy a new version of the level data item whose deployed_ropsten array was updated, and will point the ethernaut dapp to use this new deployed contract instance for the level.

Contributing

Contributions and corrections are always welcome!

Please follow the Contributor's Guide if you would like to help out.

ethernaut's People

Contributors

theethernaut avatar xaler5 avatar kylriley avatar ericnordelo avatar martriay avatar nczhu avatar spalladino avatar frangio avatar agemanning avatar dependabot[bot] avatar 0age avatar renovate[bot] avatar hensha256 avatar come-maiz avatar paulinablaszk avatar scottt avatar pumpkingwok avatar bergarces avatar jeremyfelder avatar patrickalphac avatar roylee avatar ctholho avatar sinsinpurin avatar robriks avatar shamaleyte avatar sunrentao avatar tinchoabbate avatar callmegwei avatar lodotek avatar emhane 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.