// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.23; import {Script, console2} from "forge-std/Script.sol"; import {DCO2s} from "src/DCO2s.sol"; contract DCO2sScript is Script { DCO2s public dco2sc; address public defaultAdmin; address public minter; address[] public airdrops; string public baseURI; string public name; string public symbol; string[] public nfts; function setUp() public { baseURI = vm.envString("BASE_URI"); defaultAdmin = vm.envAddress("DEFAULT_ADMIN"); minter = vm.envAddress("MINTER"); name = vm.envString("NAME"); symbol = vm.envString("SYMBOL"); // Import nfts array from .env and split by ' ' nfts = vm.envString("nfts", " "); airdrops = vm.envAddress("airdrops", "\n"); } // run is the entry point function run() public { // startBroadcast and stopBraodcast will let us execute transactions anything between them uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); // here we just need to deploy a new contract dco2sc = new DCO2s(defaultAdmin, minter, baseURI, name, symbol); console2.log("The DCO2s contract address is: ", address(dco2sc)); // minting all nfts to airdrops accounts // @notice: uses module for airdrops accounts to distribute the nfts for (uint256 i; i < nfts.length; i++) { dco2sc.safeMint(airdrops[i % airdrops.length], nfts[i]); string memory tokenURI = dco2sc.tokenURI(i); console2.log("Token0 URI is:", tokenURI); } // minting NFT0 to the contract admin //string memory URI = nfts[0]; //dco2sc.safeMint(defaultAdmin, URI); //string memory tokenURI = dco2sc.tokenURI(0); //console2.log("Token0 URI is:", tokenURI); vm.stopBroadcast(); } }