Skip to content

Commit

Permalink
Upgrade to v0.3.2 (#22)
Browse files Browse the repository at this point in the history
* Fix typos

* Check if deployment network exists

* Refactor passing gateway_url

* Improve typing in adapt

* Improve error if no artifacts

* Use StringMap to pass args

* Add --inputs to starknet-deploy

* Upgrade to v0.3.2 (update packages)

* Improve deploy docs
  • Loading branch information
FabijanC authored Nov 24, 2021
1 parent 2944305 commit 12d0ed2
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 118 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ If no paths are provided, all Starknet contracts in the default contracts direct

### `starknet-deploy`
```
npx hardhat starknet-deploy [--starknet-network <NAME>] [--gateway-url <URL>] [ARTIFACT_PATH...]
npx hardhat starknet-deploy [--starknet-network <NAME>] [--gateway-url <URL>] [ARTIFACT_PATH...] [--inputs <SINGLE_STRING_OF_SPACE_SEPARATED_VALUES>]
```
If no paths are provided, all Starknet artifacts from the default artifacts directory are deployed. Paths can be files and directories.

Notice that this plugin relies on `--starknet-network` and not on Hardhat's `--network`. So if you specify
Notice that this plugin relies on `--starknet-network` (or `STARKNET_NETWORK` environment variable) and not on Hardhat's `--network`. So if you define
```javascript
module.exports = {
networks: {
Expand All @@ -44,7 +44,13 @@ module.exports = {
```
you can use it by calling `npx hardhat starknet-deploy --starknet-network myNetwork`.

The Alpha testnet is available by default, you don't need to specify it.
The Alpha testnet is available by default, you don't need to define it in the config file.

If you're passing constructor arguments, pass them space separated, but as a single string.
```
npx hardhat starknet-deploy starknet-artifacts/contract.cairo/ --inputs "1 2 3"
```
You would typically use the input feature when deploying a single contract requiring constructor arguments. If you are deploying multiple contracts, they'll all use the same input.

## Test
To test Starknet contracts with Mocha, use the regular Hardhat `test` task which expects test files in your designated test directory:
Expand Down
152 changes: 76 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shardlabs/starknet-hardhat-plugin",
"version": "0.3.1",
"version": "0.3.2",
"description": "Plugin for using Starknet tools within Hardhat projects",
"main": "dist/index.js",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions scripts/npm-publish.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
set -e

CORE_LOCAL_VERSION=$(jq -r ".version" package.json)
CORE_NPM_VERSION=$(npm view @shardlabs/starknet-hardhat-plugin dist-tags.latest)
LOCAL_VERSION=$(jq -r ".version" package.json)
NPM_VERSION=$(npm view @shardlabs/starknet-hardhat-plugin dist-tags.latest)

if [ $CORE_LOCAL_VERSION = $CORE_NPM_VERSION ]; then
if [ $LOCAL_VERSION = $NPM_VERSION ]; then
echo "Latest npm version is equal to current package version. Up the version to publish to npm."
else
npm install
Expand Down
Loading

0 comments on commit 12d0ed2

Please sign in to comment.