{"id":25420202,"url":"https://github.com/dl-solarity/hardhat-smart-compare","last_synced_at":"2026-03-11T15:13:21.277Z","repository":{"id":65281389,"uuid":"577868117","full_name":"dl-solarity/hardhat-smart-compare","owner":"dl-solarity","description":"Hardhat plugin to deeply compare smart contracts","archived":false,"fork":false,"pushed_at":"2024-03-12T12:37:25.000Z","size":504,"stargazers_count":16,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-18T08:55:01.483Z","etag":null,"topics":["diff","hardhat","hardhat-plugin","solarity"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@solarity/hardhat-smart-compare","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/dl-solarity.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-13T17:55:39.000Z","updated_at":"2024-01-05T21:51:05.000Z","dependencies_parsed_at":"2024-10-23T01:51:58.967Z","dependency_job_id":"332e69d7-e3d0-4717-b88d-c2a62148a583","html_url":"https://github.com/dl-solarity/hardhat-smart-compare","commit_stats":{"total_commits":60,"total_committers":3,"mean_commits":20.0,"dds":"0.30000000000000004","last_synced_commit":"39d501641346208754b43a13b601100fffbb4c0d"},"previous_names":["dl-solidity-library/hardhat-smart-compare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dl-solarity/hardhat-smart-compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fhardhat-smart-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fhardhat-smart-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fhardhat-smart-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fhardhat-smart-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dl-solarity","download_url":"https://codeload.github.com/dl-solarity/hardhat-smart-compare/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fhardhat-smart-compare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30385362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["diff","hardhat","hardhat-plugin","solarity"],"created_at":"2025-02-16T19:36:25.564Z","updated_at":"2026-03-11T15:13:21.244Z","avatar_url":"https://github.com/dl-solarity.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # ([![npm]\u0026#40;https://img.shields.io/npm/v/@solarity/hardhat-smart-compare.svg\u0026#41;]\u0026#40;https://www.npmjs.com/package/@solarity/hardhat-smart-compare\u0026#41; [![hardhat]\u0026#40;https://hardhat.org/buidler-plugin-badge.svg?1\u0026#41;]\u0026#40;https://hardhat.org\u0026#41;)\n\n# Hardhat Smart Compare\n\n[Hardhat](https://hardhat.org) plugin to compare contracts between upgrades to ensure storage compatibility. \n\n## What\n\nThis plugin generates a storage layout snapshot of the contracts in the project.\nIt is precious for upgradable systems, as it helps you verify that the storage layout of the proxy contracts \nremains unchanged after the upgrade is done.\n\n## Installation\n\n```bash\nnpm install --save-dev @solarity/hardhat-smart-compare\n```\n\nAnd add the following statement to your `hardhat.config.js`:\n\n```js\nrequire(\"@solarity/hardhat-smart-compare\");\n```\n\nOr, if you are using TypeScript, add this to your `hardhat.config.ts`:\n\n```ts\nimport \"@solarity/hardhat-smart-compare\";\n```\n\n## Tasks\n\nThere are two tasks:\n\n* `storage:save` task, which allows you to save the snapshot of the storage layout.\n* `storage:compare` task, which allows you to compare the current version of contracts with the previously saved snapshot.\n\nTo view the available options, run the command (help command):\n\n```bash\nnpx hardhat help storage:save \nnpx hardhat help storage:compare \n```\n\n## Environment extensions\n\nThis plugin does not extend the environment.\n\n## Usage\n\nTo make a snapshot of the storage layout, run the following command:\n\n```bash\nnpx hardhat storage:save\n```\n\nTo compare the current version of contracts with the previously saved snapshot, run the following command:\n\n```bash\nnpx hardhat storage:compare\n```\n\n### How it works\n\nThe plugin completes the `compile` task, retrieves artifacts from the *Hardhat Runtime Environment (HRE)*, and performs the following actions depending on the task:\n\n- `save`: \n\nIt will parse the `build-info` file to get the compiler output and retrieve storage layout of contracts from the \n`outputSelection` field.\nAfter that it will parse and save the storage layout for each contract with an inheritance \"map\" in a JSON file.\n\n- `compare`:\n\nInitially, it will execute the same steps as the `save` task. \nIt will then thoroughly compare the existing snapshot and the newly generated version, scrutinizing each field and type. \nUltimately, if the `--print-diff` flag is provided, it will display any differences that were identified.\n\n### Configuration\n\nThe default configuration looks as follows. You may customize all fields in your **hardhat config** file.\n\n```js\nmodule.exports = {\n  compare: {\n    snapshotPath: \"./storage_snapshots\",\n    snapshotFileName: \"storage_snapshot.json\",\n  },\n};\n```\n\n### Parameter explanation\n\n* `snapshotPath`: Path to the directory where the storage layout snapshot is saved.\n* `snapshotFileName`: File name of the snapshot.\n\n## Known limitations\n\n* Doesn't detect non-storage variables changes.\n* Printed results are hard to comprehend.\n* `Vyper` is currently not supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fhardhat-smart-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdl-solarity%2Fhardhat-smart-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fhardhat-smart-compare/lists"}