Starknet Hardhat Plugin

New version of starknet-hardhat-plugin (v0.5.4) has been released:

  • Introduced integrated-devnet:
    • experimental feature
    • run Devnet in Hardhat background without having to run it in a separate shell
    • a predefined network configurable through the hardhat.config file
    • activated by using --starknet-network integrated-devnet or specifying network: "integrated-devnet" in the hardhat.config file
  • Introduced starknet.getBlock utility function for block retrieval
  • Fixed hardhat starknet-verify:
    • adapted to to the new Voyager API
    • now logging a link to Voyager where the verified contract can be checked
  • Added deployment options to starknet.deployAccount (whitelistedness token, salt, key)
  • Improved error logging on unsuccessful contract deployment (stopped masking the actual error).
5 Likes

New version of starknet-hardhat-plugin (v0.5.5) has been released:

  • Account classes use OpenZeppelin v0.1.0 and Argent v0.2.1 (new versions coming soon, but better late than never)
  • Easier getting of account address (account.address)
  • In CLI commands, --signature is fixed and now accepts multiple values
  • url property made optional for hardhat network configs
  • dockerizedVersion defaults to cairo-lang 0.8.2
  • Integrated-devnet uses uses starknet-devnet v0.2.2 by default
  • Voyager has recently updated its verification API, so the starknet-verify command will not work with this and older versions of the plugin
6 Likes

New version of starknet-hardhat-plugin (v0.6.0) has been released:

  • Introduced timestamp manipulation functions (Devnet only):
    • starknet.devnet.setTime(1000)
    • starknet.devnet.increaseTime(500)
  • Added support for named tuples, nested tuples and type aliases as function arguments.
  • Adapted to cairo-lang/starknet 0.9.0:
    • Introduced the declare method to the StarknetFactory class:
      • const classHash = await contractFactory.declare()
  • Updated the Argent account version used (v0.2.2):
    • BREAKING CHANGES:
      • Guardian not used by default anymore (it’s set to 0).
      • Initialization with a fundedAccount required after deployment:
        • const acc = <ArgentAccount> await starknet.deployAccount("Argent")
        • await acc.initialize({ fundedAccount, maxFee })
    • Useful scripts:
  • Updated the OpenZeppelin account version used (OZ commit b27101eb8).
  • Automatically fetching -arm docker images on arm64 computers.
  • Fixed support for interaction with Devnet on WSL and mac when used with the dockerizedVersion of the plugin.
  • Adapted to the new Voyager verification API.
  • Added support for relative paths as arguments to getContractFactory.
  • integrated-devnet - docs:
    • Not marked as experimental anymore.
    • Added args property to integratedDevnet hardhat config definition to allow passing Devnet CLI arguments (e.g. --lite-mode).
4 Likes

New version of starknet-hardhat-plugin (v0.6.1) has been released:

  • Fixed error logging (removed duplication and improved newline display)
  • integrated-devnet changes:
    • Fixed error and exit handling
    • Using starknet-devnet v0.2.5 by default
  • Updated used OpenZeppelin account artifacts to v0.2.0
  • Supported event decoding (example):
    const txHash = await contract.invoke("increase_balance", { amount: 10 });
    const receipt = await starknet.getTransactionReceipt(txHash);
    const decodedEvents = contract.decodeEvents(receipt.events);
    // decodedEvents contains hex data array converted to a structured object
    // { name: "increase_balance_called", data: { current_balance: 0n, amount: 10n } }
  • Supported devnet-specific client utility functions:
    • hardhat.starknet.devnet.load - load a devnet instance via HTTP
    • hardhat.starknet.devnet.dump - dump a devnet instance via HTTP
    • hardhat.starknet.devnet.getPredeployedAccounts - get accounts predeployed on Devnet
3 Likes

New version of starknet-hardhat-plugin (v0.6.2) has been released:

  • Adapted to cairo-lang and Starknet 0.9.1
    • estimateFee response still has the amount property, it is just expanded with the new gas_price and gas_usage properties
  • Fixed running of scripts with hardhat run - no more signature issues.
  • Fixed running of hardhat starknet-invoke
  • Updated OpenZeppelin account version to v0.2.1
  • Adapted hardhat starknet-verify to the new Voyager verification API
  • Expanded docs with 3rd party library installation guide
5 Likes

New starknet-hardhat-plugin version (v0.6.3) has been released:

  • Improved performance when using the plugin with through venv
  • Introduced optional recompilation feature (toggle by setting recompile under starknet in your hardhat config file to true or false (defaults to false) - docs.
  • Added runtime typecheck to starknet.getBlock.
3 Likes

New version of starknet-hardhat-plugin (v0.6.4) has been released:

  • Applied the proxy-server optimization to all commands and to the dockerized mode (v0.6.3 only optimized venv mode and didn’t optimize starknet-compile)
  • Introduced the hardhat starknet-plugin-version command
  • Introduced stderr and stdout parameters to the integratedDevnet configuration in hardhat config: allows piping of stdout and stderr of integrated-devnet to desired files (or to your terminal’s stdout and stderr) - previously this output (except for the last message) was trapped in the subprocess/container (this is still the default behavior)
  • Fixed the error arising from python being linked to python2 on some computers (by using python3 internally)
4 Likes

New version of starknet-hardhat-plugin (v0.6.5) has been released:

  • Introduced a function for empty block creation on devnet:
    • starknet.devnet.createBlock()
    • docs
  • Introduced a method that enables proxy contract delegation (through setting the ABI/implementation):
    • proxyContract.setImplementation(...)
    • docs
  • Updated OZ accounts to 0.3.1
  • Improved error message if configured environment (venv) doesn’t have Starknet installed
3 Likes

An alpha version of starknet-hardhat-plugin (0.6.6-alpha.0) has been released:

  • Partial update to Starknet v0.10.0
  • Install this version with one of:
    • npm i @shardlabs/starknet-hardhat-plugin@0.6.6-alpha.0
    • npm i @shardlabs/starknet-hardhat-plugin@alpha
  • Modify your code not to use account.call(contract, "foo", ...), rather do contract.call("foo", ...)
  • The Account classes currently don’t work because they cannot __validate__, you should rely on this account/wallet as in this example
3 Likes

New alpha version of starknet-hardhat-plugin (v0.6.6-alpha.2) has been released:

  • Using updated OpenZeppelin account (compatible with Starknet 0.10, same as used by Devnet)
  • Introduced signed declaration through account with Account.declare(...):
    • Instead of contractFactory.declare(), do account.declare(contractFactory)
  • Introduced starknet.getNonce(address: string) utility function
  • Install this version with one of:
    • npm i @shardlabs/starknet-hardhat-plugin@0.6.6-alpha.2
    • npm i @shardlabs/starknet-hardhat-plugin@alpha
  • 0.6.6-alpha.1 was a short-lived (quickly unpublished) version
3 Likes

New alpha version of starknet-hardhat-plugin (v0.6.6-alpha.3) has been released:

  • Fix getNonce to properly handle values >= 10
  • Fix support for named tuples
  • Add incompatibility warning logs to starknet-deploy-account and ArgentAccount
  • Install this version with one of:
    • npm i @shardlabs/starknet-hardhat-plugin@0.6.6-alpha.3
    • npm i @shardlabs/starknet-hardhat-plugin@alpha
2 Likes

New stable version of starknet-hardhat-plugin (v0.6.6) has been released.
Usage related changes since v0.6.6-alpha.3:

  • Finished adaptation to Starknet 0.10
  • Fixed passing of maxFee on class declaration
  • Removed redundant error logging (e.g. on rejected invoke)
2 Likes

New version of starknet-hardhat-plugin (v0.6.7) has been released.

Usage related changes:

  • Update Argent account implementation for use with Starknet 0.10.0
  • Implement cairo-migrate option to convert old Cairo contracts to use a new syntax
  • Color all warnings to yellow
  • Fix missing compilation error (edited)
1 Like