Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xSpaceShard/starknet-hardhat-example
Examples of how Starknet Hardhat plugin can be used.
https://github.com/0xSpaceShard/starknet-hardhat-example
example-project hardhat plugin starknet starkware
Last synced: 3 months ago
JSON representation
Examples of how Starknet Hardhat plugin can be used.
- Host: GitHub
- URL: https://github.com/0xSpaceShard/starknet-hardhat-example
- Owner: 0xSpaceShard
- Created: 2021-09-23T09:09:56.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T04:41:21.000Z (5 months ago)
- Last Synced: 2024-06-18T05:48:02.417Z (5 months ago)
- Topics: example-project, hardhat, plugin, starknet, starkware
- Language: TypeScript
- Homepage:
- Size: 1.67 MB
- Stars: 88
- Watchers: 8
- Forks: 29
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starknet - starknet-hardhat-example
README
# Basic Sample Hardhat Project - with Starknet Plugin
This project demonstrates a basic Hardhat project, but with [Starknet plugin](https://github.com/0xSpaceShard/starknet-hardhat-plugin).
## Get started
#### Clone this repo
```
git clone [email protected]:0xSpaceShard/starknet-hardhat-example.git
cd starknet-hardhat-example
```#### Install dependencies
```
npm ci
```#### Compile a contract
```
npx hardhat starknet-compile cairo1-contracts/contract1.cairo --single-file
```#### Compile a deprecated (Cairo 0) contract
```
npx hardhat starknet-compile-deprecated contracts/contract.cairo
```### Set up environment variables
Some scripts require environment variables (search for usage of `ensureEnvVar` in the repo). You can define these variables in an `.env` file in the project root.
#### Run a test that interacts with the compiled contract
```
npx hardhat test test/quick-test.ts
```## Supported `starknet-hardhat-plugin` version
`package.json` is fixed to use the latest `starknet-hardhat-plugin` version this example repository is synced with.
## Troubleshooting
If you're having issues trying to use this example repo with the Starknet plugin, try running `npm install` or `npm update`, as it may be due to version mismatch in the dependencies.
## Branches
- `master` - latest stable examples
- `plugin` - used for testing by [Starknet Hardhat Plugin](https://github.com/0xSpaceShard/starknet-hardhat-plugin)### Branch updating (for developers)
- New PRs and features should be targeted to the `plugin` branch.
- After releasing a new plugin version, `master` should ideally be reset (fast forwarded) to `plugin` (less ideally merged).