{"id":41940865,"url":"https://github.com/playmint/hardhat-starknet-compile","last_synced_at":"2026-01-25T18:37:36.506Z","repository":{"id":57683417,"uuid":"490723971","full_name":"playmint/hardhat-starknet-compile","owner":"playmint","description":"A plugin for hardhat which compiles your StarkNet contracts for you.","archived":false,"fork":false,"pushed_at":"2022-05-26T11:14:22.000Z","size":707,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T18:17:31.359Z","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":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/playmint.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}},"created_at":"2022-05-10T14:06:05.000Z","updated_at":"2023-12-17T07:25:35.000Z","dependencies_parsed_at":"2022-09-19T00:31:57.700Z","dependency_job_id":null,"html_url":"https://github.com/playmint/hardhat-starknet-compile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/playmint/hardhat-starknet-compile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playmint%2Fhardhat-starknet-compile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playmint%2Fhardhat-starknet-compile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playmint%2Fhardhat-starknet-compile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playmint%2Fhardhat-starknet-compile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playmint","download_url":"https://codeload.github.com/playmint/hardhat-starknet-compile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playmint%2Fhardhat-starknet-compile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28756442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: 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":[],"created_at":"2026-01-25T18:37:36.449Z","updated_at":"2026-01-25T18:37:36.500Z","avatar_url":"https://github.com/playmint.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/playmint/hardhat-starknet-compile/main/hardhat-starknet-compile.png\" width=\"300\" height=\"300\"/\u003e\n\n[![NPM Package](https://img.shields.io/npm/v/@playmint/hardhat-starknet-compile.svg?style=flat-square)](https://www.npmjs.com/package/@playmint/hardhat-starknet-compile)\n---\n# hardhat-starknet-compile\nA plugin for hardhat which compiles your StarkNet contracts for you.\n\n## How it Works\nWhen you run a script with Hardhat (e.g. `npx hardhat run scripts/deploy.ts`), Hardhat automatically runs the `compile` task which compiles any Solidity contracts which have changed since the last time compilation occurred. This plugin creates a new task called `starknet-compile` which does the same thing for your StarkNet contracts (compiles them, but only the ones which have changed since the last time the task was run). It also extends Hardhat's `compile` task so that it runs `starknet-compile` straight after, this means that whenever you run a script with Hardhat, both your Solidity and StarkNet contracts will be compiled.\n\n## Installation\nInstall with npm:\n\n`npm i --save-dev @playmint/hardhat-starknet-compile`\n\nThen import in your hardhat.config file:\n\n```ts\nimport \"@playmint/hardhat-starknet-compile\";\n```\n\n## How to use\n- run a script and your StarkNet contracts will be automatically compiled if necessary (e.g. `npx hardhat run scripts/deploy.ts`), or\n- run the `compile` task (`npx hardhat compile`), or\n- run the `starknet-compile` task (`npx hardhat starknet-compile`)\n\nThe artifacts created can be used with [StarkNet.js](https://www.starknetjs.com/), or with [starknet-hardhat-plugin](https://github.com/Shard-Labs/starknet-hardhat-plugin).\n\nOnly contracts which have changed (or their dependencies have) will be compiled, if you want to force a contract to recompile you can delete its .json files which will be in the Starknet artifacts directory, or delete the cairo files cache.\n\nIf you use a python venv for your starknet development environment, make sure you launch vscode from your venv.\n\n## Using with [starknet-hardhat-plugin](https://github.com/Shard-Labs/starknet-hardhat-plugin)\nThis plugin can be used alongside starknet-hardhat-plugin, the artifacts it outputs are in a compatible layout such that starknet-hardhat-plugin will find them for contract factories etc. The only thing to know is that you should import `hardhat-starknet-compile` *after* `starknet-hardhat-plugin`, this is because both of these plugins define a task called `starknet-compile`, so if you import them in the wrong order then the version of `starknet-compile` that is executed will be the one from `starknet-hardhat-plugin` which compiles all StarkNet contracts regardless of whether they've changed or not.\n\n## Configuration\nBy default the plugin will look for Starknet contracts in Hardhat's `sources` path (by default this is `contracts`). You can change this in your Hardhat config by setting `starknetSources` in `paths`.\n\nBy default the plugin will save build artifacts of Starknet contracts to `artifacts-starknet`, you can change this in your Hardhat config by setting `starknetArtifacts` in `paths`.\n\nWhen the starknet compiler is invoked, the working directory used is the root directory of the project. The plugin passes the Starknet sources path as `--cairo_path`, but you can add extra paths to this in your Hardhat config by adding them to `cairoPath` in `paths`.\n\n```ts\nimport { HardhatUserConfig } from \"hardhat/types\";\nimport \"@playmint/starknet-hardhat-compile\";\n\n\nconst config: HardhatUserConfig = {\n    paths: {\n        starknetSources: \"starknetContracts\",\n        starknetArtifacts: \"artifactsDir\",\n        cairoPath: [\"starknet-libs\", \"thirdparty-starknet-libs\"]\n    }\n}\n\nexport default config;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaymint%2Fhardhat-starknet-compile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaymint%2Fhardhat-starknet-compile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaymint%2Fhardhat-starknet-compile/lists"}