When running “make mint ARGS=”–network sepolia””, I encountered the following error:
make mint ARGS="--network sepolia"
[⠆] Compiling...
No files changed, compilation skipped
Traces:
[1131599] → new DevOpsTools@0x4DB574C3D6D412a9eF15B4DDA4442a59ce4877cc
└─ ← 5710 bytes of code
[228575] → new MintBasicNft@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
└─ ← 1080 bytes of code
[6857] MintBasicNft::run()
├─ [3925] DevOpsTools::get_most_recent_deployment("BasicNft", 11155111 [1.115e7]) [delegatecall]
│ ├─ [0] VM::readDir("./broadcast", 3) [staticcall]
│ │ └─ ← the path broadcast is not allowed to be accessed for read operations
│ └─ ← the path broadcast is not allowed to be accessed for read operations
└─ ← the path broadcast is not allowed to be accessed for read operations
Error:
script failed: the path broadcast is not allowed to be accessed for read operations
make: *** [Makefile:45: mint] Error 1
Script contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script} from "forge-std/Script.sol";
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {BasicNft} from "../src/BasicNft.sol";
contract MintBasicNft is Script {
string public constant PUG = "ipfs://bafybeig37ioir76s7mg5oobetncojcm3c3hxasyd4rvid4jqhy4gkaheg4/?filename=0-PUG.json";
function run() external {
address mostRecentlyDeployed = DevOpsTools.get_most_recent_deployment("BasicNft", block.chainid);
mintNftOnContract(mostRecentlyDeployed);
}
function mintNftOnContract(address contractAddress) public {
vm.startBroadcast();
BasicNft(contractAddress).mint(PUG);
vm.stopBroadcast();
}
}
I’m aiming to mint an NFT through my smart contract using an Interactions file with Foundry.
New contributor
Elyas Sarjoghi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.