question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`prepare_deploy_contract` cheatcode

See original GitHub issue

Proposal:

func ():
%{
  dep = Contract("./contract.cairo",  [1,2,3])
  start_prank(123, target=dep.contract_address)
  dep.deploy()
%}
end

Would work also for mock_call and any targeted cheatcode.

We could in the future deprecate deploy_contract, and instead use:

%{
  dep = Contract("./contract.cairo",  [1,2,3]).deploy()
%}

Interface

class Contract:
__init__(path, calldata): ...

def deploy(self) -> Contract: ...

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
kasperski95commented, Jun 9, 2022

We can create a mapping tmp_address -> actual_address, which could be updated by Contract::deploy just before deploying a contract.

0reactions
MaksymilianDemitraszekcommented, Jun 22, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

deploy_contract | Protostar - Software Mansion
Deploys a contract given a path relative to a Protostar project root. The section Deploying contracts from tests demonstrates a usage of this...
Read more >
How to Simply Deploy a Smart Contract on Ethereum?
Step 3 – Get access to Bytecode and ABI (Compile the smart contract). Solidity compiler gives a huge piece of code as output,...
Read more >
Foundry Tutorial | How To Debug & Deploy Solidity Smart ...
Foundry is a Solidity Framework for building, testing, fuzzing, debugging and deploying Solidity smart contracts. In this Foundry tutorial ...
Read more >
Deploy your first Solidity smart contract with Remix IDE
In this video, I will show you how to deploy smart contracts using Remix IDE (web app for Solidity development). As example, I...
Read more >
dabit3/foundry-cheatsheet - GitHub
This creates a new project with 4 folders: src - An example smart contract and where your smart contracts will live. script -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found