Releases: 0xSpaceShard/starknet-hardhat-plugin
v0.8.0-alpha.5
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"
- E.g.
- Compiler downloaded automatically if on linux-amd64 or mac-arm64, otherwise check out
cairo1BinDir
- Removed the constraint of having
venv
specified when usingcairo1BinDir
- Simply specify semver of the desired Cairo compiler in hardhat config under
- 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.
- Allows specifying Devnet in Rust:
Merged PRs
- Support full image specification of dockerized integrated-devnet by @FabijanC in #406
- Compiler downloader by @Nathan-SL and @FabijanC in #402
- Allow cairo1BinDir with dockerized plugin by @FabijanC in #408
- Prepare release of 0.8.0 alpha.5 by @FabijanC in #410
Full Changelog: v0.8.0-alpha.4...v0.8.0-alpha.5
v0.8.0-alpha.4
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
andstarknet-deploy-account
CLI command
- Removed
- Replaced internal Starknet CLI usage with starknet.js
- Removed support Starknet CLI predefined wallet
Merged PRs
- Export types; correct error prototype by @FabijanC in #394
- Drop support for Starknet CLI wallet by @Nathan-SL in #381
- Use prebuilt binaries on Cairo installation by @Nathan-SL in #399
- Validate config file on test by @Nathan-SL in #401
- Replace internal Starknet CLI usage with starknet.js by @penovicp in #400
- Enable release of v0.8.0-alpha.4 by @FabijanC in #403
Full Changelog: v0.8.0-alpha.3...v0.8.0-alpha.4
v0.8.0-alpha.3
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
- Fix bug: allow constructorless contracts by @Nathan-SL in #366
- Fix payload type by @Nathan-SL in #371
- Refactor constructor checking by @remiroyc in #370
- Update adaptInputUtil function return type by @Nathan-SL in #368
- Adapt to cairo-lang/starknet 0.11.1 by @FabijanC in #375
- Fix race condition on proxy server by @Nathan-SL in #374
- Add tests for constructor checker by @Nathan-SL in #377
- Spelling fix by @Nathan-SL in #383
- Cairo1 events by @notV4l in #380
- Fix cairo1 compiler by @FabijanC in #393
- Adapt to cairo-lang/Starknet 0.11.2; support scarb by @FabijanC in #376
New Contributors
Full Changelog: v0.8.0-alpha.2...v0.8.0-alpha.3
v0.8.0-alpha.2
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
- adapt.ts: fix core::integer::u32 by @cfal in #360
- fix reading cairo 1.0 input specs by @cfal in #359
- adapt.ts: add support for core::integer::u256 by @cfal in #358
- Add support for class_hash::ClassHash by @augustbleeds in #362
- Support estimate fee on declare v2 by @Nathan-SL in #361
- Support eth address by @FabijanC in #364
New Contributors
- @augustbleeds made their first contribution in #362
Full Changelog: v0.8.0-alpha.1...v0.8.0-alpha.2
v0.8.0-alpha.1
All changes are relative to v0.8.0-alpha.0.
Usage related changes
- Breaking changes in compilation:
- Renamed
starknet-compile
tostarknet-compile-deprecated
(Cairo 0) - Renamed
starknet-compile-cairo1
tostarknet-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
- offering the same set of CLI options as the official Cairo 1 compiler interface:
- Specify custom Cairo 1 compiler by providing path to directory holding binaries:
- ✔️
cairo1BinDir
property ofstarknet
object in hardhat config file - ✔️
starknet-compile --cairo1-bin-dir <PATH>
- ❌
manifestPath
option is no longer valid
- ✔️
- Renamed
- 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
- npm and Docker Hub unchanged
Development related changes
- Better per-test testing with
npm test-dev
script - Updated dependencies (starknet.js)
Merged PRs
- Replaced Shard-Labs with SpaceShard by @ivpavici in #339
- Create LICENSE by @ivpavici in #342
- Add test-dev npm script for easier per-test testing by @shramee in #343
- Polish test-dev script by @FabijanC in #348
- Adapt to starknet 0.11.0.2 by @Nathan-SL in #340
- utils.ts: fix finding constructors when a comment exists by @cfal in #349
- utils.ts: dont match parameters in constructor name check by @cfal in #351
- types/index.ts: dont pass abi path for cairo 1.0 contract calls by @cfal in #352
- Allow user to use custom compiler binaries by @taco-paco in #345
- Constructor detection via casm file by @taco-paco in #354
- Bump starknet.js dependency by @penovicp in #335
- cairo 1.0 input and output handling improvements by @cfal in #355
- Raw input by @FabijanC in #357
New Contributors
Full Changelog: v0.8.0-alpha.0...v0.8.0-alpha.1
v0.8.0-alpha.0
Breaking usage changes:
account.declare(...)
now returns hash of declaration transactioncontract_address
on transaction object fromstarknet.getTransaction(txHash)
changed tosender_address
- Devnet interaction (compatibility with v0.5.0a1):
devnet.createBlock(...)
no longer returnsBlock
but an object withclass_hash
devnet.sendMessageToL2(...)
expects new argumentpaidFeeOnL1
- response of
devnet.setTime(...)
anddevnet.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
- new:
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
- Docker Desktop support by @notV4l in #327
- Add error handling for sendEstimateFeeTx by @notV4l in #330
- Declare return tx hash by @TsBauer in #332
- Adapt to starknet 0.11.0 by @Nathan-SL in #328
Full Changelog: v0.7.3...v0.8.0-alpha.0
v0.7.3
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
- fix: typo in docs by @notV4l in #314
- fix: replace StarkNet by Starknet [skip ci] [skip-testnet] by @notV4l in #320
- Integrated devnet with rust vm by @notV4l in #319
- Add estimate message fee by @Nathan-SL in #312
- Refactor path adaptation by @Nathan-SL in #317
- Allow axios timeout configuration via hardhat config by @notV4l in #322
- Pass Declare Nonce to Starknet CLI by @solimander in #324
- Provide nonce on deploy function by @Nathan-SL in #323
New Contributors
Full Changelog: v0.7.2...v0.7.3
v0.7.2
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
- CLI command:
- 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
- #177 gh-pages for the repo by @shramee in #282
- Finish transition to docusaurus docs by @FabijanC in #283
- Remove extra logging of ClientConnectorError by @Nathan-SL in #279
- #287 TypeRoots - only from this dir by @shramee in #288
- #200 Debugging contracts by @shramee in #284
- 286 type defs by @shramee in #291
- #272 devnet.mint by @shramee in #285
- Support L1-L2 mock messaging by @Nathan-SL in #294
- Contract tests by @shramee in #297
- 231 amarna by @shramee in #295
- Estimate fee on declare and deploy by @Nathan-SL in #293
- Estimate deploy account fee by @Nathan-SL in #304
- Fix: typos by @omahs in #309
- Expand error message with reason by @Nathan-SL in #308
- Get account balance by @FabijanC in #310
- Handle non-absolute cairoPath by @Nathan-SL in #307
- 231 amarna ci issue by @shramee in #302
New Contributors
Full Changelog: v0.7.1...v0.7.2
v0.7.1
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
- Add timeout to devnet & integrated-devnet requests by @Nathan-SL in #274
- Fix and refactor Starknet Wrapper by @FabijanC in #278
Full Changelog: v0.7.0...v0.7.1
v0.7.0
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
andstarknet.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 aPromise
) - Make
--account-contract
ofhardhat 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
- Namely:
- 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 tohre.starknet
- Add
getClassHash
method toStarknetContractFactory
class.
Development related changes
- Convert tests from bash to TS
- Dynamically import
HardhatRuntimeEnvironment
where needed
Merged PRs
- Fix devnet-related test failure by @FabijanC in #253
- Replace bash test to TS using shelljs by @Nathan-SL in #251
- Add predefined network for Testnet 2 by @Nathan-SL in #258
- Update Argent account implementation by @Nathan-SL in #260
- Introduce some breaking changes for 0.7.0 by @FabijanC in #199
- Add transaction trace utility function by @Nathan-SL in #264
- Support new chain ID for Alpha Goerli 2 by @Nathan-SL in #267
- Adapt to cairo-lang 0.10.3 by @FabijanC in #256
Full Changelog: v0.6.8...v0.7.0