revert: No run-latest.json file found for specified chain #1181
-
here is my integration script. // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script, console} from "forge-std/Script.sol";
import {HelperConfig} from "./HelperConfig.s.sol";
import {VRFCoordinatorV2Mock} from "@chainlink/contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol";
import {LinkToken} from "../test/mocks/LinkToken.sol";
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
contract Createsubscription is Script {
}
contract FundSubscription is Script {
}
contract AddConsumer is Script {
function addConsumer(
address raffle,
address vrfCoordinator,
uint64 subId
) public {
vm.startBroadcast();
VRFCoordinatorV2Mock(vrfCoordinator).addConsumer(subId, raffle);
vm.stopBroadcast();
}
function addConsumerUsingConfig(address raffle) public {
HelperConfig helperConfig = new HelperConfig();
(, , address vrfCoordinator, , uint64 subId, , ) = helperConfig
.activeConfig();
addConsumer(raffle, vrfCoordinator, subId);
}
function run() external {
address raffle = DevOpsTools.get_most_recent_deployment(
"Raffle",
block.chainid
);
addConsumerUsingConfig(raffle);
}
}
and trace are
here is my foundry.toml
|
Beta Was this translation helpful? Give feedback.
Answered by
PatrickAlphaC
Dec 27, 2023
Replies: 4 comments 7 replies
-
please help me @usmanfarooq91 |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can only call that after you deploy a contract! The error is right there:
It can't find your |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
sagoto80
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can only call that after you deploy a contract! The error is right there:
It can't find your
broadcast
folder. You'll need to actually deploy a contract to run a script!