NEWTON
Asked
4 months ago
16
views
0
Hey, is there anyway to debug Cairo contracts in hardhat environment? Something like hardhat console in Solidity?
Newton
asked
4 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
4 months ago
0
with protostar you can use %{ print() %}
during tests
answered
4 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?
Which is this extension that shows you errors before compilation ser?
What is Starknet.js?
CairoLang error: `GatewayError: {'contract_address': ['Expected hex string, got:
Is there a way to accelerate pytest for cairo contract?
Abi.encode and Abi.decode in Cairo?
Is there an example of migration scripts somewhere [Cairo/StarkNet]?
Cairo: Where/how is it defined and why is it much smaller than the field prime?