Skip to content

Commit

Permalink
fix(upgrade-script): remove create3 deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsadface committed Aug 20, 2024
1 parent 92adb72 commit a267081
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions script/UpgradeSPGNFT.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.23;

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

import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";

Expand All @@ -19,9 +18,6 @@ import { JsonDeploymentHandler } from "./utils/JsonDeploymentHandler.s.sol";
contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, BroadcastManager, JsonDeploymentHandler {
using StringUtil for uint256;

ICreate3Deployer private constant create3Deployer = ICreate3Deployer(0x384a891dFDE8180b054f04D66379f16B7a678Ad6);
uint256 private constant create3SaltSeed = 12;

StoryProtocolGateway private spg;
SPGNFT private spgNftImpl;
UpgradeableBeacon private spgNftBeacon;
Expand All @@ -38,7 +34,7 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas
spgNftBeacon = UpgradeableBeacon(spgNftBeaconAddr);

_beginBroadcast();
_deploySPGNFT(deployer);
_deploySPGNFT();

// Upgrade the collections via multisig (can't do here).
// spg.upgradeCollections(address(spgNftImpl));
Expand All @@ -47,17 +43,12 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas
_endBroadcast();
}

function _deploySPGNFT(address accessControlDeployer) private {
function _deploySPGNFT() private {
_writeAddress("SPG", address(spg));
_writeAddress("SPGNFTBeacon", address(spgNftBeacon));

_predeploy("SPGNFTImpl");
spgNftImpl = SPGNFT(
create3Deployer.deploy(
_getSalt(type(SPGNFT).name),
abi.encodePacked(type(SPGNFT).creationCode, abi.encode(address(spg)))
)
);
spgNftImpl = new SPGNFT(address(spg));
_postdeploy("SPGNFTImpl", address(spgNftImpl));
}

Expand All @@ -69,8 +60,4 @@ contract UpgradeSPGNFT is Script, StoryProtocolPeripheryAddressManager, Broadcas
_writeAddress(contractKey, newAddress);
console2.log(string.concat(contractKey, " deployed to:"), newAddress);
}

function _getSalt(string memory name) private view returns (bytes32 salt) {
salt = keccak256(abi.encode(name, create3SaltSeed));
}
}

0 comments on commit a267081

Please sign in to comment.