-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUpgradeBatchMintNFT.s.sol
More file actions
48 lines (37 loc) · 1.6 KB
/
UpgradeBatchMintNFT.s.sol
File metadata and controls
48 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.26;
import {Script, console} from "forge-std/Script.sol";
import {BatchMintNFT} from "../src/contentsign/BatchMintNFT.sol";
/// @notice Script to upgrade BatchMintNFT proxy to a new implementation
/// @dev Only admin can execute this upgrade
contract UpgradeBatchMintNFT is Script {
address internal proxy;
address internal newImplementation;
function setUp() public {
proxy = vm.envAddress("BATCH_MINT_NFT_PROXY");
newImplementation = vm.envAddress("BATCH_MINT_NFT_NEW_IMPL");
}
function run() public {
vm.startBroadcast();
console.log("Current proxy address:", proxy);
console.log("New implementation address:", newImplementation);
// Attach to proxy
BatchMintNFT nft = BatchMintNFT(proxy);
// Verify current state before upgrade
console.log("Current nextTokenId:", nft.nextTokenId());
console.log("Current mintingEnabled:", nft.mintingEnabled());
// Perform upgrade
console.log("\nPerforming upgrade...");
nft.upgradeTo(newImplementation);
vm.stopBroadcast();
// Verify upgrade
console.log("\n=== Upgrade Summary ===");
console.log("Proxy address:", proxy);
console.log("New implementation:", newImplementation);
console.log("Upgrade completed successfully!");
console.log("\nVerify that:");
console.log("1. Data is preserved (tokens, balances, etc.)");
console.log("2. New methods are available");
console.log("3. Existing methods still work");
}
}