1

here is my integration script.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script, console} from "forge-std/Script.sol";
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {FundMe} from "../src/FundMe.sol";

contract FundFundMe is Script {
    uint256 SEND_VALUE = .1 ether;

    function fundFundMe(address mostrecentDeployment) public {
        FundMe(payable(mostrecentDeployment)).fund{value: SEND_VALUE}();

        console.log("EgtgGE%s", SEND_VALUE);
    }

    function run() external {
        address mostrecentDeployment = DevOpsTools.get_most_recent_deployment(
            "FundMe",
            block.chainid
        );
        console.log("ugh9uq3r9grtgqegffuuuefbufueu");
        vm.startBroadcast();
        fundFundMe(mostrecentDeployment);
        vm.stopBroadcast();
    }
}

here is trace

    └─ ← 5692 bytes of code

  [277305] → new FundFundMe@0x34A1D3fff3958843C43aD80F30b94c510645C316
    └─ ← 1164 bytes of code

  [57509] FundFundMe::run()
    ├─ [33494] DevOpsTools::get_most_recent_deployment("FundMe", 31337 [3.133e4]) [delegatecall]
    │   ├─ [0] VM::readDir("./broadcast", 3) [staticcall]
    │   │   └─ ← [("IO error for operation on /home/kalmrigaya/hello_foundry/foundry-fund-me/broadcast: No such file or directory (os error 2)", "/home/kalmrigaya/hello_foundry/foundry-fund-me/broadcast", 0, false, false)]
    │   ├─ [0] VM::toString(31337 [3.133e4]) [staticcall]
    │   │   └─ ← "31337"
    │   └─ ← revert: No run-latest.json file found for specified chain
    └─ ← revert: No run-latest.json file found for specified chain


Gas used: 57509
Error: 
script failed: revert: No run-latest.json file found for specified chain

1 Answer 1

0

Please run the following command to install the foundry-devops it will show the chain id(31337) in the folder structure.

  1. forge install Cyfrin/foundry-devops --no-commit
  2. forge rm forge-std -f
  3. forge install foundry-rs/[email protected] --no-commit

If this not works put the search path of the broadcast below:

address recentAddressDeployed = DevOpsTools.get_most_recent_deployment("FundMe", block.chainid, SEARCH_PATH);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.