forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade tooling scripts, fix in deploy script. (storyprotocol#204)
* fix missing role in deploy script, versioning output files, helper upgrade scripts * removed empty deployment file
- Loading branch information
Showing
9 changed files
with
97 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
import { console2 } from "forge-std/console2.sol"; | ||
import { ERC6551Registry } from "erc6551/ERC6551Registry.sol"; | ||
import { ICreate3Deployer } from "@create3-deployer/contracts/ICreate3Deployer.sol"; | ||
|
||
contract DeployerUtils { | ||
|
||
ERC6551Registry internal immutable erc6551Registry; | ||
ICreate3Deployer internal immutable create3Deployer; | ||
// seed for CREATE3 salt | ||
uint256 internal create3SaltSeed; | ||
|
||
constructor( | ||
address _erc6551Registry, | ||
address _create3Deployer, | ||
uint256 _create3SaltSeed | ||
) { | ||
erc6551Registry = ERC6551Registry(_erc6551Registry); | ||
create3Deployer = ICreate3Deployer(_create3Deployer); | ||
create3SaltSeed = _create3SaltSeed; | ||
} | ||
|
||
function _getSalt(string memory name) internal virtual view returns (bytes32 salt) { | ||
console2.log(name); | ||
salt = keccak256(abi.encode(name, create3SaltSeed)); | ||
console2.logBytes32(salt); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* solhint-disable no-console */ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
import { console2 } from "forge-std/console2.sol"; | ||
|
||
contract UpgradedImplHelper { | ||
struct UpgradeProposal { | ||
string key; | ||
address proxy; | ||
address newImpl; | ||
// bytes initCall; TODO | ||
} | ||
|
||
// Upgrade tracking | ||
UpgradeProposal[] public upgradeProposals; | ||
|
||
function _addProposal( | ||
string memory key, | ||
address proxy, | ||
address newImpl | ||
) internal { | ||
require(proxy != address(0), "UpgradeImplHelper: Invalid proxy address"); | ||
require(newImpl != address(0), "UpgradeImplHelper: Invalid new implementation address"); | ||
upgradeProposals.push( | ||
UpgradeProposal({ | ||
key: key, | ||
proxy: proxy, | ||
newImpl: newImpl | ||
}) | ||
); | ||
} | ||
|
||
function _logUpgradeProposals() internal view { | ||
console2.log("Upgrade Proposals"); | ||
console2.log("Count", upgradeProposals.length); | ||
for (uint256 i = 0; i < upgradeProposals.length; i++) { | ||
console2.log("Proposal"); | ||
console2.log(upgradeProposals[i].key); | ||
if (keccak256(abi.encodePacked(upgradeProposals[i].key)) == keccak256(abi.encodePacked("IpRoyaltyVault"))) { | ||
console2.log("BeaconProxy"); | ||
} else { | ||
console2.log("Proxy"); | ||
} | ||
console2.log(upgradeProposals[i].proxy); | ||
console2.log("New Impl"); | ||
console2.log(upgradeProposals[i].newImpl); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters