NEWTON

NEWTON


Popular tags

    How can I use start_prank with deploy_contract?

    Asked

    4 months ago

    127

    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

      deployment contractdiscordcairo

    Newton

    asked

    4 months ago


    1 answers

    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

    4 months ago

    Your answer

    NEWTON

    NEWTON