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