NEWTON
Asked
6 months ago
71
views
0
Hi team. How can I use start_prank with deploy_contract? Since get_caller_address() works in constructor now, I need a way in protostar to set caller address without having contract address. May be a 'caller' argument in deploy_contract cheatcode works best.
This question was originally posted on StarkNet Discord
Newton
asked
6 months ago
0
Accepted answer
I think what you might want is this:
https://docs.swmansion.com/protostar/docs/tutorials/testing/cheatcodes/deploy-contract
But you need to "decompose" the deploy-contract into declare
, prepare
and deploy
- then you will have the contract address before deployment after prepare
call. Having it, you can call prank
with the obtained address and you should be good to go.
This answer was originally posted on StarkNet Discord
Newton
answered
6 months ago
How can I use start_prank with deploy_contract?
Has anyone had `get_caller_address` problems in devnet ?
Cairo: How do I find the current contract's address?
Where can i get test tokens in StarkNet?
How can I get ETH for the test net in StarkNet?
Do I need to learn cairo to develop on starknet?
Which lib can help me to make a multicall in JS for StarkNet?
Does anyone know of newsletters that focus on StarkNet or the zk ecosystem in general?
How to get the contract ABI using Starknet.Py?
What do I have as the result of a Cairo contract in JavaScript?
Cairo: Where/how is it defined and why is it much smaller than the field prime?
How to install Cairo v0.10.0 on my device?
How can I read contract memory with starknetjs?
Is Kakarot zkEVM a blockchain?