Skip to content

Commit

Permalink
feat(script): update scripts to support grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsadface committed Aug 30, 2024
1 parent 757ad15 commit d173ea6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions script/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ pragma solidity ^0.8.23;

import { console2 } from "forge-std/console2.sol";
import { Script } from "forge-std/Script.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { ICreate3Deployer } from "@create3-deployer/contracts/Create3Deployer.sol";

import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import { IPAssetRegistry } from "@storyprotocol/core/registries/IPAssetRegistry.sol";

import { StoryProtocolGateway } from "../contracts/StoryProtocolGateway.sol";
import { SPGNFT } from "../contracts/SPGNFT.sol";
Expand Down Expand Up @@ -103,7 +101,7 @@ contract Main is Script, StoryProtocolCoreAddressManager, BroadcastManager, Json
console2.log(string.concat(contractKey, " deployed to:"), newAddress);
}

function _getSalt(string memory name) private view returns (bytes32 salt) {
function _getSalt(string memory name) private pure returns (bytes32 salt) {
salt = keccak256(abi.encode(name, create3SaltSeed));
}
}
2 changes: 0 additions & 2 deletions script/UpgradeSPG.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { StringUtil } from "./utils/StringUtil.sol";
import { BroadcastManager } from "./utils/BroadcastManager.s.sol";
import { JsonDeploymentHandler } from "./utils/JsonDeploymentHandler.s.sol";

import { TestProxyHelper } from "../test/utils/TestProxyHelper.t.sol";

contract UpgradeSPG is
Script,
StoryProtocolCoreAddressManager,
Expand Down
4 changes: 3 additions & 1 deletion script/UpgradeSPGNFT.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Script } from "forge-std/Script.sol";
import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";

import { StoryProtocolGateway } from "../contracts/StoryProtocolGateway.sol";
import { GroupingWorkflow } from "../contracts/GroupingWorkflow.sol";
import { SPGNFT } from "../contracts/SPGNFT.sol";

import { StoryProtocolPeripheryAddressManager } from "./utils/StoryProtocolPeripheryAddressManager.sol";
Expand All @@ -19,6 +20,7 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas
using StringUtil for uint256;

StoryProtocolGateway private spg;
GroupingWorkflow private groupingWorkflow;
SPGNFT private spgNftImpl;
UpgradeableBeacon private spgNftBeacon;

Expand Down Expand Up @@ -48,7 +50,7 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas
_writeAddress("SPGNFTBeacon", address(spgNftBeacon));

_predeploy("SPGNFTImpl");
spgNftImpl = new SPGNFT(address(spg));
spgNftImpl = new SPGNFT(address(spg), address(groupingWorkflow));
_postdeploy("SPGNFTImpl", address(spgNftImpl));
}

Expand Down
4 changes: 4 additions & 0 deletions script/utils/StoryProtocolCoreAddressManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ contract StoryProtocolCoreAddressManager is Script {
address internal accessControllerAddr;
address internal pilTemplateAddr;
address internal licenseTokenAddr;
address internal groupingModuleAddr;
address internal groupNFTAddr;

function _readStoryProtocolCoreAddresses() internal {
string memory root = vm.projectRoot();
Expand All @@ -39,5 +41,7 @@ contract StoryProtocolCoreAddressManager is Script {
accessControllerAddr = json.readAddress(".main.AccessController");
pilTemplateAddr = json.readAddress(".main.PILicenseTemplate");
licenseTokenAddr = json.readAddress(".main.LicenseToken");
groupingModuleAddr = json.readAddress(".main.GroupingModule");
groupNFTAddr = json.readAddress(".main.GroupNFT");
}
}

0 comments on commit d173ea6

Please sign in to comment.