{"id":13620459,"url":"https://github.com/OpenZeppelin/ethernaut","last_synced_at":"2025-04-14T21:31:16.727Z","repository":{"id":37285878,"uuid":"111001784","full_name":"OpenZeppelin/ethernaut","owner":"OpenZeppelin","description":"Web3/Solidity based wargame","archived":false,"fork":false,"pushed_at":"2024-11-06T19:05:45.000Z","size":19588,"stargazers_count":1982,"open_issues_count":51,"forks_count":679,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-11-06T19:35:47.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenZeppelin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-16T17:31:13.000Z","updated_at":"2024-11-03T12:34:34.000Z","dependencies_parsed_at":"2024-06-21T13:59:30.375Z","dependency_job_id":"cb578b4a-c4ce-4a85-821e-24ae5c1cc60c","html_url":"https://github.com/OpenZeppelin/ethernaut","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fethernaut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fethernaut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fethernaut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fethernaut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenZeppelin","download_url":"https://codeload.github.com/OpenZeppelin/ethernaut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223647922,"owners_count":17179345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:00:56.023Z","updated_at":"2024-11-08T07:30:23.932Z","avatar_url":"https://github.com/OpenZeppelin.png","language":"JavaScript","readme":"# Ethernaut\n \n[![Twitter Follow](https://img.shields.io/twitter/follow/OpenZeppelin?style=plastic\u0026logo=twitter)](https://twitter.com/OpenZeppelin)\n[![OpenZeppelin Forum](https://img.shields.io/badge/Ethernaut%20Forum%20-discuss-blue?style=plastic\u0026logo=discourse)](https://forum.openzeppelin.com/tag/ethernaut)\n\nEthernaut is a Web3/Solidity based wargame inspired by [overthewire](https://overthewire.org), to be played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'.\n\nThe 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.\n\n## Deployed Versions\n\nYou can find the current, official version at: [ethernaut.openzeppelin.com](https://ethernaut.openzeppelin.com)\n\n## Install and Build\n\nThere are three components to Ethernaut that are needed to run/deploy in order to work with it locally:\n\n- Test Network - A testnet that is running locally, like ganache, hardhat network, geth, etc\n- Contract Deployment - In order to work with the contracts, they must be deployed to the locally running testnet\n- The Client/Frontend - This is a React app that runs locally and can be accessed on localhost:3000\n\nIn order to install, build, and run Ethernaut locally, follow these instructions:\n\n0. Be sure to use a compatible Node version. If you use `nvm` you can run `nvm use` at the root level to be sure to select a compatible version.\n\n1. Clone the repo and install dependencies:\n\n    ```bash\n    git clone git@github.com:OpenZeppelin/ethernaut.git\n    yarn install\n    ```\n\n2. Start deterministic rpc\n\n    ```bash\n    yarn network\n    ```\n\n3. Import one of the private keys from the ganache-cli output to your Metamask wallet.\n4. Compile contracts\n\n    ```bash\n    yarn compile:contracts\n    ```\n\n5. Set `client/src/constants.js` `ACTIVE_NETWORK` to `NETWORKS.LOCAL`\n6. Deploy contracts\n\n    ```bash\n    yarn deploy:contracts\n    ```\n\n7. Start Ethernaut locally\n\n    ```bash\n    yarn start:ethernaut\n    ```\n\n### Running locally (sepolia network)\n\nThe same as using the local network but steps 2, 3 and 6 are not necessary.\n\nIn this case, replace point 5 with:\n5. Set `client/src/constants.js` `ACTIVE_NETWORK` to `NETWORKS.SEPOLIA`\n\n### Running tests\n\n```bash\nyarn test:contracts\n```\n\n### Building\n\n```bash\nyarn build:ethernaut\n```\n\n### Deploying\n\nYou will normally need to deploy it on a local network, for this you can just run `yarn deploy:contracts` and all the contracts will be deployed on your local node running on `localhost:8545` and you will be able to check each level address in the `deploy.local.json` file.\n\nTo deploy the contracts on Sepolia, first set the `ACTIVE_NETWORK` variable in `constants.js` and then edit `deploy.sepolia.json`. This file keeps a history of all level and contract instances. To deploy a new instance, add an \"x\" entry to the array, like so:\n\n```json\n{\n  \"0\": \"x\",\n  \"1\": \"0x4b1d5eb6cd2849c7890bcacd63a6855d1c0e79d5\",\n  \"2\": \"0xdf51a9e8ce57e7787e4a27dd19880fd7106b9a5c\",\n  ...\n},\n```\n\nThen run `yarn deploy:contracts`.\n\n## Contributing\n\nContributions and corrections are always welcome!\n\nPlease follow the [Contributor's Guide](./CONTRIBUTING.md) if you would like to help out.\n","funding_links":[],"categories":["Solidity","Resources","开源项目","四、安全开发与审计（重中之重）","Smart Contract Platforms"],"sub_categories":["Rust区块链项目","1. 安全学习与实战"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenZeppelin%2Fethernaut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenZeppelin%2Fethernaut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenZeppelin%2Fethernaut/lists"}