Skip to content

Commit

Permalink
Deploy new versions and determinstic proxies to rest of chains. Impro…
Browse files Browse the repository at this point in the history
…ved deployment scripts

* Deployed version 2.0.0 of contracts, and deterministic proxies to: mainnet, goerli, base, base goerli, optimism, optimism goerli.
* Improved deployment scripts to make them more composable and encapsulate updating deployment config
* Changed `copy-deployed-contracts.mjs` to typescript, and have it pull the latest deployment for each chain from all scripts.
* Updated readme with latest deployment instructions
  • Loading branch information
oveddan authored Oct 5, 2023
1 parent bfdcd08 commit 9207e8f
Show file tree
Hide file tree
Showing 26 changed files with 430 additions and 307 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-keys-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": patch
---

Deployed determinstic proxies and latest versions to mainnet, goerli, base, base goerli, optimism, optimism goerli
29 changes: 23 additions & 6 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
## Deploying to a new chain

1. Setup new `chainConfigs` file setting 1. fee recipient, and 2. owner for factory contracts
2. Run forge/foundry deploy script
3. Update deployed addresses file `yarn run update-new-deployment-addresses`
4. Verify `addresses/CHAINID.json` exists.
5. Ensure contracts are verified on block explorer.
7. Add a changeset with `npx changeset`
6. Make PR with new addresses json files and changeset.
2. Generate signatures for deploying upgrade gate at a deterministic address and trasfering ownership to the factory owner:

npx tsx script/signDeploymentTransactions.ts

3. Deploy upgrade gate and implementation contracts:

forge script script/DeployMintersAndImplementations.s.sol $(chains {CHAINNAME} --deploy) --interactives 1 --broadcast --verify

4. Copy deployed addresses to `addresses/{CHAINID}.json`:

npx tsx script/copy-deployed-contracts.ts

5. Generate signatures to deploy proxy contracts at determinstic address:

npx tsx script/signDeploymentTransactions.ts

6. Deploy proxy contracts:

forge script script/DeployProxiesToNewChain.s.sol $(chains {CHAINNAME} --deploy) --interactives 1 --broadcast --verify

7. Ensure contracts are verified on block explorer.
8. Add a changeset with `npx changeset`
9. Make PR with new addresses json files and changeset.

# Whats bundled in the published package

Expand Down
20 changes: 12 additions & 8 deletions addresses/1.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"FIXED_PRICE_SALE_STRATEGY": "0x8A1DBE9b1CeB1d17f92Bebf10216FCFAb5C3fbA7",
"MERKLE_MINT_SALE_STRATEGY": "0x5c895Cc296e334CA11DF751aA72135807D4057d4",
"REDEEM_MINTER_FACTORY": "0xdA48f625903547Dc7B70Ad8E019e7dFc55d0aA96",
"CONTRACT_1155_IMPL": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A",
"FACTORY_PROXY": "0xA6C5f2DE915240270DaC655152C3f6A91748cb85"
}
"CONTRACT_1155_IMPL": "0x8e90D8cfc0CA66EA143930E4c5F7E31Bf16F722b",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0x55B53DBE22859d538E3b44DD06C9FAE292409E3c",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696362785,
"commit": "5e4c96a"
}
14 changes: 8 additions & 6 deletions addresses/10.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0x8Ca5e648C5dFEfcdDa06d627F4b490B719ccFD98",
"FACTORY_PROXY": "0x78b524931e9d847c40BcBf225c25e154a7B05fDA",
"CONTRACT_1155_IMPL": "0xF3a46845548bE811Ce37e65153563f4a0AaEbe31",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0xF7e49F97E82cc38ACd82E303F37Fe046f5a190B5",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x3678862f04290E565cCA2EF163BAeb92Bb76790C",
"MERKLE_MINT_SALE_STRATEGY": "0x899ce31dF6C6Af81203AcAaD285bF539234eF4b8",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x1B28A04b7eB7b93f920ddF2021aa3fAE065395f2",
"timestamp": 1683685200,
"commit": "3e8799e"
"timestamp": 1696355077,
"commit": "dbb5d57"
}
20 changes: 11 additions & 9 deletions addresses/420.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0x34c976E09EEcA565E208b0860Ea83F3cB881d205",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0x39Bcc1e15b8ec15684F17fEf298151F4A544B591",
"FACTORY_PROXY": "0xb0C56317E9cEBc6E0f7A59458a83D0A9ccC3e955",
"FIXED_PRICE_SALE_STRATEGY": "0x5b31082c269e1e575b371e14dec2594ebc6a4c5a",
"MERKLE_MINT_SALE_STRATEGY": "0xC126d0C412bE68809827c0522Eba05910936e46b",
"REDEEM_MINTER_FACTORY": "0x06E71de8A63c5392a15d06665C36184dbE78C85B",
"timestamp": 1686277138,
"commit": "563e0ff"
"CONTRACT_1155_IMPL": "0xAF5A4F6F6640734d7D000321Bb27De40D4Ae91f6",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0x7B59c0378F540c0356A5DAEF7574255A7C74EC76",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696354853,
"commit": "0656a4c"
}
20 changes: 11 additions & 9 deletions addresses/5.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0x89a53404d3e29c6e5431d73e04F44045d37D01FE",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0xA06262157905913f855573f53AD48DE2D4ba1F4A",
"FACTORY_PROXY": "0x8732b4bCa198509bB9c40f9a24638Be1eaB7D30c",
"FIXED_PRICE_SALE_STRATEGY": "0xD8EB23E82f0795427F27D7F20CAb56e7630D1166",
"MERKLE_MINT_SALE_STRATEGY": "0x91724462892148fb0bAcD300d7503A80baB32aA5",
"REDEEM_MINTER_FACTORY": "0xD507589779D7a4ec85FF9041dB2C2dc19e4B0554",
"timestamp": 1688510153,
"commit": "f60dd5f"
"CONTRACT_1155_IMPL": "0x455c9D3188A3Cd94aCDE8E5Ec90cA92FC10805EA",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0x9074Ae399235d26B56e3aF1331b033366E4FE072",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696361976,
"commit": "a8eeef3"
}
20 changes: 11 additions & 9 deletions addresses/8453.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87",
"FACTORY_PROXY": "0x9b24FD165a371042e5CA81e8d066d25CAD11EDE7",
"FIXED_PRICE_SALE_STRATEGY": "0xFF8B0f870ff56870Dc5aBd6cB3E6E89c8ba2e062",
"MERKLE_MINT_SALE_STRATEGY": "0xbC98b527433266910fcc0ae56E17DDbd41846bCB",
"REDEEM_MINTER_FACTORY": "0x56Ab0bc1971f5fE6A263cA34050896f4B0fcF88E",
"timestamp": 1689781747,
"commit": "1854b5d"
"CONTRACT_1155_IMPL": "0x314E552b55DFbDfD4d76623E1D45E5056723998B",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0xC6899816663891D7493939d74d83cb7f2BBcBB16",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696357595,
"commit": "804ad45"
}
20 changes: 11 additions & 9 deletions addresses/84531.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0x669c0E36c7C3b7Ba984F746c43C5b7C073db7197",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0x2bB7D8226575AEB76597A50134088BaA8AaA48De",
"FACTORY_PROXY": "0x9168C5ba5a0a76db8A1BF5b2eE5557f2A0ECA4f4",
"FIXED_PRICE_SALE_STRATEGY": "0x66e7bE0b5A7dD9eb7999AAbE7AbdFa40381b6d5E",
"MERKLE_MINT_SALE_STRATEGY": "0xFFc886a0C539e2AB50211D7C55f01408507a3c65",
"REDEEM_MINTER_FACTORY": "0x13dAA8E9e3f68deDE7b1386ACdc12eA98F2FB688",
"timestamp": 1689090854,
"commit": "4cfd3cc"
"CONTRACT_1155_IMPL": "0xD66B730aA3B4921356Fc56907D22e65CA9F4ff58",
"CONTRACT_1155_IMPL_VERSION": "2.0.0",
"FACTORY_IMPL": "0xF482C51346f3c77673dc619F243Eb8B09E9A954E",
"FACTORY_PROXY": "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
"FIXED_PRICE_SALE_STRATEGY": "0x04E2516A2c207E84a1839755675dfd8eF6302F0a",
"MERKLE_MINT_SALE_STRATEGY": "0xf48172CA3B6068B20eE4917Eb27b5472f1f272C7",
"PREMINTER_IMPL": "0x6E2AbBcd82935bFC68A1d5d2c96372b13b65eD9C",
"PREMINTER_PROXY": "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
"REDEEM_MINTER_FACTORY": "0x78964965cF77850224513a367f899435C5B69174",
"timestamp": 1696355958,
"commit": "9a9df5f"
}
12 changes: 6 additions & 6 deletions deterministicConfig/factoryProxy/signatures.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"1": "0xbc9e925ad723c48a9a52fcfe42e21440ceb3dac3865d1cfc5fd5afd5e83575cd38fe281dea73e4f04b39281bf9237427a069df50a313913d189afe7ca1fc611f1b",
"5": "0x9864c37cbb0684ccbe21a8295a45e52947d2baf171b197b3c86216e8731bbd4245a1814964a3b34034d03982a56aac731b41f67eaf8bfa29a5bd532dcafd411d1c",
"10": "0xa1d757624927c176ff756177cb6d9da085e1d2d0a6e58f62fdc3d5f0b1528da81e15207c66a868d9f6412bcddf532e983d88b01c52343228b2f1e908b26f5a921b",
"420": "0x63a19226346eac1a22816e51d22bcde3daaa4fd5b0c0e032ac339ae0c4526fa611000d9d86ce9ec24432f6730872a885686424a050545eac19381ecf175ebc931b",
"1": "0xcd4c9970be747e8789231d2caf25299f1a5398220722bf415f146b510aad968d6aeec91da8a564e03a383ea162c54ac7cce794ccd39c1561e08ecbe8a7ac39791c",
"5": "0xabbaa6951c41abd10a624ee695a6e5c35038df0e933478cef339ce54b072483d3e7ee5736d1c71833c25a3e852c5c2bf910b7663f4d56569da977ad9e14ad9231c",
"10": "0xf748deeb047a535753c9f751904958ad446b6c93eae089ce62f045f9a7fb525250e946095b9534e649b9b1efd6eb3e7264ad7bf65711866569205604315d237e1b",
"420": "0x64e0922bd08e7256d5622a692ef8a015ca2ed421d19813495e9e1056ff537a30361917fd0c4cff183bc54b75098d9b3b087393b2be52c8c9ee5105001edd0e6c1b",
"424": "0xcc4a742f435b66a75c054f18b8b1bd92d46e92a3bf0d02ad0ab9e9b5e66095be19721f3123c5754de5067ec8a1cdfbed18e4e99e66c433034f74d62373b5cd221b",
"999": "0x560ec794208401df7446777c93ae50cb202be28e80a06700101ddb526d0541b33fedaf949e931bf8ce01b4648cf89b4b29c45c6f4125584e9c368b34079849cf1b",
"8453": "0xebba1e596cdad038f08ba902230ef61b0dde8e6451e23871e698597a984243af3596efeaf82ab56af6c14cea05b9dcb3f738949b80f1866c25d59368dc46fbd71b",
"8453": "0x4c26816c8b9f4cdd8f56d789b77d943b2f1676abc3d4af90c18a3a6aec9595bd3f7ff530867885969bafa3cc43f6098d7c867e8ea0fd190ffd03a1071aae92481b",
"58008": "0xae84314a335c1faca4472d2fede2a730b3bc444cb371c20e0ccff1507bc6918478ac088668371101a39a2a0ecdf6161c5a2a66eeaa12f32d92ea53ffd25665ad1c",
"84531": "0xde44b0d71687ae81424fc8ae0af0c7f572406021f6f9f1577195e6aba1ca2dcc33da2a1fe7bf3982be87a92955c7f041823eb9d2f1e2daacad17079c522e1f201c",
"84531": "0x0575f344bd610c1206335dcb5b5041b84b8f93e5f12b733d9c85a875e037744e751f431fb65e4822af8f6bc4444be6be96ffb16a8d9ab6b196ba1d961e7e75921b",
"7777777": "0x8ccdbb2700e9fe53111443c4d2262a2a9ae7edc2e550d270c632bd3516b6c86974d81bb2b6c49d5ee751dbbf6ad0d5296f9a8e8213ff58a9a2cb7e6bb1b3a6f81c",
"11155111": "0x13840cf936c6c07dc185b7f1023072bd91d4494786b2f356b1510e32e4e8b50e5e954c60d895c4be500c071d937a786952a8ed514028dacaf75cdf15222140ca1c"
}
4 changes: 4 additions & 0 deletions deterministicConfig/premintExecutorProxy/signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"1": "0xeb5417ad05bb90e252937c3258e9843730d0224f0a5f38f43d48a4ce6f23673a5c6da3f17e5aec99346d6bcab86def782bdc65a57942a4f90950b8e8bdc022ca1c",
"5": "0x1293214f6aa6f1016fa73045d854bea14337eb9a08cdee739666da3f8b2e9f510a173df48f017eb0c7985c256ac2a18ce429636bb79ca993c03800e0d295a80a1c",
"10": "0xe35889f0aa5eb832fc6f992b128ed6203cf46273cb968d6ab2c14acb870f7c775c68b563af3d7b0d5be3fe2aec00aa0b2610390e59ecc55897cb2db914f939ef1b",
"420": "0x910e52eb373a23b9a1cdead2e1741a9b22367708909594ab363eab4fc118165c5f9e4ed44ee65edd40a477d81a4b62959b10611b96ac54ecc3177a8f725bc8091b",
"999": "0x0104248b75845b2f24e7988ace4b7057275a4fbe58781be6080ed59b335c8eb263bac72ecd5d42809641b47c630f42e22f72aa5676337f7959caef122f32f2141b",
"8453": "0x6c1ff489ce4abc4ed4e66368b926ed1414a54b6685e483e90e8495895a525c273e7f10342d02fbad07ed59da35366e610917a120562ab36b3eb2dfacecc484eb1c",
"84531": "0xb489fca7545641f1066e0f04bebe7cf680f7a45c89ab12911cb2ba411e49e26f00a5c799ca5070c2f059ae46371fe612ff4efc3deaf77fe2793a562ed660af0a1c",
"7777777": "0xbfb5d8fad289d2792f2e9f31fb175029ec257e1705bb1c16db805d3ce391466f62f7b3c40941848451c414aecc6197f455496637bb6c895d086fbbf0b6a5a8071c"
}
9 changes: 8 additions & 1 deletion deterministicConfig/upgradeGate/signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"1": "0x2f1655640cec59018cf3df3333698ec56255d79217baaecc3d5111e245487a7d24f92dcb5e92545dedb6618bc44cf920b2af246a8307259fd47ccacf1e89d9ec1c",
"5": "0xcb64e94035539d5864038d4687a835ebb068d5ab620610d36aff5906e274d8eb28d983d663151142f220534afca73035d3f0e30e234da31b4264afb74bff25ed1b",
"10": "0x2c2772daabef01fc8de3e57702e002490783c9262cd3a9e9874e024afc8caf706fc8a733cc6eb92f1381c64fb9b74d986c4315ac6de0512c54d2190dd4e8a1a61c",
"420": "0x7076721a5716503f8875429bd9357beff99f8c44ccc2c6d769b33cbc04ba00bb6a33599d29fe263d759b434f6146086aab5f878ab54d09fd6229b23b619f9deb1c",
"424": "0x10c79903001e2f7530266631e2b695e0cba1e655004dfc7448059fb4b979704b3f835679f1a85787918f48ffad1cfd28544d69d693d3ce2d3b52f19c409a519d1b",
"999": "0x4c82704c3dcb8a7e12489f706f8b776c5d4e6095167dd60c007ad997c56adc1a355c9f1994faa7699643571cf5b10b644192c7a1610dba04555cb092f9af61251c",
"7777777": "0x520fe50fcbd9749ae74af7f75e6eb1b825bc1c17a8f50238e7f92d210cc4620422f2aeddb7ead68bcfffba6b16965003371b275c88a15161aa3e59809d7d3f4b1b"
"8453": "0xddc5f96dc6552a5475f5aab46573701ae51446f6da7168318d26e87d4e434f1c6892b0f640a752bae2717f1688c1e02b0eac28708cfad160eb581e7b8179b7501c",
"58008": "0xd1f1e7dcae636306c3b4d20091b930f67feb0a2f7366d254f919bf262d9a309939648eeb313e35f5b6bff64e3fb13e361d5cbb3cc052c59a911a0b2de1c3f0691b",
"84531": "0x31afd94b98e5e9de1e449bf8872209b17132b54d5dbdcf533aab88164044969759f1aa349b4c0184c194c4ddcf62f9e1c740e17016f9da89b89e83d5135b34641b",
"7777777": "0x520fe50fcbd9749ae74af7f75e6eb1b825bc1c17a8f50238e7f92d210cc4620422f2aeddb7ead68bcfffba6b16965003371b275c88a15161aa3e59809d7d3f4b1b",
"11155111": "0x81240ffa1480e231635c6cd8e9d5af3e7fe4c069022918ba8d431ddcd7d75ea72e3951d7a3c2f73f1c675105091b12d9350c07518207398b7606bf88a9ee03371c"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "forge test",
"test-gas": "forge test --gas-report",
"prettier:check": "prettier --check 'src/**/*.sol' 'test/**/*.sol' 'package/**/*.ts' 'wagmi.config.ts'",
"prettier": "prettier --write 'src/**/*.sol' 'test/**/*.sol' 'package/**/*.ts' 'wagmi.config.ts'",
"prettier": "prettier --write 'src/**/*.sol' 'test/**/*.sol' 'package/**/*.ts' 'script/**/*.ts' 'wagmi.config.ts'",
"coverage": "forge coverage --report lcov",
"write-gas-report": "forge test --gas-report > gasreport.ansi",
"prepack": "yarn wagmi && yarn bundle-configs && yarn build",
Expand Down
2 changes: 1 addition & 1 deletion script/CalculateDeterministicParams.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
/// @dev Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi
/// @author doved
/// @notice Ensure to set env variable for DEPLOYER
contract FactoryProxyDeterministicParams is ZoraDeployerBase, DeterministicDeployerScript {
contract FactoryProxyDeterministicParams is ZoraDeployerBase {
address deployerAddress;
// Set in step 2
address proxyDeployerAddress;
Expand Down
48 changes: 6 additions & 42 deletions script/DeployMintersAndImplementations.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,26 @@ import "forge-std/console2.sol";

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

import {ZoraCreator1155FactoryImpl} from "../src/factory/ZoraCreator1155FactoryImpl.sol";
import {Zora1155Factory} from "../src/proxies/Zora1155Factory.sol";
import {ZoraCreator1155Impl} from "../src/nft/ZoraCreator1155Impl.sol";
import {IZoraCreator1155Factory} from "../src/interfaces/IZoraCreator1155Factory.sol";
import {IZoraCreator1155} from "../src/interfaces/IZoraCreator1155.sol";
import {DeterministicDeployerScript} from "../src/deployment/DeterministicDeployerScript.sol";
import {IMinter1155} from "../src/interfaces/IMinter1155.sol";
import {DeploymentTestingUtils} from "../src/deployment/DeploymentTestingUtils.sol";

contract DeployMintersAndImplementations is ZoraDeployerBase, DeterministicDeployerScript, DeploymentTestingUtils {
contract DeployMintersAndImplementations is ZoraDeployerBase {
function run() public returns (string memory) {
Deployment memory deployment = getDeployment();
ChainConfig memory chainConfig = getChainConfig();

address deployer = vm.envAddress("DEPLOYER");

// Sanity check to make sure that the factory owner is a smart contract.
// This may catch cross-chain data copy mistakes where there is no safe at the desired admin address.
if (address(chainConfig.factoryOwner).code.length == 0) {
revert("FactoryOwner should be a contract. See DeployNewProxies:31.");
}

uint256 chain = chainId();

vm.startBroadcast(deployer);

(address fixedPriceMinter, address merkleMinter, address redeemMinterFactory) = ZoraDeployerUtils.deployMinters();
deployUpgradeGateDeterminstic(deployment);

console.log("deploy upgrade gate");
deployMinters(deployment);

address upgradeGateAddress = deployUpgradeGate({chain: chainId(), upgradeGateOwner: chainConfig.factoryOwner});
deployNew1155AndFactoryImpl(deployment);

console.log("impl contracts");

(address factoryImplAddress, address contract1155ImplAddress) = ZoraDeployerUtils.deployNew1155AndFactoryImpl(
upgradeGateAddress,
chainConfig.mintFeeRecipient,
chainConfig.protocolRewards,
IMinter1155(merkleMinter),
IMinter1155(redeemMinterFactory),
IMinter1155(fixedPriceMinter)
);

deployment.fixedPriceSaleStrategy = address(fixedPriceMinter);
deployment.merkleMintSaleStrategy = address(merkleMinter);
deployment.redeemMinterFactory = address(redeemMinterFactory);
deployment.upgradeGate = upgradeGateAddress;
deployment.factoryImpl = factoryImplAddress;
deployment.contract1155Impl = contract1155ImplAddress;
deployNewPreminterImplementationDeterminstic(deployment);

vm.stopBroadcast();

// now test signing and executing premint

return getDeploymentJSON(deployment);
}
}
Loading

0 comments on commit 9207e8f

Please sign in to comment.