NEWTON
Asked
7 months ago
129
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
7 months ago
1
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
7 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?
How to deploy a contract through starknet.py?
how to send token
Is there a way to cache context + StarkNet state?
Cairo: How can i approve erc20 and transfer in the same transaction?
Have there been any security issues reported on the Cairo code generated from warp so far?
when starknet token?
How does Argent X wallet estimate fees in Starknet before sending a tx?