{"id":15065118,"url":"https://github.com/beauwilliams/solidity-reentrancy-attack-example","last_synced_at":"2026-01-29T23:32:42.075Z","repository":{"id":107172650,"uuid":"554452551","full_name":"beauwilliams/Solidity-Reentrancy-Attack-Example","owner":"beauwilliams","description":"Learn how to exploit a reentrancy attack to steal ether. Then see how the exploit is mitigated with the check effects interaction pattern.","archived":false,"fork":false,"pushed_at":"2022-10-21T04:18:30.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T00:17:21.545Z","etag":null,"topics":["ethereum","exploit","security","solidity","solidity-contracts","solidity-language"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beauwilliams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-10-19T20:54:15.000Z","updated_at":"2022-10-20T12:11:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"82473276-5eb6-4e4d-8ad3-28f14a1090a0","html_url":"https://github.com/beauwilliams/Solidity-Reentrancy-Attack-Example","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/beauwilliams%2FSolidity-Reentrancy-Attack-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beauwilliams%2FSolidity-Reentrancy-Attack-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beauwilliams%2FSolidity-Reentrancy-Attack-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beauwilliams%2FSolidity-Reentrancy-Attack-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beauwilliams","download_url":"https://codeload.github.com/beauwilliams/Solidity-Reentrancy-Attack-Example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806114,"owners_count":20350783,"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":["ethereum","exploit","security","solidity","solidity-contracts","solidity-language"],"created_at":"2024-09-25T00:34:28.900Z","updated_at":"2026-01-29T23:32:42.030Z","avatar_url":"https://github.com/beauwilliams.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Solidity-Reentrancy-Attack-Example\n\n## OVERVIEW\n\nThis repo shows a reentrancy attack in action, as well as a fix to mitigate the attack. With tests to show the process of how it all works.\n\n\n\u003cimg width=\"1332\" alt=\"Screen Shot 2022-10-21 at 3 18 12 pm\" src=\"https://user-images.githubusercontent.com/7098556/197110823-9b295c15-fb00-4153-bb6f-de75ee9eadd7.png\"\u003e\n\n\n## GET STARTED\n\nThis project uses a [task runner called just, for convenience](https://github.com/casey/just)\n\n```\nAvailable recipes:\n    default\n    install *PACKAGES\n    update\n    compile\n    compile-watch\n    deploy-localhost\n    deploy-testnet\n    verify-testnet\n    test\n    test-watch\n    lint\n    start\n    format\n    audit\n    print-audit\n    print-gas-usage\n    print-deployments\n    clean\n```\n\n### Running tests and audits\n\n- Run the unit tests with `just test`\n- Statically analyse code for vulnerabilities with `just audit`\n\n\n### Starting a new project from this template\n\n- Clean the workspace (to start a new project, removing example code and scripts) using `just clean`\n- Create your solidity code in `/contracts`, tests in `/test` and deploy/verify scripts in `/scripts`\n\n\n## Available Tasks\n\nSee `./tasks/index.ts` to view available tasks and enable them.\n\nSome might require a little configuration\n\n\n## FAQ\n\n### Error compiling contracts on freshly cloned repo\n\n`Error HH12: Trying to use a non-local installation of Hardhat, which is not supported.\nPlease install Hardhat locally using npm or Yarn, and try again.`\n\nRun `npm i` to fix this error which will install hardhat\n\n### Performance optimizations\nFor faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable TS_NODE_TRANSPILE_ONLY to 1 in hardhat's environment. For more details see the documentation.\n\n\n### Husky\n\nERROR ON COMMIT -\u003e `husky \u003e pre-commit hook failed (add --no-verify to bypass)`\nRESOLUTION -\u003e Remove errors from your smart contracts, found running `npm run lint`, or commit using --no-amend flag to temporarily bypass.\n\n\n### Error running audit task\nEnsure [Slither](https://github.com/crytic/slither) is installed and in your $PATH\n\n## DEMO\n\n![demo](https://i.ibb.co/tY00DR0/Screen-Shot-2022-07-13-at-1-57-15-pm.png)\n\n## TODO\n\n- [ ] Fix prettier plugin sol hint not working nvim (Remove prettier plugin from sol hint.son to fix)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeauwilliams%2Fsolidity-reentrancy-attack-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeauwilliams%2Fsolidity-reentrancy-attack-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeauwilliams%2Fsolidity-reentrancy-attack-example/lists"}