{"id":13766762,"url":"https://github.com/huff-language/huff-debug","last_synced_at":"2025-05-10T22:31:16.902Z","repository":{"id":39029093,"uuid":"499793993","full_name":"huff-language/huff-debug","owner":"huff-language","description":"WIP: Hevm based debugger for hardhat-huff projects","archived":true,"fork":false,"pushed_at":"2023-03-09T15:13:39.000Z","size":135,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-17T02:34:13.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/huff-language.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-06-04T10:30:19.000Z","updated_at":"2024-09-09T19:55:34.000Z","dependencies_parsed_at":"2024-01-11T23:43:42.856Z","dependency_job_id":null,"html_url":"https://github.com/huff-language/huff-debug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"NomicFoundation/hardhat-ts-plugin-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huff-language%2Fhuff-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huff-language%2Fhuff-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huff-language%2Fhuff-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huff-language%2Fhuff-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huff-language","download_url":"https://codeload.github.com/huff-language/huff-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"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-03T16:01:00.569Z","updated_at":"2025-05-10T22:31:16.589Z","avatar_url":"https://github.com/huff-language.png","language":"TypeScript","funding_links":[],"categories":["Official huff-language Github repo"],"sub_categories":[],"readme":"# Huff Debug\n\n_An easy hevm debug integration for hardhat-huff projects_\n \n## What does it do:\n\nSpeed up your development experience by gaining rich feedback in a [hevm](https://github.com/dapphub/dapptools/tree/master/src/hevm) debugger, step through each opcode of your huff projects line by line to find out what went wrong and spot possible optimizations.\n\n\n### What is [hevm](https://github.com/dapphub/dapptools/tree/master/src/hevm)\n\nIn the words of the developers themselves: _The hevm project is an implementation of the Ethereum virtual machine (EVM) made specifically for symbolic execution, unit testing and debugging of smart contracts. It is developed by DappHub and integrates especially well with the dapp tool suite. The hevm command line program can symbolically execute smart contracts, run unit tests, interactively debug contracts while showing the Solidity source, or run arbitrary EVM code. Computations can be performed using local state set up in a dapp testing harness, or fetched on demand from live networks using rpc calls._\n\nMore importantly hevm supports an interactive debugger, this allows you to step through execution of arbitrary bytecode line by line, seeing that huff exposes the developer to the evm directly you can essentially debug your huff projects  line by line. \n\n## Installation\n**REQUIRED**\nThis plugin has a strong dependency in hevm existing within your $PATH. (It wont work at all without it). Before going any further [please install it here](https://github.com/dapphub/dapptools#installation).\n\nOnce that is taken care of, go ahead and install hardhat huff and the huff-debug package using your favourite node package manager:\n```bash\nnpm install hardhat-huff huff-debug\n```\n\nImport the plugin in your `hardhat.config.js`:\n\n```js\nrequire(\"huff-debug\");\n```\n\nOr if you are using TypeScript, in your `hardhat.config.ts`:\n\n```ts\nimport \"huff-debug\";\n```\n\n\n## Required plugins\n\n- [@hardhat-huff](https://github.com/huff-language/hardhat-huff)\n\n## Tasks\n\n### huff-debug\n\nThis plugin adds the `huff-debug` task to hardhat.\n#### Usage:\n```\nnpx hardhat help huff-debug \nHardhat version 2.8.0\n\nUsage: hardhat [GLOBAL OPTIONS] huff-debug [--reset] [--state] file func args\n\nOPTIONS:\n\n  --reset       Reset hevm state \n  --state       Use maintained hevm state \n\nPOSITIONAL ARGUMENTS:\n\n  file          -- The file name that the target function exists within\n  func          -- The function name being targeted\n  args          -- Comma separated list of function arguments e.g. - 0x0000000000000000000000000000000000000069,1\n\nhuff-debug: \n\nFor global options help run: hardhat help\n```\n\nA huff interface consists of definitions that looks as follows:\n`#define function mint(address,uint256) nonpayable returns ()`\nThe anatomy of this definition is something like this: \n`function \u003cfunctionName\u003e(\u003cargs\u003e) \u003cdecorators\u003e`\n\nTo run your function with huff-debug simply name your target file, function name and args!\n\nFull example: `npx hardhat huff-debug ERC721.huff mint 0x0000000000000000000000000000000000000069,1`\nThis will step through execution of the mint function within your ERC721 huff contract with the args address=0x0000000000000000000000000000000000000069 and amount=1.\n\n### Options\n**--state**\nWhen debugging you may have a transaction that relys on some existing contract state. A typical example of this would be calling a function with some form of access protection, the most common of these is the onlyOwner modifier for calling sensitive functions. Debugging these calls will ALWAYS fail is you have not provided the state flag as the OWNER will be set to the zero address. Making any future logic unaccessible. Providing the state flag will persist any storage updates that are made. \nState is stored as a git repository within the cache folder - see the [hevm docs](https://github.com/dapphub/dapptools/blob/master/src/hevm/README.md#hevm-exec) for more information.\n\n**--reset**\nThis flag provides a fresh hevm state, read above for more info on state.\n\n\n\n# Contributors\nBelow is only relevant if you are reading this to contribute to the project!\nFor any feature requests please open a github issue, if you want to get your hands dirty feel free to pull and create a pull request!! \n\n## Installation\n\nTo start working on your project, just run\n\n```bash\nnpm install\n```\n\n## Plugin development\n\nMake sure to read our [Plugin Development Guide](https://hardhat.org/advanced/building-plugins.html) to learn how to build a plugin.\n\n## Testing\n\nRunning `npm run test` will run every test located in the `test/` folder. They\nuse [mocha](https://mochajs.org) and [chai](https://www.chaijs.com/),\nbut you can customize them.\n\nWe recommend creating unit tests for your own modules, and integration tests for\nthe interaction of the plugin with Hardhat and its dependencies.\n\n## Linting and autoformat\n\nAll of Hardhat projects use [prettier](https://prettier.io/) and\n[tslint](https://palantir.github.io/tslint/).\n\nYou can check if your code style is correct by running `npm run lint`, and fix\nit with `npm run lint:fix`.\n\n## Building the project\n\nJust run `npm run build` ️👷\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuff-language%2Fhuff-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuff-language%2Fhuff-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuff-language%2Fhuff-debug/lists"}