{"id":21307847,"url":"https://github.com/solidstate-network/hardhat-bytecode-exporter","last_synced_at":"2025-07-11T22:32:34.479Z","repository":{"id":61443574,"uuid":"464599738","full_name":"solidstate-network/hardhat-bytecode-exporter","owner":"solidstate-network","description":"🧰 Export Ethereum contract bytecode on compilation ⚙️","archived":false,"fork":false,"pushed_at":"2024-07-30T20:35:06.000Z","size":159,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-11T21:51:30.707Z","etag":null,"topics":["buidler","bytecode","dapps","eth","ether","ethereum","hardhat","smart-contracts","solc","solidity","version-control","wow"],"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/solidstate-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-02-28T18:33:01.000Z","updated_at":"2024-07-30T20:35:09.000Z","dependencies_parsed_at":"2024-06-21T10:07:46.203Z","dependency_job_id":"b0ee4465-5d62-41d3-ab30-03dbfad7bc82","html_url":"https://github.com/solidstate-network/hardhat-bytecode-exporter","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":"0.21739130434782605","last_synced_commit":"c803d272d13042f8cc6db607b417e35b41761f65"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidstate-network%2Fhardhat-bytecode-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidstate-network%2Fhardhat-bytecode-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidstate-network%2Fhardhat-bytecode-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidstate-network%2Fhardhat-bytecode-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidstate-network","download_url":"https://codeload.github.com/solidstate-network/hardhat-bytecode-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225764070,"owners_count":17520576,"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":["buidler","bytecode","dapps","eth","ether","ethereum","hardhat","smart-contracts","solc","solidity","version-control","wow"],"created_at":"2024-11-21T16:34:36.884Z","updated_at":"2024-11-21T16:34:37.549Z","avatar_url":"https://github.com/solidstate-network.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Bytecode Exporter\n\nExport Ethereum smart contract bytecode on compilation via Hardhat.\n\n## Installation\n\n```bash\nnpm install --save-dev @solidstate/hardhat-bytecode-exporter\n# or\nyarn add --dev @solidstate/hardhat-bytecode-exporter\n```\n\n## Usage\n\nLoad plugin in Hardhat config:\n\n```javascript\nrequire('@solidstate/hardhat-bytecode-exporter');\n```\n\nAdd configuration under the `bytecodeExporter` key:\n\n| option         | description                                                                                                                                            | default        |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |\n| `path`         | path to bytecode export directory (relative to Hardhat root)                                                                                           | `'./bytecode'` |\n| `runOnCompile` | whether to automatically export bytecode during compilation                                                                                            | `false`        |\n| `clear`        | whether to delete old bytecode files in `path` on compilation                                                                                          | `false`        |\n| `flat`         | whether to flatten output directory (may cause name collisions)                                                                                        | `false`        |\n| `only`         | `Array` of `String` matchers used to select included contracts, defaults to all contracts if `length` is 0                                             | `[]`           |\n| `except`       | `Array` of `String` matchers used to exclude contracts                                                                                                 | `[]`           |\n| `rename`       | `Function` with signature `(sourceName: string, contractName: string) =\u003e string` used to rename an exported bytecode (incompatible with `flat` option) | `undefined`    |\n\nNote that the configuration formatted as either a single `Object`, or an `Array` of objects. An `Array` may be used to specify multiple outputs.\n\n```javascript\nbytecodeExporter: {\n  path: './data',\n  runOnCompile: true,\n  clear: true,\n  flat: true,\n  only: [':ERC20$'],\n}\n\n// or\n\nbytecodeExporter: [\n  {\n    path: './only',\n    runOnCompile: true,\n    only: [':ERC20$'],\n  },\n  {\n    path: './except',\n    except: [':ERC20$'],\n  },\n]\n```\n\nThe included Hardhat tasks may be run manually:\n\n```bash\nnpx hardhat export-bytecode\nnpx hardhat clear-bytecode\n# or\nyarn run hardhat export-bytecode\nyarn run hardhat clear-bytecode\n```\n\nBy default, the hardhat `compile` task is run before exporting bytecode. This behavior can be disabled with the `--no-compile` flag:\n\n```bash\nnpx hardhat export-bytecode --no-compile\n# or\nyarn run hardhat export-bytecode --no-compile\n```\n\nThe `path` directory will be created if it does not exist.\n\nThe `clear` option is set to `false` by default because it represents a destructive action, but should be set to `true` in most cases.\n\nBytecode files are saved as a flat bin file in the format `[CONTRACT_NAME].bin`.\n\n## Development\n\nInstall dependencies via Yarn:\n\n```bash\nyarn install\n```\n\nSetup Husky to format code on commit:\n\n```bash\nyarn prepare\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidstate-network%2Fhardhat-bytecode-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidstate-network%2Fhardhat-bytecode-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidstate-network%2Fhardhat-bytecode-exporter/lists"}