Skip to content

Commit

Permalink
deployed to zora-sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
oveddan committed Nov 10, 2023
1 parent edcd9cc commit 2d71e19
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .changeset/cold-toys-agree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"@zoralabs/protocol-deployments": patch
"@zoralabs/zora-1155-contracts": patch
---

Moved deployment related code from 1155 to protocol-deployments package
* Moved deployment related code from 1155 to protocol-deployments package
* Deployed 2.4.0 to zora-goerli (testnet)
11 changes: 11 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mode": "pre",
"tag": "prerelease",
"initialVersions": {
"@zoralabs/zora-1155-contracts": "2.4.0",
"@zoralabs/premint-sdk": "0.1.1",
"@zoralabs/protocol-deployments": "0.0.4",
"@zoralabs/protocol-rewards": "1.2.1"
},
"changesets": []
}
12 changes: 6 additions & 6 deletions packages/protocol-deployments/addresses/999.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"CONTRACT_1155_IMPL": "0x26C2835dd7F048B7140906fA50E77ea8f8186Bbc",
"CONTRACT_1155_IMPL_VERSION": "2.3.0",
"UPGRADE_GATE": "0xbC50029836A59A4E5e1Bb8988272F46ebA0F9900",
"FACTORY_IMPL": "0x9a42d0786c17e231E0409E8441C99acf4678763d",
"CONTRACT_1155_IMPL": "0xcD7230AFfBC8C720aE607e0Bc386fbCAF5C34C2E",
"CONTRACT_1155_IMPL_VERSION": "2.4.0",
"FACTORY_IMPL": "0x869Be2EaE4AB30Cf319a46B5dE50Ac203c8784Aa",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696017248,
"commit": "7a0ae52"
"UPGRADE_GATE": "0xbC50029836A59A4E5e1Bb8988272F46ebA0F9900",
"timestamp": 1699570171,
"commit": "385e4932"
}
2 changes: 1 addition & 1 deletion packages/protocol-deployments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"link-contracts": "rm -rf ./node_modules && cd .. && yarn"
},
"dependencies": {
"@zoralabs/zora-1155-contracts": "*",
"@zoralabs/zora-1155-contracts": "2.4.0",
"ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b",
"forge-std": "https://github.com/foundry-rs/forge-std#705263c95892a906d7af65f0f73ce8a4a0c80b80",
"solmate": "^6.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "forge-std/Script.sol";
import "forge-std/console2.sol";

import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
import {Deployment} from "../src/DeploymentConfig.sol";
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";

Expand Down
37 changes: 37 additions & 0 deletions packages/protocol-deployments/script/Simulate1155Upgrade.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "forge-std/Script.sol";
import "forge-std/console2.sol";

import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
import {Deployment, ChainConfig} from "../src/DeploymentConfig.sol";
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";

/// @dev Deploys implementation contracts for 1155 contracts.
/// @notice Run after deploying the minters
/// @notice This
contract Simulate1155Upgrade is ZoraDeployerBase {
function run() public returns (string memory) {
Deployment memory deployment = getDeployment();

ChainConfig memory chainConfig = getChainConfig();

address creator = makeAddr("creator");

vm.startBroadcast(chainConfig.factoryOwner);

(address target, bytes memory upgradeCalldata) = ZoraDeployerUtils.simulateUpgrade(deployment);

console2.log("upgrade 1155 target:", target);
console2.log("calldata:");
console.logBytes(upgradeCalldata);

ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, creator);

vm.stopBroadcast();

return getDeploymentJSON(deployment);
}
}
23 changes: 23 additions & 0 deletions packages/protocol-deployments/src/ZoraDeployerUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,27 @@ library ZoraDeployerUtils {
)
);
}

function getUpgradeCalldata(Deployment memory deployment) internal returns (bytes memory upgradeCalldata) {
// create 1155 proxy from deployment factory proxy address
ZoraCreator1155FactoryImpl factory = ZoraCreator1155FactoryImpl(deployment.factoryProxy);

address owner = factory.owner();

// simulate upgrade call
upgradeCalldata = abi.encodeWithSelector(factory.upgradeTo.selector, deployment.factoryImpl);
}

function simulateUpgrade(Deployment memory deployment) internal returns (address target, bytes memory upgradeCalldata) {
// console log update information

upgradeCalldata = getUpgradeCalldata(deployment);

target = deployment.factoryProxy;
// upgrade the factory proxy to the new implementation

(bool success, ) = target.call(upgradeCalldata);

require(success, "upgrade failed");
}
}

0 comments on commit 2d71e19

Please sign in to comment.