@zoralabs/protocol-deployments 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +24 -25
- package/CHANGELOG.md +10 -0
- package/README.md +2 -8
- package/dist/{package/chainConfigs.d.ts → chainConfigs.d.ts} +4 -3
- package/dist/chainConfigs.d.ts.map +1 -0
- package/dist/deployment.d.ts.map +1 -0
- package/dist/index.cjs +88 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -53
- package/dist/index.js.map +1 -1
- package/dist/{package/wagmiGenerated.d.ts → wagmiGenerated.d.ts} +118 -44
- package/dist/{package/wagmiGenerated.d.ts.map → wagmiGenerated.d.ts.map} +1 -1
- package/package.json +9 -21
- package/{script → scripts}/bundle-chainConfigs.mjs +9 -7
- package/tsconfig.json +1 -1
- package/tsup.config.ts +5 -5
- package/wagmi.config.ts +31 -9
- package/.env.anvil +0 -2
- package/addresses/1.json +0 -13
- package/addresses/10.json +0 -13
- package/addresses/11155111.json +0 -13
- package/addresses/420.json +0 -13
- package/addresses/424.json +0 -11
- package/addresses/5.json +0 -14
- package/addresses/58008.json +0 -11
- package/addresses/7777777.json +0 -13
- package/addresses/8453.json +0 -13
- package/addresses/84531.json +0 -14
- package/addresses/999.json +0 -13
- package/addresses/999999999.json +0 -14
- package/chainConfigs/1.json +0 -5
- package/chainConfigs/10.json +0 -5
- package/chainConfigs/11155111.json +0 -5
- package/chainConfigs/420.json +0 -5
- package/chainConfigs/424.json +0 -5
- package/chainConfigs/5.json +0 -5
- package/chainConfigs/58008.json +0 -4
- package/chainConfigs/7777777.json +0 -5
- package/chainConfigs/8453.json +0 -5
- package/chainConfigs/84531.json +0 -5
- package/chainConfigs/999.json +0 -5
- package/chainConfigs/999999999.json +0 -5
- package/deterministicConfig/factoryProxy/params.json +0 -10
- package/deterministicConfig/factoryProxy/signatures.json +0 -14
- package/deterministicConfig/premintExecutorProxy/params.json +0 -10
- package/deterministicConfig/premintExecutorProxy/signatures.json +0 -12
- package/deterministicConfig/upgradeGate/params.json +0 -7
- package/deterministicConfig/upgradeGate/signatures.json +0 -14
- package/dist/package/batchPublish.test.d.ts +0 -452
- package/dist/package/batchPublish.test.d.ts.map +0 -1
- package/dist/package/chainConfigs.d.ts.map +0 -1
- package/dist/package/deployment.d.ts.map +0 -1
- package/dist/package/index.d.ts.map +0 -1
- package/dist/script/copy-deployed-contracts.d.ts +0 -2
- package/dist/script/copy-deployed-contracts.d.ts.map +0 -1
- package/dist/script/signDeploymentTransactions.d.ts +0 -2
- package/dist/script/signDeploymentTransactions.d.ts.map +0 -1
- package/foundry.toml +0 -41
- package/package/batchPublish.test.ts +0 -327
- package/package/wagmiGenerated.ts +0 -3657
- package/remappings.txt +0 -9
- package/script/CalculateDeterministicParams.s.sol +0 -84
- package/script/DeployMintersAndImplementations.s.sol +0 -29
- package/script/DeployNew1155Impl.s.sol +0 -24
- package/script/DeployNewImplementation.s.sol +0 -26
- package/script/DeployPreminterImpl.s.sol +0 -23
- package/script/DeployProxiesToNewChain.s.sol +0 -50
- package/script/DeployTestContracts.s.sol +0 -35
- package/script/DeployUpgradeGate.s.sol +0 -27
- package/script/Upgrade.s.sol +0 -83
- package/script/UpgradePreminter.s.sol +0 -34
- package/script/copy-deployed-contracts.ts +0 -86
- package/script/signDeploymentTransactions.ts +0 -302
- package/src/DeploymentConfig.sol +0 -124
- package/src/DeploymentTestingUtils.sol +0 -166
- package/src/DeterministicDeployerScript.sol +0 -249
- package/src/DeterministicProxyDeployer.sol +0 -139
- package/src/IImmutableCreate2Factory.sol +0 -59
- package/src/Zora1155PremintFixtures.sol +0 -75
- package/src/ZoraDeployerBase.sol +0 -144
- package/src/ZoraDeployerUtils.sol +0 -212
- package/test/NewFactoryProxyDeployer.t.sol +0 -127
- package/test/UpgradesTest.t.sol +0 -222
- package/test/ZoraCreator1155Factory_Fork.t.sol +0 -149
- package/test/ZoraCreator1155PremintExecutorForkTest.t.sol +0 -205
- /package/dist/{package/deployment.d.ts → deployment.d.ts} +0 -0
- /package/dist/{package/index.d.ts → index.d.ts} +0 -0
- /package/{package → src}/deployment.ts +0 -0
- /package/{package → src}/index.ts +0 -0
package/remappings.txt
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
ds-test/=node_modules/ds-test/src/
|
|
2
|
-
forge-std/=node_modules/forge-std/src/
|
|
3
|
-
@zoralabs/openzeppelin-contracts-upgradeable/=node_modules/@zoralabs/openzeppelin-contracts-upgradeable/
|
|
4
|
-
@zoralabs/protocol-rewards/src/=node_modules/@zoralabs/protocol-rewards/src/
|
|
5
|
-
@zoralabs/zora-1155-contracts/src/=node_modules/@zoralabs/zora-1155-contracts/src/
|
|
6
|
-
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
|
|
7
|
-
_imagine=node_modules/@zoralabs/zora-1155-contracts/_imagine
|
|
8
|
-
solemate/=/node_modules/solemate/src/
|
|
9
|
-
solady/=node_modules/solady/src/
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// spdx-license-identifier: mit
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Zora1155Factory} from "@zoralabs/zora-1155-contracts/src/proxies/Zora1155Factory.sol";
|
|
9
|
-
import {ProxyShim} from "@zoralabs/zora-1155-contracts/src/utils/ProxyShim.sol";
|
|
10
|
-
import {UpgradeGate} from "@zoralabs/zora-1155-contracts/src/upgrades/UpgradeGate.sol";
|
|
11
|
-
import {LibString} from "solady/utils/LibString.sol";
|
|
12
|
-
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
|
|
13
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
14
|
-
import {Zora1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/proxies/Zora1155PremintExecutor.sol";
|
|
15
|
-
import {DeterministicDeployerScript, DeterministicParams} from "../src/DeterministicDeployerScript.sol";
|
|
16
|
-
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
|
17
|
-
|
|
18
|
-
/// @title Gets parameters for deterministically deploying a new 1155 factory proxy at an address starting with 0x777777, regardless of the chain.
|
|
19
|
-
/// @dev Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi
|
|
20
|
-
/// @author doved
|
|
21
|
-
/// @notice Ensure to set env variable for DEPLOYER
|
|
22
|
-
contract FactoryProxyDeterministicParams is ZoraDeployerBase {
|
|
23
|
-
address deployerAddress;
|
|
24
|
-
// Set in step 2
|
|
25
|
-
address proxyDeployerAddress;
|
|
26
|
-
|
|
27
|
-
function run() public {
|
|
28
|
-
vm.createSelectFork("zora_goerli", 1252119);
|
|
29
|
-
|
|
30
|
-
deployerAddress = vm.envAddress("TURNKEY_TARGET_ADDRESS");
|
|
31
|
-
|
|
32
|
-
calculateForFactoryProxy();
|
|
33
|
-
calculateForPremintExecutorProxy();
|
|
34
|
-
|
|
35
|
-
// Note: relies on proxyDeployerAddress
|
|
36
|
-
calculateUpgradeGateAddress();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function calculateForFactoryProxy() internal {
|
|
40
|
-
bytes memory proxyCreationCode = type(Zora1155Factory).creationCode;
|
|
41
|
-
|
|
42
|
-
DeterministicParams memory deterministicParams = getDeterministicDeploymentParams(deployerAddress, proxyCreationCode, 100);
|
|
43
|
-
|
|
44
|
-
proxyDeployerAddress = deterministicParams.proxyDeployerAddress;
|
|
45
|
-
|
|
46
|
-
mkdir("deterministicConfig/factoryProxy");
|
|
47
|
-
serializeAndSaveOutput(deterministicParams, "factoryProxy");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function calculateForPremintExecutorProxy() internal {
|
|
51
|
-
bytes memory proxyCreationCode = type(Zora1155PremintExecutor).creationCode;
|
|
52
|
-
|
|
53
|
-
DeterministicParams memory deterministicParams = getDeterministicDeploymentParams(deployerAddress, proxyCreationCode, 200);
|
|
54
|
-
|
|
55
|
-
mkdir("deterministicConfig/premintExecutorProxy");
|
|
56
|
-
serializeAndSaveOutput(deterministicParams, "premintExecutorProxy");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// @notice Since this doesn't
|
|
60
|
-
function calculateUpgradeGateAddress() internal {
|
|
61
|
-
bytes memory creationCodeUpgradeGate = type(UpgradeGate).creationCode;
|
|
62
|
-
bytes32 salt = saltWithAddressInFirst20Bytes(deployerAddress, 20);
|
|
63
|
-
address resultAddress = Create2.computeAddress(salt, keccak256(creationCodeUpgradeGate), proxyDeployerAddress);
|
|
64
|
-
|
|
65
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "deployerAddress", deployerAddress);
|
|
66
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "upgradeGateAddress", resultAddress);
|
|
67
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "proxyDeployerAddress", proxyDeployerAddress);
|
|
68
|
-
vm.serializeBytes32("UPGRADE_GATE_JSON", "salt", salt);
|
|
69
|
-
string memory output = vm.serializeBytes("UPGRADE_GATE_JSON", "creationCode", creationCodeUpgradeGate);
|
|
70
|
-
|
|
71
|
-
console2.log(output);
|
|
72
|
-
|
|
73
|
-
mkdir("deterministicConfig/upgradeGate");
|
|
74
|
-
vm.writeJson(output, paramsFilePath("upgradeGate"));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function mkdir(string memory path) internal {
|
|
78
|
-
string[] memory commands = new string[](3);
|
|
79
|
-
commands[0] = "mkdir";
|
|
80
|
-
commands[1] = "-p";
|
|
81
|
-
commands[2] = path;
|
|
82
|
-
vm.ffi(commands);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
9
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
10
|
-
|
|
11
|
-
contract DeployMintersAndImplementations is ZoraDeployerBase {
|
|
12
|
-
function run() public returns (string memory) {
|
|
13
|
-
Deployment memory deployment = getDeployment();
|
|
14
|
-
|
|
15
|
-
address deployer = vm.envAddress("DEPLOYER");
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast(deployer);
|
|
18
|
-
|
|
19
|
-
deployMinters(deployment);
|
|
20
|
-
|
|
21
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
22
|
-
|
|
23
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
24
|
-
|
|
25
|
-
vm.stopBroadcast();
|
|
26
|
-
|
|
27
|
-
return getDeploymentJSON(deployment);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys implementation contracts for 1155 contracts.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
/// @notice This
|
|
14
|
-
contract DeployNewImplementations is ZoraDeployerBase {
|
|
15
|
-
function run() public returns (string memory) {
|
|
16
|
-
Deployment memory deployment = getDeployment();
|
|
17
|
-
|
|
18
|
-
vm.startBroadcast();
|
|
19
|
-
|
|
20
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
21
|
-
|
|
22
|
-
return getDeploymentJSON(deployment);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys implementation contracts for 1155 contracts.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
/// @notice This
|
|
14
|
-
contract DeployNewImplementations is ZoraDeployerBase {
|
|
15
|
-
function run() public returns (string memory) {
|
|
16
|
-
Deployment memory deployment = getDeployment();
|
|
17
|
-
|
|
18
|
-
vm.startBroadcast();
|
|
19
|
-
|
|
20
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
21
|
-
|
|
22
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
23
|
-
|
|
24
|
-
return getDeploymentJSON(deployment);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys preminter implementation contract.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
contract DeployPreminterImpl is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
20
|
-
|
|
21
|
-
return getDeploymentJSON(deployment);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {DeploymentTestingUtils} from "../src/DeploymentTestingUtils.sol";
|
|
11
|
-
import {IZoraCreator1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155PremintExecutor.sol";
|
|
12
|
-
|
|
13
|
-
contract DeployProxiesToNewChain is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
console.log("deploy factory proxy");
|
|
20
|
-
|
|
21
|
-
deployFactoryProxyDeterminstic(deployment);
|
|
22
|
-
|
|
23
|
-
console2.log("factory proxy address:", deployment.factoryProxy);
|
|
24
|
-
|
|
25
|
-
console2.log("create test contract for verification");
|
|
26
|
-
|
|
27
|
-
ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, makeAddr("admin"));
|
|
28
|
-
|
|
29
|
-
deployPreminterProxyDeterminstic(deployment);
|
|
30
|
-
|
|
31
|
-
console2.log("preminter proxy", deployment.preminterProxy);
|
|
32
|
-
|
|
33
|
-
console2.log("testing premint");
|
|
34
|
-
|
|
35
|
-
address fundsRecipient = vm.envAddress("TEST_PREMINT_FUNDS_RECIPIENT");
|
|
36
|
-
IZoraCreator1155PremintExecutor.MintArguments memory mintArguments = IZoraCreator1155PremintExecutor.MintArguments({
|
|
37
|
-
mintRecipient: fundsRecipient,
|
|
38
|
-
mintComment: "",
|
|
39
|
-
mintRewardsRecipients: new address[](0)
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
signAndExecutePremintV2(deployment.preminterProxy, vm.envAddress("TEST_PREMINT_FUNDS_RECIPIENT"), mintArguments);
|
|
43
|
-
|
|
44
|
-
vm.stopBroadcast();
|
|
45
|
-
|
|
46
|
-
// now test signing and executing premint
|
|
47
|
-
|
|
48
|
-
return getDeploymentJSON(deployment);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {IZoraCreator1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155PremintExecutor.sol";
|
|
11
|
-
|
|
12
|
-
contract DeployTestContracts is ZoraDeployerBase {
|
|
13
|
-
function run() public returns (string memory) {
|
|
14
|
-
Deployment memory deployment = getDeployment();
|
|
15
|
-
|
|
16
|
-
vm.startBroadcast();
|
|
17
|
-
|
|
18
|
-
ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, makeAddr("admin"));
|
|
19
|
-
|
|
20
|
-
address fundsRecipient = vm.envAddress("DEPLOYER");
|
|
21
|
-
IZoraCreator1155PremintExecutor.MintArguments memory mintArguments = IZoraCreator1155PremintExecutor.MintArguments({
|
|
22
|
-
mintRecipient: fundsRecipient,
|
|
23
|
-
mintComment: "",
|
|
24
|
-
mintRewardsRecipients: new address[](0)
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
signAndExecutePremintV2(deployment.preminterProxy, fundsRecipient, mintArguments);
|
|
28
|
-
|
|
29
|
-
vm.stopBroadcast();
|
|
30
|
-
|
|
31
|
-
// now test signing and executing premint
|
|
32
|
-
|
|
33
|
-
return getDeploymentJSON(deployment);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {DeploymentTestingUtils} from "../src/DeploymentTestingUtils.sol";
|
|
11
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
12
|
-
|
|
13
|
-
contract DeployUpgradeGate is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
deployUpgradeGateDeterminstic(deployment);
|
|
20
|
-
|
|
21
|
-
vm.stopBroadcast();
|
|
22
|
-
|
|
23
|
-
// now test signing and executing premint
|
|
24
|
-
|
|
25
|
-
return getDeploymentJSON(deployment);
|
|
26
|
-
}
|
|
27
|
-
}
|
package/script/Upgrade.s.sol
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
|
|
6
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
7
|
-
import {ChainConfig, Deployment} from "../src/DeploymentConfig.sol";
|
|
8
|
-
|
|
9
|
-
import {ZoraCreator1155FactoryImpl} from "@zoralabs/zora-1155-contracts/src/factory/ZoraCreator1155FactoryImpl.sol";
|
|
10
|
-
import {Zora1155Factory} from "@zoralabs/zora-1155-contracts/src/proxies/Zora1155Factory.sol";
|
|
11
|
-
import {ZoraCreator1155Impl} from "@zoralabs/zora-1155-contracts/src/nft/ZoraCreator1155Impl.sol";
|
|
12
|
-
import {ICreatorRoyaltiesControl} from "@zoralabs/zora-1155-contracts/src/interfaces/ICreatorRoyaltiesControl.sol";
|
|
13
|
-
import {IZoraCreator1155Factory} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155Factory.sol";
|
|
14
|
-
import {IMinter1155} from "@zoralabs/zora-1155-contracts/src/interfaces/IMinter1155.sol";
|
|
15
|
-
import {IZoraCreator1155} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155.sol";
|
|
16
|
-
import {ZoraCreatorFixedPriceSaleStrategy} from "@zoralabs/zora-1155-contracts/src/minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol";
|
|
17
|
-
import {ZoraCreatorMerkleMinterStrategy} from "@zoralabs/zora-1155-contracts/src/minters/merkle/ZoraCreatorMerkleMinterStrategy.sol";
|
|
18
|
-
import {ZoraCreatorRedeemMinterFactory} from "@zoralabs/zora-1155-contracts/src/minters/redeem/ZoraCreatorRedeemMinterFactory.sol";
|
|
19
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
20
|
-
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
|
21
|
-
|
|
22
|
-
contract UpgradeScript is ZoraDeployerBase {
|
|
23
|
-
using Strings for uint256;
|
|
24
|
-
using stdJson for string;
|
|
25
|
-
|
|
26
|
-
string configFile;
|
|
27
|
-
|
|
28
|
-
function run() public returns (string memory) {
|
|
29
|
-
Deployment memory deployment = getDeployment();
|
|
30
|
-
ChainConfig memory chainConfig = getChainConfig();
|
|
31
|
-
|
|
32
|
-
vm.startBroadcast();
|
|
33
|
-
|
|
34
|
-
if (deployment.fixedPriceSaleStrategy == address(0)) {
|
|
35
|
-
deployment.fixedPriceSaleStrategy = address(new ZoraCreatorFixedPriceSaleStrategy());
|
|
36
|
-
console2.log("New FixedPriceMinter", deployment.fixedPriceSaleStrategy);
|
|
37
|
-
} else {
|
|
38
|
-
console2.log("Existing FIXED_PRICE_STRATEGY", deployment.fixedPriceSaleStrategy);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (deployment.merkleMintSaleStrategy == address(0)) {
|
|
42
|
-
deployment.merkleMintSaleStrategy = address(new ZoraCreatorMerkleMinterStrategy());
|
|
43
|
-
console2.log("New MerkleMintStrategy", deployment.merkleMintSaleStrategy);
|
|
44
|
-
} else {
|
|
45
|
-
console2.log("Existing MERKLE_MINT_STRATEGY", deployment.merkleMintSaleStrategy);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (deployment.redeemMinterFactory == address(0)) {
|
|
49
|
-
deployment.redeemMinterFactory = address(new ZoraCreatorRedeemMinterFactory());
|
|
50
|
-
console2.log("New REDEEM_MINTER_FACTORY", address(deployment.redeemMinterFactory));
|
|
51
|
-
} else {
|
|
52
|
-
console2.log("Existing REDEEM_MINTER_FACTORY", deployment.redeemMinterFactory);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
bool isNewNFTImpl = deployment.contract1155Impl == address(0);
|
|
56
|
-
if (isNewNFTImpl) {
|
|
57
|
-
console2.log("mintFeeRecipient", chainConfig.mintFeeRecipient);
|
|
58
|
-
console2.log("protocolRewards", chainConfig.protocolRewards);
|
|
59
|
-
deployment.contract1155Impl = address(new ZoraCreator1155Impl(chainConfig.mintFeeRecipient, deployment.factoryProxy, chainConfig.protocolRewards));
|
|
60
|
-
console2.log("New NFT_IMPL", deployment.contract1155Impl);
|
|
61
|
-
} else {
|
|
62
|
-
console2.log("Existing NFT_IMPL", deployment.contract1155Impl);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
deployment.factoryProxy = address(
|
|
66
|
-
new ZoraCreator1155FactoryImpl({
|
|
67
|
-
_zora1155Impl: IZoraCreator1155(deployment.contract1155Impl),
|
|
68
|
-
_merkleMinter: ZoraCreatorMerkleMinterStrategy(deployment.merkleMintSaleStrategy),
|
|
69
|
-
_redeemMinterFactory: ZoraCreatorRedeemMinterFactory(deployment.redeemMinterFactory),
|
|
70
|
-
_fixedPriceMinter: ZoraCreatorFixedPriceSaleStrategy(deployment.fixedPriceSaleStrategy)
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
console2.log("New Factory Impl", deployment.factoryImpl);
|
|
75
|
-
console2.log("Upgrade to this new factory impl on the proxy:", deployment.factoryProxy);
|
|
76
|
-
|
|
77
|
-
if (isNewNFTImpl) {
|
|
78
|
-
ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, makeAddr("admin"));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return getDeploymentJSON(deployment);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {ChainConfig, Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {UUPSUpgradeable} from "@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
10
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
11
|
-
|
|
12
|
-
contract UpgradePreminter is ZoraDeployerBase {
|
|
13
|
-
function run() public returns (string memory, bytes memory upgradeCalldata, address upgradeTarget) {
|
|
14
|
-
Deployment memory deployment = getDeployment();
|
|
15
|
-
|
|
16
|
-
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
|
|
17
|
-
|
|
18
|
-
vm.startBroadcast(deployerPrivateKey);
|
|
19
|
-
|
|
20
|
-
address preminterImplementation = ZoraDeployerUtils.deployNewPreminterImplementationDeterminstic(deployment.factoryProxy);
|
|
21
|
-
|
|
22
|
-
vm.stopBroadcast();
|
|
23
|
-
|
|
24
|
-
upgradeCalldata = abi.encodeWithSelector(UUPSUpgradeable.upgradeTo.selector, preminterImplementation);
|
|
25
|
-
|
|
26
|
-
upgradeTarget = deployment.preminterImpl;
|
|
27
|
-
|
|
28
|
-
console2.log("Upgrade PremintExecutor target and implementatin:", upgradeTarget, preminterImplementation);
|
|
29
|
-
console2.log("To upgrade, use this calldata:");
|
|
30
|
-
console2.logBytes(upgradeCalldata);
|
|
31
|
-
|
|
32
|
-
return (getDeploymentJSON(deployment), upgradeCalldata, upgradeTarget);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { writeFile, readFile } from "fs/promises";
|
|
2
|
-
import esMain from "es-main";
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { glob } from "glob";
|
|
5
|
-
|
|
6
|
-
type Deploy = {
|
|
7
|
-
timestamp: number;
|
|
8
|
-
commit: string;
|
|
9
|
-
returns: { value: string }[];
|
|
10
|
-
chain: number;
|
|
11
|
-
};
|
|
12
|
-
async function copyEnvironmentRunFiles() {
|
|
13
|
-
const latestFiles = await glob(`broadcast/**/*run-latest.json`);
|
|
14
|
-
|
|
15
|
-
const allFileContents = await Promise.all(
|
|
16
|
-
latestFiles.map(async (file: string) => {
|
|
17
|
-
const fileParts = file.split("/");
|
|
18
|
-
const chainId = fileParts[fileParts.length - 2];
|
|
19
|
-
const parsed = JSON.parse(await readFile(file, "utf-8")) as Deploy;
|
|
20
|
-
const returns = parsed.returns[0]?.value || "{}";
|
|
21
|
-
|
|
22
|
-
// a recent version of forge added a bug where the returns value with some sort of url based encoding.
|
|
23
|
-
// the below code is a hack to fix this. It should be removed once forge is fixed.
|
|
24
|
-
// use string regex replace all to remove all instances of \\ from returns (this appeared in a wierd version of forge)
|
|
25
|
-
// also opening and closing quotes that incorrecly appear before opening bracket:
|
|
26
|
-
const filtered = returns
|
|
27
|
-
.replace(/\\/g, "")
|
|
28
|
-
.replace('"{', "{")
|
|
29
|
-
.replace('}"', "}");
|
|
30
|
-
|
|
31
|
-
const parsedReturns = JSON.parse(filtered);
|
|
32
|
-
return {
|
|
33
|
-
chainId,
|
|
34
|
-
timestamp: parsed.timestamp,
|
|
35
|
-
returns: parsedReturns,
|
|
36
|
-
};
|
|
37
|
-
}),
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const groupedByChainId = allFileContents.reduce(
|
|
41
|
-
(acc: any, file: any) => {
|
|
42
|
-
const chainId = file.chainId!;
|
|
43
|
-
if (isNaN(Number(chainId))) return acc;
|
|
44
|
-
|
|
45
|
-
if (!acc[chainId]) {
|
|
46
|
-
acc[chainId] = [];
|
|
47
|
-
}
|
|
48
|
-
acc[chainId]!.push(file);
|
|
49
|
-
return acc;
|
|
50
|
-
},
|
|
51
|
-
{} as Record<string, Deploy[]>,
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const withLatest = Object.entries(groupedByChainId).map(
|
|
55
|
-
([chainId, files]: any) => {
|
|
56
|
-
const latest = files.sort(
|
|
57
|
-
(a: any, b: any) => b.timestamp! - a.timestamp!,
|
|
58
|
-
)[0];
|
|
59
|
-
return {
|
|
60
|
-
chainId,
|
|
61
|
-
latest,
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
withLatest.forEach(async ({ chainId, latest }) => {
|
|
67
|
-
const filePath = `addresses/${chainId}.json`;
|
|
68
|
-
|
|
69
|
-
await writeFile(
|
|
70
|
-
filePath,
|
|
71
|
-
JSON.stringify(
|
|
72
|
-
{
|
|
73
|
-
...latest!.returns,
|
|
74
|
-
timestamp: latest!.timestamp,
|
|
75
|
-
commit: latest!.commit,
|
|
76
|
-
},
|
|
77
|
-
null,
|
|
78
|
-
2,
|
|
79
|
-
),
|
|
80
|
-
);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (esMain(import.meta)) {
|
|
85
|
-
await copyEnvironmentRunFiles();
|
|
86
|
-
}
|