Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 879 Bytes

InteractionDetails.md

File metadata and controls

34 lines (26 loc) · 879 Bytes

Interactions

-   We have to fund the most recent deployed contract
-   To get the most recent deployed
-   foundry-devops package is used

Installation

forge install Cyfrin/foundry-devops --no-commit

Usage

  1. Update foundry.toml to have read permissions on the broadcast folder.
fs_permissions = [{ access = "read", path = "./broadcast" }]
  1. Import the package, and call DevOpsTools.get_most_recent_deployment("MyContract", chainid);
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {MyContract} from "my-contract/MyContract.sol";
.
.
.
function interactWithPreviouslyDeployedContracts() public {
    address contractAddress = DevOpsTools.get_most_recent_deployment("MyContract", block.chainid);
    MyContract myContract = MyContract(contractAddress);
    myContract.doSomething();
}