Skip to content

Releases: 0xSpaceShard/starknet-hardhat-plugin

v0.8.0-alpha.5

29 Sep 09:24
Compare
Choose a tag to compare
v0.8.0-alpha.5 Pre-release
Pre-release

All changes are relative to v0.8.0-alpha.4.

Usage related changes

  • hardhat starknet-build adapted to Scarb 0.7.0 (Cairo 2.2.0)
  • hardhat starknet-compile improved:
    • Simply specify semver of the desired Cairo compiler in hardhat config under compilerVersion
      • E.g. compilerVersion: "2.2.0"
    • Compiler downloaded automatically if on linux-amd64 or mac-arm64, otherwise check out cairo1BinDir
    • Removed the constraint of having venv specified when using cairo1BinDir
  • Simplified Cairo 0 compilation docs
    • If you have docker CLI and want to use the latest Cairo 0 compiler, you're good to go; otherwise check the docs
  • Integrated-devnet defaults to the latest starknet-devnet (v0.6.3)
  • Removed cairo-migrate CLI command
    • Old obsolete command for migrating between old Cairo 0 versions

Development related changes

  • Supported full image specification for dockerized integrated-devnet
    • Allows specifying Devnet in Rust: dockerizedVersion: "shardlabs/starknet-devnet-rs:<TAG>"
    • Not yet fully useful as Devnet in Rust only provides JSON-RPC API, and this plugin does not yet fully rely on it.

Merged PRs

Full Changelog: v0.8.0-alpha.4...v0.8.0-alpha.5

v0.8.0-alpha.4

23 Aug 12:40
195a59c
Compare
Choose a tag to compare
v0.8.0-alpha.4 Pre-release
Pre-release

All changes are relative to v0.8.0-alpha.3.

Usage related changes

  • Eliminate reliance on Starknet CLI
    • Removed support Starknet CLI predefined wallet
      • Removed starknet-new-account and starknet-deploy-accountCLI command
    • Replaced internal Starknet CLI usage with starknet.js

Merged PRs

Full Changelog: v0.8.0-alpha.3...v0.8.0-alpha.4

v0.8.0-alpha.3

22 Jun 16:12
Compare
Choose a tag to compare
v0.8.0-alpha.3 Pre-release
Pre-release

All changes are relative to v0.8.0-alpha.2.

Usage related changes

  • New command hardhat starknet-build [--scarb-command <STRING>] [--skip-validate] [...paths]:

    • For building Scarb projects
    • Produces easily loadable artifacts compatible with your hardhat scripts
    • Compatible with Scarb 0.4.0
    • The command hardhat starknet-compile is preserved and serves the compilation of simple single Cairo 1 files
    • Read more in the docs:
    • Check out the example repo:
  • Support for Starknet/cairo-lang 0.11.2

  • Bugfixes:

    • Allowing constructorless Cairo 1 contracts
    • Fixed race condition that appeared when awaiting multiple promises (with Promise.all)
    • Allowing Cairo 1 compilation artifacts of version > 1 (was restricted to 1..)
    • Cairo methods returning arrays are now correctly handled when doing contract.call(...))
      • Was reporting missing type in the ABI

Development related changes

  • Improved testing of:
    • Cairo 1 events (not Cairo 2)
    • Constructor checking

Merged PRs

New Contributors

Full Changelog: v0.8.0-alpha.2...v0.8.0-alpha.3

v0.8.0-alpha.2

11 May 09:18
Compare
Choose a tag to compare
v0.8.0-alpha.2 Pre-release
Pre-release

All changes are relative to v0.8.0-alpha.1.

Usage related changes

  • Expanded type support in parsing Cairo 1 function input and output
    • ClassHash, EthAddress, u256, u32
  • Fixed event support for Cairo 1 contracts
  • Supported fee estimation of Cairo 1 contract declaration (declare v2)
  • Documentation fixes

Merged PRs

New Contributors

Full Changelog: v0.8.0-alpha.1...v0.8.0-alpha.2

v0.8.0-alpha.1

04 May 14:39
Compare
Choose a tag to compare
v0.8.0-alpha.1 Pre-release
Pre-release

All changes are relative to v0.8.0-alpha.0.

Usage related changes

  • Breaking changes in compilation:
    • Renamed starknet-compile to starknet-compile-deprecated (Cairo 0)
    • Renamed starknet-compile-cairo1 to starknet-compile (Cairo 1)
      • offering the same set of CLI options as the official Cairo 1 compiler interface:
        • --allowed-libfuncs-list-name
        • --allowed-libfuncs-list-file
        • --replace-ids
        • --add-pythonic-hints
    • Specify custom Cairo 1 compiler by providing path to directory holding binaries:
      • ✔️ cairo1BinDir property of starknet object in hardhat config file
      • ✔️ starknet-compile --cairo1-bin-dir <PATH>
      • manifestPath option is no longer valid
  • Better support for Cairo 1 core types (added 1D arrays and boolean; not full type support)
  • Bugfixes in Cairo 1 contract interaction
  • Defaulting to Starknet/cairo-lang 0.11.0.2 (instead of 0.11.0.1)
  • Optionally suppress contract arg validation by setting rawInput when invoking/calling:
    • contract.call("foo", ["10", "20"], { rawInput: true })
  • Moved docs and code repo from Shard-Labs to 0xSpaceShard

Development related changes

  • Better per-test testing with npm test-dev script
  • Updated dependencies (starknet.js)

Merged PRs

New Contributors

Full Changelog: v0.8.0-alpha.0...v0.8.0-alpha.1

v0.8.0-alpha.0

17 Apr 14:56
Compare
Choose a tag to compare
v0.8.0-alpha.0 Pre-release
Pre-release

Breaking usage changes:

  • account.declare(...) now returns hash of declaration transaction
  • contract_address on transaction object from starknet.getTransaction(txHash) changed to sender_address
  • Devnet interaction (compatibility with v0.5.0a1):
    • devnet.createBlock(...) no longer returns Block but an object with class_hash
    • devnet.sendMessageToL2(...) expects new argument paidFeeOnL1
    • response of devnet.setTime(...) and devnet.increaseTime(...) updated

Compatibility with Starknet 0.11.0.1

  • CLI commands:
    • new: npx hardhat starknet-compile-cairo1 works with Cairo 1
    • old: hardhat starknet-compile - works with Cairo 0.X contracts
  • account.declare(...):
    • automatically recognizes whether to send declare v2 or v1
  • Limited support for interaction with deployed Cairo 1 contracts
    • no support for boolean (upcoming)

Other usage related changes

  • Improved Docker Desktop support
  • Improved error message on failing fee estimation

Merged PRs

Full Changelog: v0.7.3...v0.8.0-alpha.0

v0.7.3

24 Feb 10:46
Compare
Choose a tag to compare

Usage related changes

  • Support message fee estimation - docs
  • Allow specifying nonce in declaration and deployment
  • Support request timeout specification - docs
  • Support Rust VM with integrated-devnet - docs

Development related changes

  • Refactor path adaptation
  • Update to devnet v0.4.6

Merged PRs

New Contributors

Full Changelog: v0.7.2...v0.7.3

v0.7.2

09 Feb 16:03
Compare
Choose a tag to compare

Usage related changes

  • Support fee estimation and do it implicitly for:
    • class declaration
    • contract deployment
    • account deployment
  • Introduce utility function for token minting on Devnet:
    • starknet.devnet.mint(address: string, amount: number, lite=true)
  • Introduce utility function for getting balance (on any network):
    • starknet.getBalance(address: string)
  • Integrate Amarna static analyzer:
    • CLI command: npx hardhat amarna
  • Support L1-L2 mock messaging via Devnet - docs
  • Improved docusaurus docs at https://shard-labs.github.io/starknet-hardhat-plugin/
  • Minor fixes:
    • Handle non-absolute cairo paths
    • Improve error logging

Development related changes

  • Improved testing of existing code
  • Improved and refactored types

Merged PRs

New Contributors

Full Changelog: v0.7.1...v0.7.2

v0.7.1

15 Dec 09:42
Compare
Choose a tag to compare

Usage related changes

  • Fix the bug that hindered interaction with localhost (devnet) on mac
  • Add a 30s timeout to devnet and integrated-devnet requests

Development related changes

  • Add GitHub bug template
  • Improve venv tests (basically restore how it used to be before 0.7.0)

Merged PRs

Full Changelog: v0.7.0...v0.7.1

v0.7.0

12 Dec 15:06
Compare
Choose a tag to compare

Breaking usage changes

  • Contract deployment needs to be done through an account (invoking UDC under the hood):
const contractFactory = starknet.getContractFactory(...);

// old
await contractFactory.deploy({ args }, { options });

// new
const account = ...;
await account.declare(contractFactory);
await account.deploy(contractFactory, { args }, { options });
  • Accounts:
    • starknet.getAccountFromAddress and starknet.deployAccount are history
    • Separate account creation and deployment
    • To be able to deploy an ArgentAccount, the chain you are using is expected to have ArgentAccount contracts declared. If you are using Devnet, this is most easily achievable by running a Devnet forked from e.g. alpha-goerli.
import { starknet } from "hardhat";
const account = await starknet.OpenZeppelinAccount.createAccount(...);
// somehow fund account.address
// ...
await account.deployAccount();

// alternatively
const account = await starknet.OpenZeppelinAccout.getAccountFromAddress(...);

// same for starknet.ArgentAccount - no longer requires separate initialization
  • Implicitly calculate invocation max fee:
// maxFee will be `1 + overhead` times the estimated fee; if overhead not provided, the default 0.5 is used.
// For example this is how a 40% overhead is specified:
await account.invoke(contract, "foo", { arg1: ... }, { overhead: 0.4 });
  • Fix return type of StarknetContract.decodeEvents (no longer a Promise)
  • Make --account-contract of hardhat starknet-verify a flag rather than a param
  • Remove redundant CLI commands
    • Namely: hh starknet-deploy, hh starknet-call, hh starknet-invoke, hh starknet-estimate-fee
    • Done after consulting with users - nobody was against removal
    • All those commands have their JS/TS counterparts
    • If you really need CLI, you can Starknet CLI
  • You are welcome to take a look into the examples in the docs and in the example repo.

Other usage changes

  • Adapt to StarkNet/cairo-lang 0.10.3
  • Integrated-devnet uses starknet-devnet v0.4.2
  • Predefine alpha-goerli2 network with the new chain ID:
    • npx hardhat test --starknet-network alpha-goerli2
  • Add getTransactionTrace function to hre.starknet
  • Add getClassHash method to StarknetContractFactory class.

Development related changes

  • Convert tests from bash to TS
  • Dynamically import HardhatRuntimeEnvironment where needed

Merged PRs

Full Changelog: v0.6.8...v0.7.0