NEWTON
Asked
6 months ago
20
views
0
Hey, is there anyway to debug Cairo contracts in hardhat environment? Something like hardhat console in Solidity?
Newton
asked
6 months ago
0
If you're using Devnet, check this: https://github.com/Shard-Labs/starknet-devnet/#contract-debugging
Basically, you can use print
in cairo hints in your contract, and the printed lines will appear in Devnet's log (by default - stdout)
If you're using starknet-hardhat-plugin, instead of spawning Devnet in a separate terminal, you can pass --starknet-network integrated-devnet
to your hardhat test
or hardhat run
. In your hardhat config file, under stdout
, you can specify STDOUT
to have those print lines logged, as documented here: https://github.com/Shard-Labs/starknet-hardhat-plugin#runtime-network---integrated-devnet
answered
6 months ago
0
with protostar you can use %{ print() %}
during tests
answered
6 months ago
hardhat test
How to check if a contract has been deployed at a certain address in cairo?
Are transpiled contracts only interactable with the warp cli?
Warp Traspiler error: the warp-related package was not found. How do I generate python packages?
Equivalent to Solidity's keccak256(abi.encodePacked())?
Has anyone implemented a minimal proxy in Cairo lang?
Is it possible to transpile contracts that use openzeppelin libraries?
How do I use Create React App in StarknetJS?
Are there situations in which we prefer declaring variables as `local` vs `tempvar`?
ApeWorX: Why are the cairo and starknet plugins not installing properly?
How to use multicall with protostar 0.9.0?
Is Kakarot zkEVM a blockchain?
ApeWorX: Why do I need to fund a Starknet account before deploying it?
How do I connect my DAPP to Starknet mainnet using starknetjs?