From 0bb4fdde755f96ed8964b523471ee17ebb11d21c Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Thu, 28 Sep 2023 15:14:47 -0400 Subject: [PATCH] Premint proxy deploy (#211) * made premint executor ugparde scripts. renamed executor to proxy * deploy preminter impl with script, and updated the config for that chain * Have premint proxy deploy scripts. can deploy both now * preminter proxy pushed --- addresses/999.json | 13 +- determinsticConfig/factoryProxy/params.json | 14 +- .../factoryProxy/signatures.json | 22 +-- .../premintExecutorProxy/params.json | 10 ++ .../premintExecutorProxy/signatures.json | 3 + package/deployment.ts | 12 +- script/DeployNewImplementation.s.sol | 1 + .../DeployNewPreminterAndFactoryProxy.s.sol | 27 --- ...toryProxy.s.sol => DeployNewProxies.s.sol} | 37 ++-- script/FactoryProxyDeterminsticParams.sol | 31 ++++ script/GenerateDeterminsticParams.s.sol | 58 ------- script/PremintProxyDeterminsticParams.sol | 31 ++++ script/UpgradePreminter.s.sol | 2 +- script/ZoraDeployerBase.sol | 11 +- script/copy-deployed-contracts.mjs | 2 +- script/signDeploymentTransactions.ts | 162 ++++++++++++------ ...=> ZoraCreator1155PremintExecutorImpl.sol} | 2 +- src/deployment/DeploymentConfig.sol | 12 +- src/deployment/DeterminsticDeployerScript.sol | 105 ++++++++---- src/deployment/ZoraDeployerUtils.sol | 20 +-- ...rProxy.sol => Zora1155PremintExecutor.sol} | 2 +- .../Zora1155PremintExecutorProxy.t.sol | 18 +- .../ZoraCreator1155PremintExecutor.t.sol | 10 +- 23 files changed, 339 insertions(+), 266 deletions(-) create mode 100644 determinsticConfig/premintExecutorProxy/params.json create mode 100644 determinsticConfig/premintExecutorProxy/signatures.json delete mode 100644 script/DeployNewPreminterAndFactoryProxy.s.sol rename script/{DeployNewFactoryProxy.s.sol => DeployNewProxies.s.sol} (51%) create mode 100644 script/FactoryProxyDeterminsticParams.sol delete mode 100644 script/GenerateDeterminsticParams.s.sol create mode 100644 script/PremintProxyDeterminsticParams.sol rename src/delegation/{ZoraCreator1155PremintExecutor.sol => ZoraCreator1155PremintExecutorImpl.sol} (98%) rename src/proxies/{Zora1155PremintExecutorProxy.sol => Zora1155PremintExecutor.sol} (96%) diff --git a/addresses/999.json b/addresses/999.json index edbaad799..7b3772244 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,12 +1,13 @@ { - "CONTRACT_1155_IMPL": "0x9dF99FB8166a51f61C134a1E7Dd114d8A4dc0Ec3", + "CONTRACT_1155_IMPL": "0x1842522fEabF9143758EbEEB85A4B417b5b15A0f", "CONTRACT_1155_IMPL_VERSION": "1.4.0", - "FACTORY_IMPL": "0xf76aFcB896AA18864D7EC4dfe0445E385688843A", - "FACTORY_PROXY": "0x7777777f9F0980A03C5a14dc81A17D0391b5b7D5", + "FACTORY_IMPL": "0x39252E0b2Fd78687b3b9aD2103D38d6C18aD1522", + "FACTORY_PROXY": "0x777777267FA8D1C26EF7A2dffb33A290464D1b4B", "FIXED_PRICE_SALE_STRATEGY": "0xd81351363b7d80b06E4Ec4De7989f0f91e41A846", "MERKLE_MINT_SALE_STRATEGY": "0x2c4457D38A329526063b26a2bB2C31B61553Aa98", - "PREMINTER": "0xcb81DbF6DB4526fe2Cdf59Bd8a2Ef627899B9Ef2", + "PREMINTER_IMPL": "0x852AdbCA541AC8b422e9d73a11e774d22577266a", + "PREMINTER_PROXY": "0x7777770cbcc9df2d3f3aeb158fd2106e20c598ba", "REDEEM_MINTER_FACTORY": "0x27817bAef1341De9Ad04097Bbba4Ea8dA32c8552", - "timestamp": 1694716506, - "commit": "b197446" + "timestamp": 1695924035, + "commit": "b5b1a73" } \ No newline at end of file diff --git a/determinsticConfig/factoryProxy/params.json b/determinsticConfig/factoryProxy/params.json index 0029a1d4e..02d66f9cc 100644 --- a/determinsticConfig/factoryProxy/params.json +++ b/determinsticConfig/factoryProxy/params.json @@ -1,10 +1,10 @@ { "deployerAddress": "0x4F9991C82C76aE04CC39f23aB909AA919886ba12", - "determinsticProxyAddress": "0x777777267FA8D1C26EF7A2dffb33A290464D1b4B", - "proxyCreationCode": "0x6040608081523461021857610417908138038061001b8161021d565b93843982019181818403126102185780516001600160a01b038116808203610218576020838101516001600160401b0394919391858211610218570186601f820112156102185780519061007661007183610258565b61021d565b91808352858301988682840101116102185788866100949301610273565b813b156101be577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916841790556000927fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8480a28051158015906101b7575b610110575b855160cd908161034a8239f35b85519460608601908111868210176101a35786978492839261018d9952602788527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c87890152660819985a5b195960ca1b8a8901525190845af4913d15610199573d9061017f61007183610258565b91825281943d92013e610296565b50803880808080610103565b5060609250610296565b634e487b7160e01b84526041600452602484fd5b50826100fe565b855162461bcd60e51b815260048101859052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761024257604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161024257601f01601f191660200190565b60005b8381106102865750506000910152565b8181015183820152602001610276565b919290156102f857508151156102aa575090565b3b156102b35790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561030b5750805190602001fd5b6044604051809262461bcd60e51b82526020600483015261033b8151809281602486015260208686019101610273565b601f01601f19168101030190fdfe608060405236156052576001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54166000808092368280378136915af43d82803e15604e573d90f35b3d90fd5b6001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54166000808092368280378136915af43d82803e15604e573d90f3fea2646970667358221220fabc47988f87d92bf7687b61efd41cad0f9fef0865339f213fdb35e6520b4b4a64736f6c63430008110033", - "proxyDeployerAddress": "0x4401a07B39D3Cb005d1ed8a4c29D6c6c4a49E7d7", - "proxyDeployerCreationCode": "0x61016080604052346200016057620000178162000165565b60178152602081017f4e6577466163746f727950726f78794465706c6f796572000000000000000000815260405191620000518362000165565b6001835260208301603160f81b81526200006b8262000181565b926101209384526200007d8562000354565b92610140938452519020938460e05251902091610100938385524660a0526040519360208501917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604086015260608501524660808501523060a085015260a0845260c084019380851060018060401b038611176200014a57846040525190206080523060c0526114c1938462000502853960805184610c0b015260a05184610cd7015260c05184610bdc015260e05184610c5a01525183610c8001525182606101525181608b0152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b604081019081106001600160401b038211176200014a57604052565b8051602091908281101562000220575090601f825111620001bf5780825192015190808310620001b057501790565b82600019910360031b1b161790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b82851062000206575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620001e2565b6001600160401b0381116200014a576000928354926001938481811c9116801562000349575b838210146200033557601f8111620002ff575b5081601f841160011462000298575092829391839286946200028c575b50501b916000199060031b1c191617905560ff90565b01519250388062000276565b919083601f1981168780528488209488905b88838310620002e45750505010620002ca575b505050811b01905560ff90565b015160001960f88460031b161c19169055388080620002bd565b858701518855909601959485019487935090810190620002aa565b85805284601f848820920160051c820191601f860160051c015b8281106200032957505062000259565b87815501859062000319565b634e487b7160e01b86526022600452602486fd5b90607f169062000246565b805160209081811015620003e25750601f825111620003815780825192015190808310620001b057501790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b828510620003c8575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620003a4565b9192916001600160401b0381116200014a5760019182548381811c91168015620004f6575b82821014620004e057601f8111620004a7575b5080601f83116001146200045a5750819293946000926200044e575b5050600019600383901b1c191690821b17905560ff90565b01519050388062000436565b90601f198316958460005282600020926000905b8882106200048f5750508385969710620002ca57505050811b01905560ff90565b8087859682949686015181550195019301906200046e565b8360005283601f83600020920160051c820191601f850160051c015b828110620004d35750506200041a565b60008155018490620004c3565b634e487b7160e01b600052602260045260246000fd5b90607f16906200040756fe60406080815260048036101561001457600080fd5b600091823560e01c806315d06c3114610548578063409bdf89146104eb578063825748bc1461016d576384b0196e1461004c57600080fd5b346101695782600319360112610169576100857f0000000000000000000000000000000000000000000000000000000000000000610701565b926100af7f0000000000000000000000000000000000000000000000000000000000000000610827565b908251926020928385019585871067ffffffffffffffff8811176101545750928061010a8388966100fd998b9996528686528151998a99600f60f81b8b5260e0868c015260e08b0190610674565b91898303908a0152610674565b924660608801523060808801528460a088015286840360c088015251928381520193925b82811061013d57505050500390f35b83518552869550938101939281019260010161012e565b604190634e487b7160e01b6000525260246000fd5b8280fd5b50346101695760e03660031901126101695781359267ffffffffffffffff92604435848111610169576101a390369083016105f2565b9190946101ae610625565b956101b761063b565b9060a435926001600160a01b0391828516968786036104e75760c4358381116104e3578c859136908a01906101eb916105f2565b916024998986888d356101fd95610b22565b913690610209926108fa565b61021291610a5b565b61021b90610941565b168c60601c1480156104cc575b156104565789519b8c61078e8082019182108683111761044457908e91610cfe833930815260209e8f910301908bf590811561043a57908c91858c51938401921682528b808401528a60608401526060835260808301948386109086111761042857918a8e926102b56102c1958f8990528060a0860198893784019160a083019384528451938491610651565b010380855201836106df565b8151156103e857908291853591519089f5169788156103a657811680890361038b5750873b15610387578651631b2ce7f360e11b815291168382015284818381838b5af1801561037d5761036a575b50853b1561036657908391855193849263189acdbd60e31b84528301528183885af1801561035c57610345575b505051908152f35b61034f8291610699565b610359578061033d565b80fd5b83513d84823e3d90fd5b8380fd5b61037690949194610699565b9238610310565b86513d87823e3d90fd5b8580fd5b8489856044938b51936312ae30e560e01b8552840152820152fd5b875162461bcd60e51b81528086018b90526019818601527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606490fd5b6064868c87818d519362461bcd60e51b85528401528201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b634e487b7160e01b8b5260418952878bfd5b8a513d8b823e3d90fd5b634e487b7160e01b8c5260418a52888cfd5b895162461bcd60e51b81526020818901526045818801527f496e76616c69642073616c74202d206669727374203230206279746573206f6660448201527f207468652073616c74206d757374206d617463682063616c6c696e67206164646064820152643932b9b99760d91b608482015260a490fd5b506bffffffffffffffffffffffff198c1615610228565b8980fd5b8880fd5b5082346103595760a0366003190112610359576044359067ffffffffffffffff8211610359575060209261052561054192369083016105f2565b61052d610625565b9161053661063b565b936024359035610b22565b9051908152f35b509190346105ee5760c03660031901126105ee5767ffffffffffffffff916044358381116105ee5761057d90369084016105f2565b610588949194610625565b9161059161063b565b9360a4359182116103595760206105e76001600160a01b038a6105df8b6105d98c6105d18d8d8d6105c4368f87016105f2565b9790956024359035610b22565b9236916108fa565b90610a5b565b939093610941565b5191168152f35b5080fd5b9181601f840112156106205782359167ffffffffffffffff8311610620576020838186019501011161062057565b600080fd5b606435906001600160a01b038216820361062057565b608435906001600160a01b038216820361062057565b60005b8381106106645750506000910152565b8181015183820152602001610654565b9060209161068d81518092818552858086019101610651565b601f01601f1916010190565b67ffffffffffffffff81116106ad57604052565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176106ad57604052565b90601f8019910116810190811067ffffffffffffffff8211176106ad57604052565b60ff811461073f5760ff811690601f821161072d5760405191610723836106c3565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b506040516000805490600182811c9080841693841561081d575b602094858410811461080957838752869493929181156107e9575060011461078d575b505061078a925003826106df565b90565b60008080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b8183106107d157505061078a9350820101388061077c565b855487840185015294850194869450918301916107b9565b91505061078a94925060ff191682840152151560051b820101388061077c565b634e487b7160e01b85526022600452602485fd5b91607f1691610759565b60ff81146108495760ff811690601f821161072d5760405191610723836106c3565b50604051600060019081549182811c908084169384156108f0575b602094858410811461080957838752869493929181156107e9575060011461089457505061078a925003826106df565b60008181527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf695935091905b8183106108d857505061078a9350820101388061077c565b855487840185015294850194869450918301916108c0565b91607f1691610864565b92919267ffffffffffffffff82116106ad5760405191610924601f8201601f1916602001846106df565b829481845281830111610620578281602093846000960137010152565b6005811015610a4557806109525750565b6001810361099f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109ec5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146109f557565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b906041815114600014610a8957610a85916020820151906060604084015193015160001a90610a93565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610b165791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15610b095781516001600160a01b03811615610b03579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b939291610b3291959236916108fa565b602081519101206040519460208601947f4f2bfcc23c1adbe54973f469f111f1848a62d32cc4a906c7a5ced17481b366ea86526040870152606086015260808501526001600160a01b0380921660a08501521660c083015260c0825260e082019180831067ffffffffffffffff8411176106ad57604292604052519020610bb7610bd2565b906040519161190160f01b8352600283015260228201522090565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480610cd4575b15610c2d577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176106ad5760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614610c0456fe60c03461008b57601f61078e38819003918201601f19168301916001600160401b038311848410176100905780849260209460405283398101031261008b57516001600160a01b038116810361008b573060805260a0526040516106e790816100a7823960805181818160600152818161013b01526103b9015260a05181818161019101526104100152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600090813560e01c9081633659cfe61461038e575080634f1ef286146100bf576352d1902d1461004557600080fd5b346100bc57806003193601126100bc57506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036100af57602090517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b51635e4c25f160e01b8152fd5b80fd5b50908060031936011261038a576100d46105bd565b9060243567ffffffffffffffff8111610386573660238201121561038657808501359061010082610610565b61010c845191826105d8565b8281526020928382019236602483830101116103275781889260248793018637830101526001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690813014610376577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc91818354160361036657807f0000000000000000000000000000000000000000000000000000000000000000163303610332577f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156101f5575050505050506101f291925061062c565b80f35b86979597169087516352d1902d60e01b815285818b81865afa8791816102ff575b5061022b57885163e5ec176960e01b81528a90fd5b989293949698979597036102f0576102428861062c565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28251158015906102e8575b610284575b505050505050905080f35b873b156102dc57505093809581926102c59651915af4903d156102d2573d6102b76102ae82610610565b925192836105d8565b81528481933d92013e610688565b5080388080808080610279565b5060609150610688565b63369891e760e01b8152fd5b506001610274565b5083516308373ebf60e41b8152fd5b9091508681813d831161032b575b61031781836105d8565b8101031261032757519038610216565b8780fd5b503d61030d565b855162461bcd60e51b8152808a01869052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b85516364cd8d1960e01b81528990fd5b8551631932df4560e01b81528990fd5b8380fd5b5080fd5b91929050346105b957602080600319360112610386576103ac6105bd565b926001600160a01b0390817f000000000000000000000000000000000000000000000000000000000000000016908130146105ab57507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90828254160361059b57817f0000000000000000000000000000000000000000000000000000000000000000163303610567578351908382019282841067ffffffffffffffff851117610554578386528783527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610491575050505050506101f291925061062c565b86979597169087516352d1902d60e01b815285818b81865afa879181610525575b506104c757885163e5ec176960e01b81528a90fd5b989293949698979597036102f0576104de8861062c565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a282511580159061051e5761028457505050505050905080f35b5086610274565b9091508681813d831161054d575b61053d81836105d8565b81010312610327575190386104b2565b503d610533565b634e487b7160e01b885260418952602488fd5b835162461bcd60e51b8152808801849052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b83516364cd8d1960e01b81528790fd5b631932df4560e01b81528790fd5b8280fd5b600435906001600160a01b03821682036105d357565b600080fd5b90601f8019910116810190811067ffffffffffffffff8211176105fa57604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116105fa57601f01601f191660200190565b803b15610676576001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc91166bffffffffffffffffffffffff60a01b825416179055565b60405163529880eb60e01b8152600490fd5b156106905790565b80511561069f57805190602001fd5b6040516350a28c9b60e11b8152600490fdfea26469706673582212206e5a847df6605313f451f00c65306edd62b7a5cdfdf9df237cdd35310e8c28a864736f6c63430008110033a2646970667358221220266e7a426ebc3ef85ebcbff6f5f5474e03b3b89dc2c34ec3b4c356e19247216764736f6c63430008110033", - "proxyDeployerSalt": "0x0000000000000000000000000000000000000000668d7f9eb18e35000dbaba0e", - "proxySalt": "0x477d60ed8fe427f49faf9f6d5139e9adf99c82c79ba5d1debae766b85ca7abba", - "proxyShimSalt": "0x4f9991c82c76ae04cc39f23ab909aa919886ba12000000000000000000000000" + "determinsticProxyAddress": "0x777777e60DABa3C941a1BA2f82b5B2dEEBD00f8A", + "proxyCreationCode": "0x604060808152346102185761041b908138038061001b8161021d565b93843982019181818403126102185780516001600160a01b038116808203610218576020838101516001600160401b0394919391858211610218570186601f820112156102185780519061007661007183610258565b61021d565b91808352858301988682840101116102185788866100949301610273565b813b156101be577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916841790556000927fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8480a28051158015906101b7575b610110575b855160d1908161034a8239f35b85519460608601908111868210176101a35786978492839261018d9952602788527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c87890152660819985a5b195960ca1b8a8901525190845af4913d15610199573d9061017f61007183610258565b91825281943d92013e610296565b50803880808080610103565b5060609250610296565b634e487b7160e01b84526041600452602484fd5b50826100fe565b855162461bcd60e51b815260048101859052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761024257604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161024257601f01601f191660200190565b60005b8381106102865750506000910152565b8181015183820152602001610276565b919290156102f857508151156102aa575090565b3b156102b35790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561030b5750805190602001fd5b6044604051809262461bcd60e51b82526020600483015261033b8151809281602486015260208686019101610273565b601f01601f19168101030190fdfe608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea26469706673582212206025166eeb4ada632b54cc380a4ace3ecc81b0f2ed030f2e6feb8f47e8aa935264736f6c63430008110033", + "proxyDeployerAddress": "0x6d694a5394BFe227CA2321669BA43221e9Fc971D", + "proxyDeployerCreationCode": "0x61016080604052346200016057620000178162000165565b60178152602081017f4e6577466163746f727950726f78794465706c6f796572000000000000000000815260405191620000518362000165565b6001835260208301603160f81b81526200006b8262000181565b926101209384526200007d8562000354565b92610140938452519020938460e05251902091610100938385524660a0526040519360208501917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604086015260608501524660808501523060a085015260a0845260c084019380851060018060401b038611176200014a57846040525190206080523060c05261143f938462000502853960805184610bb5015260a05184610c80015260c05184610b7f015260e05184610c0401525183610c2a01525182606101525181608b0152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b604081019081106001600160401b038211176200014a57604052565b8051602091908281101562000220575090601f825111620001bf5780825192015190808310620001b057501790565b82600019910360031b1b161790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b82851062000206575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620001e2565b6001600160401b0381116200014a576000928354926001938481811c9116801562000349575b838210146200033557601f8111620002ff575b5081601f841160011462000298575092829391839286946200028c575b50501b916000199060031b1c191617905560ff90565b01519250388062000276565b919083601f1981168780528488209488905b88838310620002e45750505010620002ca575b505050811b01905560ff90565b015160001960f88460031b161c19169055388080620002bd565b858701518855909601959485019487935090810190620002aa565b85805284601f848820920160051c820191601f860160051c015b8281106200032957505062000259565b87815501859062000319565b634e487b7160e01b86526022600452602486fd5b90607f169062000246565b805160209081811015620003e25750601f825111620003815780825192015190808310620001b057501790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b828510620003c8575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620003a4565b9192916001600160401b0381116200014a5760019182548381811c91168015620004f6575b82821014620004e057601f8111620004a7575b5080601f83116001146200045a5750819293946000926200044e575b5050600019600383901b1c191690821b17905560ff90565b01519050388062000436565b90601f198316958460005282600020926000905b8882106200048f5750508385969710620002ca57505050811b01905560ff90565b8087859682949686015181550195019301906200046e565b8360005283601f83600020920160051c820191601f850160051c015b828110620004d35750506200041a565b60008155018490620004c3565b634e487b7160e01b600052602260045260246000fd5b90607f16906200040756fe60406080815260048036101561001457600080fd5b600091823560e01c806315d06c3114610544578063409bdf89146104e8578063825748bc1461016c576384b0196e1461004c57600080fd5b346101685782600319360112610168576100857f00000000000000000000000000000000000000000000000000000000000000006106f9565b926100af7f0000000000000000000000000000000000000000000000000000000000000000610801565b90825192602092838501958587106001600160401b03881117610153575092806101098388966100fc998b9996528686528151998a99600f60f81b8b5260e0868c015260e08b019061066f565b91898303908a015261066f565b924660608801523060808801528460a088015286840360c088015251928381520193925b82811061013c57505050500390f35b83518552869550938101939281019260010161012d565b604190634e487b7160e01b6000525260246000fd5b8280fd5b50346101685760e0366003190112610168578135926001600160401b0392604435848111610168576101a190369083016105ee565b9190946101ac610620565b956101b5610636565b9060a4359260018060a01b0391828516968786036104e45760c4358381116104e0578c859136908a01906101e8916105ee565b916024998986888d356101fa95610ace565b913690610206926108b6565b61020f91610a11565b610218906108fc565b168c60601c1480156104c9575b156104535789519b8c6107638082019182108683111761044157908e91610ca7833930815260209e8f910301908bf590811561043757908c91858c51938401921682528b808401528a60608401526060835260808301948386109086111761042557918a8e926102b26102be958f8990528060a0860198893784019160a08301938452845193849161064c565b010380855201836106d8565b8151156103e557908291853591519089f5169788156103a35781168089036103885750873b15610384578651631b2ce7f360e11b815291168382015284818381838b5af1801561037a57610367575b50853b1561036357908391855193849263189acdbd60e31b84528301528183885af1801561035957610342575b505051908152f35b61034c8291610694565b610356578061033a565b80fd5b83513d84823e3d90fd5b8380fd5b61037390949194610694565b923861030d565b86513d87823e3d90fd5b8580fd5b8489856044938b51936312ae30e560e01b8552840152820152fd5b875162461bcd60e51b81528086018b90526019818601527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606490fd5b6064868c87818d519362461bcd60e51b85528401528201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b634e487b7160e01b8b5260418952878bfd5b8a513d8b823e3d90fd5b634e487b7160e01b8c5260418a52888cfd5b895162461bcd60e51b81526020818901526045818801527f496e76616c69642073616c74202d206669727374203230206279746573206f6660448201527f207468652073616c74206d757374206d617463682063616c6c696e67206164646064820152643932b9b99760d91b608482015260a490fd5b506bffffffffffffffffffffffff198c1615610225565b8980fd5b8880fd5b5082346103565760a036600319011261035657604435906001600160401b038211610356575060209261052161053d92369083016105ee565b610529610620565b91610532610636565b936024359035610ace565b9051908152f35b509190346105ea5760c03660031901126105ea576001600160401b03916044358381116105ea5761057890369084016105ee565b610583949194610620565b9161058c610636565b9360a4359182116103565760206105da896105d28a6105cc8b6105c48c8c8c6105b7368e87016105ee565b9790956024359035610ace565b9236916108b6565b90610a11565b9290926108fc565b516001600160a01b039091168152f35b5080fd5b9181601f8401121561061b578235916001600160401b03831161061b576020838186019501011161061b57565b600080fd5b606435906001600160a01b038216820361061b57565b608435906001600160a01b038216820361061b57565b60005b83811061065f5750506000910152565b818101518382015260200161064f565b906020916106888151809281855285808601910161064c565b601f01601f1916010190565b6001600160401b0381116106a757604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176106a757604052565b90601f801991011681019081106001600160401b038211176106a757604052565b60ff81146107375760ff811690601f8211610725576040519161071b836106bd565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b506040516000805490600182811c908084169384156107f7575b60209485841081146107e357838752869493929181156107c35750600114610785575b5050610782925003826106d8565b90565b600080805285812095935091905b8183106107ab57505061078293508201013880610774565b85548784018501529485019486945091830191610793565b91505061078294925060ff191682840152151560051b8201013880610774565b634e487b7160e01b85526022600452602485fd5b91607f1691610751565b60ff81146108235760ff811690601f8211610725576040519161071b836106bd565b50604051600060019081549182811c908084169384156108ac575b60209485841081146107e357838752869493929181156107c3575060011461086e575050610782925003826106d8565b600081815285812095935091905b81831061089457505061078293508201013880610774565b8554878401850152948501948694509183019161087c565b91607f169161083e565b9291926001600160401b0382116106a757604051916108df601f8201601f1916602001846106d8565b82948184528183011161061b578281602093846000960137010152565b60058110156109fb578061090d5750565b600181036109555760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b600281036109a25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146109ab57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b906041815114600014610a3f57610a3b916020820151906060604084015193015160001a90610a49565b9091565b5050600090600290565b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311610ac25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15610ab55781516001600160a01b03811615610aaf579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b939291610ade91959236916108b6565b602081519101206040519460208601947f4f2bfcc23c1adbe54973f469f111f1848a62d32cc4a906c7a5ced17481b366ea865260408701526060860152608085015260018060a01b0380921660a08501521660c083015260c0825260e08201918083106001600160401b038411176106a757604292604052519020610b61610b7c565b906040519161190160f01b8352600283015260228201522090565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480610c7d575b15610bd7577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c081018181106001600160401b038211176106a75760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614610bae56fe60c03461008b57601f61076338819003918201601f19168301916001600160401b038311848410176100905780849260209460405283398101031261008b57516001600160a01b038116810361008b573060805260a0526040516106bc90816100a782396080518181816058015281816101280152610394015260a05181818161016d01526103da0152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600090813560e01c9081633659cfe61461036a575080634f1ef286146100ad576352d1902d1461004557600080fd5b346100aa57806003193601126100aa57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361009d57602090516000805160206106678339815191528152f35b51635e4c25f160e01b8152fd5b80fd5b509080600319360112610366576100c2610587565b9060243567ffffffffffffffff811161036257366023820112156103625780850135906100ee826105da565b6100fa845191826105a2565b8281526020928382019236602483830101116103035781889260248793018637830101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116903082146103525760008051602061066783398151915291818354160361034257807f000000000000000000000000000000000000000000000000000000000000000016330361030e577f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156101d1575050505050506101ce9192506105f6565b80f35b86979597169087516352d1902d60e01b815285818b81865afa8791816102db575b5061020757885163e5ec176960e01b81528a90fd5b989293949698979597036102cc5761021e886105f6565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28251158015906102c4575b610260575b505050505050905080f35b873b156102b857505093809581926102a19651915af4903d156102ae573d61029361028a826105da565b925192836105a2565b81528481933d92013e61063d565b5080388080808080610255565b506060915061063d565b63369891e760e01b8152fd5b506001610250565b5083516308373ebf60e41b8152fd5b9091508681813d8311610307575b6102f381836105a2565b81010312610303575190386101f2565b8780fd5b503d6102e9565b855162461bcd60e51b8152808a01869052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b85516364cd8d1960e01b81528990fd5b8551631932df4560e01b81528990fd5b8380fd5b5080fd5b91929050346105835760208060031936011261036257610388610587565b926001600160a01b03907f0000000000000000000000000000000000000000000000000000000000000000821690308214610575575060008051602061066783398151915290828254160361056557817f0000000000000000000000000000000000000000000000000000000000000000163303610531578351908382019282841067ffffffffffffffff85111761051e578386528783527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561045b575050505050506101ce9192506105f6565b86979597169087516352d1902d60e01b815285818b81865afa8791816104ef575b5061049157885163e5ec176960e01b81528a90fd5b989293949698979597036102cc576104a8886105f6565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28251158015906104e85761026057505050505050905080f35b5086610250565b9091508681813d8311610517575b61050781836105a2565b810103126103035751903861047c565b503d6104fd565b634e487b7160e01b885260418952602488fd5b835162461bcd60e51b8152808801849052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b83516364cd8d1960e01b81528790fd5b631932df4560e01b81528790fd5b8280fd5b600435906001600160a01b038216820361059d57565b600080fd5b90601f8019910116810190811067ffffffffffffffff8211176105c457604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116105c457601f01601f191660200190565b803b1561062b5760008051602061066783398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405163529880eb60e01b8152600490fd5b156106455790565b80511561065457805190602001fd5b6040516350a28c9b60e11b8152600490fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122045956a6c2f86f27f4001483acf6a61195441ac40433c504ce3ac6d6bef8b1b1864736f6c63430008110033a2646970667358221220dabba1dcd032491f8a97dc59455163d769d7f2c0092154bc5aa3845d80c470a464736f6c63430008110033", + "proxyDeployerSalt": "0x0000000000000000000000000000000000000000668d7f9ec18e35000dbaba0e", + "proxySalt": "0x57438c1eada39e73013d03d72fcafc19fc93a4cced6f6a87f8035e46c80079e2", + "proxyShimSalt": "0x4f9991c82c76ae04cc39f23ab909aa919886ba12000000000000000000000064" } \ No newline at end of file diff --git a/determinsticConfig/factoryProxy/signatures.json b/determinsticConfig/factoryProxy/signatures.json index 680ad8070..641abfca1 100644 --- a/determinsticConfig/factoryProxy/signatures.json +++ b/determinsticConfig/factoryProxy/signatures.json @@ -1,13 +1,13 @@ { - "1": "0x4375b61fd6efbb0c282c4c07a6126d1c171e00bae25125ade106155b1783b1d239528bd76135b9a46753680d66ebf0e4b1b4aa9252694acc861c0eb4431919a11b", - "5": "0x9a67bf6b50b88c5258aad7fd4153b71d15ad058b234fdc614bdeb3a2b8c2c0de43fec9852d167662faf86baac15f206bb3ee09a091e7cb4496b99e89b7c109061b", - "10": "0xabce4450e7b87a7463c4f58e46701d2fdb521a9a32baebeff825440cced30232473ad12d5fed7398d85b306321d2c980c38775e04725ea21d33a50ddb2c0bb451c", - "420": "0xd7131abce6e7f0de146215a724db8b7ac6ee0f9fdd5a5925c2db3bd0d7a1838b777d27632867a859990402234f26f07d1b07ed9d946b0109f5d5abf677973e381c", - "424": "0x3b982d38eab8b720ff5a9dd60f1951ef8be65a93a7df9c724a65b6540e2824bb46ce641a52f777b685f245f437c8f5a53341052038fc08b94e007a277e4cc0af1b", - "999": "0x9288092853879cb0442e97c4fe4327e86481ae046211ddc1573ff47ed72e0a211ffef04947ceee51e58662531814cef92214e3a7116cdd9f15e6a812364382181b", - "8453": "0x2e0eba56662a1143349b60d1e7be321b0b095853af329449e1f4973b637a298b3ce70f03c80195b3a9dec740e5a46961f98aeb0cbde860ab1b140eaeabbeb8591c", - "58008": "0x1ff3a0a7d1cf68093dd6eaffcaa89f03870d791a69dbcb10799fe45673452a98206589bcfcaf289db3f0e2f2b107f4d5275b8bbe2096c25ed9e09e28f992cd9a1b", - "84531": "0xf44ffda048e8dbe8f8f3555bd711754cc3eaabd6c046b3a4ae062f849a123b156bf60bd23c6ff3b35b255d836d4d4ad4abc71f8788384a5f7c8f7592a35bde5f1b", - "7777777": "0xa2cf3759a9834cad456f1655e55487f77cd9ebf98bfe1efce47dc28861f705661954f7761d5165cf784c90aec6406574c6e7de3d5335bd40c363aedfc111aa8b1b", - "11155111": "0x715be9fdf91d580e9e6591f9ce5b06ab3212c0d789542fa75283dd93aa92c9fb280cf164226daea382261c10a000f1a2ae5bb3147626920befb354b18f4cc9b91c" + "1": "0x2933443bc97517731893d612ce5d51bc980b9185efce2826e58721fa59ad517123e72be886717639b75eb30380f8b0feee3b36c94c4bb31b2e99ad3b1f0e1bd81c", + "5": "0xaef23e2b095dcdd758e3c57f75e3b96245ec5f4339175946aa2abd829f8f389935e365987c1dfe3ef3fbf12ff30810351cbc3af6e7f225abfee9d8d11d15abb51b", + "10": "0x7bceed3c7695faaed17d15c52f9153b5faa94b8144d8517437d334578a41f98269d78cfefe0b4869c3c5098cc495f9ea4e8b8f4a530e6d8f28c7bf35c52ea7971b", + "420": "0x303b4c1d43bdaf0985e82f97e31ed69af5b00f979d6b2d9bbf4ad41f16ba525e319198f63ebc6aeff44f70bc12b04578d12fd39e2b830e47d6477f9b5eae9d8d1b", + "424": "0x1cf2cfb0a1bbfee57ad8e72e5e6c81262c6892e3726350bcf069d035c74e70f57dcbe7dfba5ab64c7e440fb5faacd31a798e453094c3de34a6ebb26db644acce1b", + "999": "0x16546150074572fa72cf1e66b635b196c02e4cc95f0d465dbfe5cf09a452fe6b4b748990ed760be3b1620b6df53787baac3bc3f1755ebcc228690ff5b7744de81c", + "8453": "0xda5c219fab6e1be7ad156d002cca90af281dd17a003a9719c76e99ac34568bb62b726d72d025b852dddaae26d26dc1a2508b24a803e7338615df532b49b8d0ed1c", + "58008": "0x00bbddd17272d09cdc81521daa09101777017ed1662077a46215b4bc9136622c1574d5768b95310d7fe5fff9d1803653dbb70dba5fdcf1a442af9893431f64dc1b", + "84531": "0x2bd795e9c7dc06c52d52626d5ce93b8ab5dab38c64dd2527d3d07be053c5d2f679648c00c302bc684abbae1b517eaf4435edf1873d74ecbd12d2c160fa8001ec1c", + "7777777": "0x0d33c46e997d3487f08bc153c5d6dac7dbff21057bd2d6ec857e7140f51879ce73e2fb23ae705c2d1bd1316caaaf5f8258ad404a595cafd3a28a622d0dba18b51b", + "11155111": "0x3e09018c6aa6ef37fdade862ef28d9799debd800552a80a0748adaa967d20a095463dbdcaeecf61a6fd9aa2514b24d01947bbb05c8ca7a5383e00da47d52fd941c" } \ No newline at end of file diff --git a/determinsticConfig/premintExecutorProxy/params.json b/determinsticConfig/premintExecutorProxy/params.json new file mode 100644 index 000000000..6bcfddab7 --- /dev/null +++ b/determinsticConfig/premintExecutorProxy/params.json @@ -0,0 +1,10 @@ +{ + "deployerAddress": "0x4F9991C82C76aE04CC39f23aB909AA919886ba12", + "determinsticProxyAddress": "0x7777770cbCc9Df2D3f3AEB158fd2106e20c598bA", + "proxyCreationCode": "0x604060808152346102185761041b908138038061001b8161021d565b93843982019181818403126102185780516001600160a01b038116808203610218576020838101516001600160401b0394919391858211610218570186601f820112156102185780519061007661007183610258565b61021d565b91808352858301988682840101116102185788866100949301610273565b813b156101be577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916841790556000927fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8480a28051158015906101b7575b610110575b855160d1908161034a8239f35b85519460608601908111868210176101a35786978492839261018d9952602788527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c87890152660819985a5b195960ca1b8a8901525190845af4913d15610199573d9061017f61007183610258565b91825281943d92013e610296565b50803880808080610103565b5060609250610296565b634e487b7160e01b84526041600452602484fd5b50826100fe565b855162461bcd60e51b815260048101859052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761024257604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161024257601f01601f191660200190565b60005b8381106102865750506000910152565b8181015183820152602001610276565b919290156102f857508151156102aa575090565b3b156102b35790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561030b5750805190602001fd5b6044604051809262461bcd60e51b82526020600483015261033b8151809281602486015260208686019101610273565b601f01601f19168101030190fdfe608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea26469706673582212206c4dcbca55999ff942c0fb847439fecf042b44555b3c49500e153a99fd59cb8964736f6c63430008110033", + "proxyDeployerAddress": "0x6d694a5394BFe227CA2321669BA43221e9Fc971D", + "proxyDeployerCreationCode": "0x61016080604052346200016057620000178162000165565b60178152602081017f4e6577466163746f727950726f78794465706c6f796572000000000000000000815260405191620000518362000165565b6001835260208301603160f81b81526200006b8262000181565b926101209384526200007d8562000354565b92610140938452519020938460e05251902091610100938385524660a0526040519360208501917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604086015260608501524660808501523060a085015260a0845260c084019380851060018060401b038611176200014a57846040525190206080523060c05261143f938462000502853960805184610bb5015260a05184610c80015260c05184610b7f015260e05184610c0401525183610c2a01525182606101525181608b0152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b604081019081106001600160401b038211176200014a57604052565b8051602091908281101562000220575090601f825111620001bf5780825192015190808310620001b057501790565b82600019910360031b1b161790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b82851062000206575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620001e2565b6001600160401b0381116200014a576000928354926001938481811c9116801562000349575b838210146200033557601f8111620002ff575b5081601f841160011462000298575092829391839286946200028c575b50501b916000199060031b1c191617905560ff90565b01519250388062000276565b919083601f1981168780528488209488905b88838310620002e45750505010620002ca575b505050811b01905560ff90565b015160001960f88460031b161c19169055388080620002bd565b858701518855909601959485019487935090810190620002aa565b85805284601f848820920160051c820191601f860160051c015b8281106200032957505062000259565b87815501859062000319565b634e487b7160e01b86526022600452602486fd5b90607f169062000246565b805160209081811015620003e25750601f825111620003815780825192015190808310620001b057501790565b90604051809263305a27a960e01b82528060048301528251908160248401526000935b828510620003c8575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350620003a4565b9192916001600160401b0381116200014a5760019182548381811c91168015620004f6575b82821014620004e057601f8111620004a7575b5080601f83116001146200045a5750819293946000926200044e575b5050600019600383901b1c191690821b17905560ff90565b01519050388062000436565b90601f198316958460005282600020926000905b8882106200048f5750508385969710620002ca57505050811b01905560ff90565b8087859682949686015181550195019301906200046e565b8360005283601f83600020920160051c820191601f850160051c015b828110620004d35750506200041a565b60008155018490620004c3565b634e487b7160e01b600052602260045260246000fd5b90607f16906200040756fe60406080815260048036101561001457600080fd5b600091823560e01c806315d06c3114610544578063409bdf89146104e8578063825748bc1461016c576384b0196e1461004c57600080fd5b346101685782600319360112610168576100857f00000000000000000000000000000000000000000000000000000000000000006106f9565b926100af7f0000000000000000000000000000000000000000000000000000000000000000610801565b90825192602092838501958587106001600160401b03881117610153575092806101098388966100fc998b9996528686528151998a99600f60f81b8b5260e0868c015260e08b019061066f565b91898303908a015261066f565b924660608801523060808801528460a088015286840360c088015251928381520193925b82811061013c57505050500390f35b83518552869550938101939281019260010161012d565b604190634e487b7160e01b6000525260246000fd5b8280fd5b50346101685760e0366003190112610168578135926001600160401b0392604435848111610168576101a190369083016105ee565b9190946101ac610620565b956101b5610636565b9060a4359260018060a01b0391828516968786036104e45760c4358381116104e0578c859136908a01906101e8916105ee565b916024998986888d356101fa95610ace565b913690610206926108b6565b61020f91610a11565b610218906108fc565b168c60601c1480156104c9575b156104535789519b8c6107638082019182108683111761044157908e91610ca7833930815260209e8f910301908bf590811561043757908c91858c51938401921682528b808401528a60608401526060835260808301948386109086111761042557918a8e926102b26102be958f8990528060a0860198893784019160a08301938452845193849161064c565b010380855201836106d8565b8151156103e557908291853591519089f5169788156103a35781168089036103885750873b15610384578651631b2ce7f360e11b815291168382015284818381838b5af1801561037a57610367575b50853b1561036357908391855193849263189acdbd60e31b84528301528183885af1801561035957610342575b505051908152f35b61034c8291610694565b610356578061033a565b80fd5b83513d84823e3d90fd5b8380fd5b61037390949194610694565b923861030d565b86513d87823e3d90fd5b8580fd5b8489856044938b51936312ae30e560e01b8552840152820152fd5b875162461bcd60e51b81528086018b90526019818601527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606490fd5b6064868c87818d519362461bcd60e51b85528401528201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b634e487b7160e01b8b5260418952878bfd5b8a513d8b823e3d90fd5b634e487b7160e01b8c5260418a52888cfd5b895162461bcd60e51b81526020818901526045818801527f496e76616c69642073616c74202d206669727374203230206279746573206f6660448201527f207468652073616c74206d757374206d617463682063616c6c696e67206164646064820152643932b9b99760d91b608482015260a490fd5b506bffffffffffffffffffffffff198c1615610225565b8980fd5b8880fd5b5082346103565760a036600319011261035657604435906001600160401b038211610356575060209261052161053d92369083016105ee565b610529610620565b91610532610636565b936024359035610ace565b9051908152f35b509190346105ea5760c03660031901126105ea576001600160401b03916044358381116105ea5761057890369084016105ee565b610583949194610620565b9161058c610636565b9360a4359182116103565760206105da896105d28a6105cc8b6105c48c8c8c6105b7368e87016105ee565b9790956024359035610ace565b9236916108b6565b90610a11565b9290926108fc565b516001600160a01b039091168152f35b5080fd5b9181601f8401121561061b578235916001600160401b03831161061b576020838186019501011161061b57565b600080fd5b606435906001600160a01b038216820361061b57565b608435906001600160a01b038216820361061b57565b60005b83811061065f5750506000910152565b818101518382015260200161064f565b906020916106888151809281855285808601910161064c565b601f01601f1916010190565b6001600160401b0381116106a757604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b038211176106a757604052565b90601f801991011681019081106001600160401b038211176106a757604052565b60ff81146107375760ff811690601f8211610725576040519161071b836106bd565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b506040516000805490600182811c908084169384156107f7575b60209485841081146107e357838752869493929181156107c35750600114610785575b5050610782925003826106d8565b90565b600080805285812095935091905b8183106107ab57505061078293508201013880610774565b85548784018501529485019486945091830191610793565b91505061078294925060ff191682840152151560051b8201013880610774565b634e487b7160e01b85526022600452602485fd5b91607f1691610751565b60ff81146108235760ff811690601f8211610725576040519161071b836106bd565b50604051600060019081549182811c908084169384156108ac575b60209485841081146107e357838752869493929181156107c3575060011461086e575050610782925003826106d8565b600081815285812095935091905b81831061089457505061078293508201013880610774565b8554878401850152948501948694509183019161087c565b91607f169161083e565b9291926001600160401b0382116106a757604051916108df601f8201601f1916602001846106d8565b82948184528183011161061b578281602093846000960137010152565b60058110156109fb578061090d5750565b600181036109555760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606490fd5b600281036109a25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146109ab57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b906041815114600014610a3f57610a3b916020820151906060604084015193015160001a90610a49565b9091565b5050600090600290565b9291906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311610ac25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15610ab55781516001600160a01b03811615610aaf579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b939291610ade91959236916108b6565b602081519101206040519460208601947f4f2bfcc23c1adbe54973f469f111f1848a62d32cc4a906c7a5ced17481b366ea865260408701526060860152608085015260018060a01b0380921660a08501521660c083015260c0825260e08201918083106001600160401b038411176106a757604292604052519020610b61610b7c565b906040519161190160f01b8352600283015260228201522090565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480610c7d575b15610bd7577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c081018181106001600160401b038211176106a75760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614610bae56fe60c03461008b57601f61076338819003918201601f19168301916001600160401b038311848410176100905780849260209460405283398101031261008b57516001600160a01b038116810361008b573060805260a0526040516106bc90816100a782396080518181816058015281816101280152610394015260a05181818161016d01526103da0152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060408181526004918236101561001657600080fd5b600090813560e01c9081633659cfe61461036a575080634f1ef286146100ad576352d1902d1461004557600080fd5b346100aa57806003193601126100aa57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361009d57602090516000805160206106678339815191528152f35b51635e4c25f160e01b8152fd5b80fd5b509080600319360112610366576100c2610587565b9060243567ffffffffffffffff811161036257366023820112156103625780850135906100ee826105da565b6100fa845191826105a2565b8281526020928382019236602483830101116103035781889260248793018637830101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116903082146103525760008051602061066783398151915291818354160361034257807f000000000000000000000000000000000000000000000000000000000000000016330361030e577f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156101d1575050505050506101ce9192506105f6565b80f35b86979597169087516352d1902d60e01b815285818b81865afa8791816102db575b5061020757885163e5ec176960e01b81528a90fd5b989293949698979597036102cc5761021e886105f6565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28251158015906102c4575b610260575b505050505050905080f35b873b156102b857505093809581926102a19651915af4903d156102ae573d61029361028a826105da565b925192836105a2565b81528481933d92013e61063d565b5080388080808080610255565b506060915061063d565b63369891e760e01b8152fd5b506001610250565b5083516308373ebf60e41b8152fd5b9091508681813d8311610307575b6102f381836105a2565b81010312610303575190386101f2565b8780fd5b503d6102e9565b855162461bcd60e51b8152808a01869052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b85516364cd8d1960e01b81528990fd5b8551631932df4560e01b81528990fd5b8380fd5b5080fd5b91929050346105835760208060031936011261036257610388610587565b926001600160a01b03907f0000000000000000000000000000000000000000000000000000000000000000821690308214610575575060008051602061066783398151915290828254160361056557817f0000000000000000000000000000000000000000000000000000000000000000163303610531578351908382019282841067ffffffffffffffff85111761051e578386528783527f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561045b575050505050506101ce9192506105f6565b86979597169087516352d1902d60e01b815285818b81865afa8791816104ef575b5061049157885163e5ec176960e01b81528a90fd5b989293949698979597036102cc576104a8886105f6565b8451907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28251158015906104e85761026057505050505050905080f35b5086610250565b9091508681813d8311610517575b61050781836105a2565b810103126103035751903861047c565b503d6104fd565b634e487b7160e01b885260418952602488fd5b835162461bcd60e51b8152808801849052600e60248201526d1b9bdd08185d5d1a1bdc9a5e995960921b6044820152606490fd5b83516364cd8d1960e01b81528790fd5b631932df4560e01b81528790fd5b8280fd5b600435906001600160a01b038216820361059d57565b600080fd5b90601f8019910116810190811067ffffffffffffffff8211176105c457604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116105c457601f01601f191660200190565b803b1561062b5760008051602061066783398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405163529880eb60e01b8152600490fd5b156106455790565b80511561065457805190602001fd5b6040516350a28c9b60e11b8152600490fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122045956a6c2f86f27f4001483acf6a61195441ac40433c504ce3ac6d6bef8b1b1864736f6c63430008110033a2646970667358221220dabba1dcd032491f8a97dc59455163d769d7f2c0092154bc5aa3845d80c470a464736f6c63430008110033", + "proxyDeployerSalt": "0x0000000000000000000000000000000000000000668d7f9ec18e35000dbaba0e", + "proxySalt": "0x0ab5974fbf52091e866576dd1d84bf3fba30cb2996f12a729b7ff2a2238a3a8f", + "proxyShimSalt": "0x4f9991c82c76ae04cc39f23ab909aa919886ba120000000000000000000000c8" +} \ No newline at end of file diff --git a/determinsticConfig/premintExecutorProxy/signatures.json b/determinsticConfig/premintExecutorProxy/signatures.json new file mode 100644 index 000000000..82b731cea --- /dev/null +++ b/determinsticConfig/premintExecutorProxy/signatures.json @@ -0,0 +1,3 @@ +{ + "999": "0x18ec8191bac7a5d1751104f4ef1b817df5b307c9ce0d4ea68af4fc00a429cf8c30483b3cb0278e8cf28a9c1af97f9a9f59bb05863aeb5adc0b7897e604afec931c" +} \ No newline at end of file diff --git a/package/deployment.ts b/package/deployment.ts index 59444b863..36b96b685 100644 --- a/package/deployment.ts +++ b/package/deployment.ts @@ -16,14 +16,14 @@ export type DeployedContracts = { export const signDeployFactory = ({ account, determinsticDeploymentConfig: config, - factoryImplAddress, - factoryOwner, + implementationAddress, + owner, chainId, }: { account: LocalAccount; determinsticDeploymentConfig: DeterminsticDeploymentConfig; - factoryImplAddress: Address; - factoryOwner: Address; + implementationAddress: Address; + owner: Address; chainId: number; }) => account.signTypedData({ @@ -38,10 +38,10 @@ export const signDeployFactory = ({ }, message: { proxyShimSalt: config.proxyShimSalt, - implementationAddress: factoryImplAddress, + implementationAddress, proxyCreationCode: config.proxyCreationCode, proxySalt: config.proxySalt, - owner: factoryOwner, + owner: owner, }, primaryType: "createProxy", domain: { diff --git a/script/DeployNewImplementation.s.sol b/script/DeployNewImplementation.s.sol index c7160a957..434630558 100644 --- a/script/DeployNewImplementation.s.sol +++ b/script/DeployNewImplementation.s.sol @@ -44,6 +44,7 @@ contract DeployNewImplementations is ZoraDeployerBase { deployment.factoryImpl = factoryImplAddress; deployment.contract1155Impl = contract1155ImplAddress; + deployment.preminterImpl = ZoraDeployerUtils.deployNewPreminterImplementation(address(deployment.factoryProxy)); return getDeploymentJSON(deployment); } diff --git a/script/DeployNewPreminterAndFactoryProxy.s.sol b/script/DeployNewPreminterAndFactoryProxy.s.sol deleted file mode 100644 index 4dc44fe19..000000000 --- a/script/DeployNewPreminterAndFactoryProxy.s.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.17; - -import "forge-std/Script.sol"; -import "forge-std/console2.sol"; - -import {ZoraDeployerBase} from "./ZoraDeployerBase.sol"; -import {ChainConfig, Deployment} from "../src/deployment/DeploymentConfig.sol"; - -contract DeployNewPreminterAndFactoryProxy is ZoraDeployerBase { - function run() public returns (string memory) { - Deployment memory deployment = getDeployment(); - - uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); - // address deployer = vm.envAddress("DEPLOYER"); - - vm.startBroadcast(deployerPrivateKey); - - // deployNew1155AndFactoryProxy(deployment, deployer); - - deployNewPreminterProxy(deployment); - - vm.stopBroadcast(); - - return getDeploymentJSON(deployment); - } -} diff --git a/script/DeployNewFactoryProxy.s.sol b/script/DeployNewProxies.s.sol similarity index 51% rename from script/DeployNewFactoryProxy.s.sol rename to script/DeployNewProxies.s.sol index fc00e4b91..c7c752fad 100644 --- a/script/DeployNewFactoryProxy.s.sol +++ b/script/DeployNewProxies.s.sol @@ -10,11 +10,9 @@ import {ZoraDeployerUtils} from "../src/deployment/ZoraDeployerUtils.sol"; import {NewFactoryProxyDeployer} from "../src/deployment/NewFactoryProxyDeployer.sol"; import {DeterminsticDeployerScript, DeterminsticParams} from "../src/deployment/DeterminsticDeployerScript.sol"; -contract DeployNewFactoryProxy is ZoraDeployerBase, DeterminsticDeployerScript { +contract DeployNewProxies is ZoraDeployerBase, DeterminsticDeployerScript { using stdJson for string; - error MismatchedAddress(address expected, address actual); - function run() public returns (string memory) { uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); // address deployer = vm.envAddress("DEPLOYER"); @@ -25,33 +23,26 @@ contract DeployNewFactoryProxy is ZoraDeployerBase, DeterminsticDeployerScript { Deployment memory deployment = getDeployment(); // get signing instructions - - (DeterminsticParams memory params, bytes memory signature) = readDeterminsticParams("factoryProxy", chain); - vm.startBroadcast(deployerPrivateKey); - NewFactoryProxyDeployer factoryDeployer = NewFactoryProxyDeployer( - ZoraDeployerUtils.IMMUTABLE_CREATE2_FACTORY.safeCreate2(params.proxyDeployerSalt, params.proxyDeployerCreationCode) - ); - - console2.log(address(factoryDeployer)); - console2.log(params.proxyDeployerAddress); - - if (address(factoryDeployer) != params.proxyDeployerAddress) revert MismatchedAddress(params.proxyDeployerAddress, address(factoryDeployer)); + address factoryProxyAddress = deployDeterminsticProxy({ + proxyName: "factoryProxy", + implementation: deployment.factoryImpl, + owner: chainConfig.factoryOwner, + chain: chain + }); - address factoryProxyAddress = factoryDeployer.createFactoryProxyDeterminstic( - params.proxyShimSalt, - params.proxySalt, - params.proxyCreationCode, - params.determinsticProxyAddress, - deployment.factoryImpl, - chainConfig.factoryOwner, - signature - ); + address preminterProxyAddress = deployDeterminsticProxy({ + proxyName: "premintExecutorProxy", + implementation: deployment.preminterImpl, + owner: chainConfig.factoryOwner, + chain: chain + }); vm.stopBroadcast(); deployment.factoryProxy = factoryProxyAddress; + deployment.preminterProxy = preminterProxyAddress; return getDeploymentJSON(deployment); } diff --git a/script/FactoryProxyDeterminsticParams.sol b/script/FactoryProxyDeterminsticParams.sol new file mode 100644 index 000000000..1dde8612a --- /dev/null +++ b/script/FactoryProxyDeterminsticParams.sol @@ -0,0 +1,31 @@ +// spdx-license-identifier: mit +pragma solidity ^0.8.17; + +import "forge-std/Script.sol"; +import "forge-std/console2.sol"; + +import {ZoraDeployerBase} from "./ZoraDeployerBase.sol"; +import {Zora1155Factory} from "../src/proxies/Zora1155Factory.sol"; +import {ProxyShim} from "../src/utils/ProxyShim.sol"; +import {LibString} from "solady/utils/LibString.sol"; +import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; +import {ZoraDeployerUtils} from "../src/deployment/ZoraDeployerUtils.sol"; +import {DeterminsticDeployerScript, DeterminsticParams} from "../src/deployment/DeterminsticDeployerScript.sol"; +import {NewFactoryProxyDeployer} from "../src/deployment/NewFactoryProxyDeployer.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; + +/// @title Gets parameters for determinstically deploying a new 1155 factory proxy at an address starting with 0x777777, regardless of the chain. +/// Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi +/// @author +/// @notice +contract FactoryProxyDeterminsticParams is ZoraDeployerBase, DeterminsticDeployerScript { + function run() public returns (DeterminsticParams memory determinsticParams) { + address deployerAddress = 0x4F9991C82C76aE04CC39f23aB909AA919886ba12; + + bytes memory proxyCreationCode = type(Zora1155Factory).creationCode; + + determinsticParams = getDeterminsticDeploymentParams(deployerAddress, proxyCreationCode, 100); + + serializeAndSaveOutput(determinsticParams, "factoryProxy"); + } +} diff --git a/script/GenerateDeterminsticParams.s.sol b/script/GenerateDeterminsticParams.s.sol deleted file mode 100644 index f22ef1415..000000000 --- a/script/GenerateDeterminsticParams.s.sol +++ /dev/null @@ -1,58 +0,0 @@ -// spdx-license-identifier: mit -pragma solidity ^0.8.17; - -import "forge-std/Script.sol"; -import "forge-std/console2.sol"; - -import {ZoraDeployerBase} from "./ZoraDeployerBase.sol"; -import {Zora1155Factory} from "../src/proxies/Zora1155Factory.sol"; -import {ProxyShim} from "../src/utils/ProxyShim.sol"; -import {LibString} from "solady/utils/LibString.sol"; -import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; -import {ZoraDeployerUtils} from "../src/deployment/ZoraDeployerUtils.sol"; -import {DeterminsticDeployerScript, DeterminsticParams} from "../src/deployment/DeterminsticDeployerScript.sol"; -import {NewFactoryProxyDeployer} from "../src/deployment/NewFactoryProxyDeployer.sol"; -import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; - -/// @title Gets parameters for determinstically deploying a new factory proxy at an address starting with 0x777777, regardless of the chain. -/// Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi -/// @author -/// @notice -contract GetDeterminsticParam is ZoraDeployerBase, DeterminsticDeployerScript { - function run() public { - address deployerAddress = 0x4F9991C82C76aE04CC39f23aB909AA919886ba12; - - bytes memory proxyCreationCode = type(Zora1155Factory).creationCode; - - ( - bytes32 proxyDeployerSalt, - bytes memory newFactoryDeployerCreationCode, - address proxyDeployerAddress, - bytes32 proxyShimSalt, - bytes32 proxySalt, - address determinsticProxyAddress - ) = getDeterminsticDeploymentParams(deployerAddress, proxyCreationCode); - - DeterminsticParams memory result = DeterminsticParams({ - proxyDeployerCreationCode: newFactoryDeployerCreationCode, - proxyCreationCode: proxyCreationCode, - deployerAddress: deployerAddress, - proxyDeployerAddress: proxyDeployerAddress, - proxyDeployerSalt: proxyDeployerSalt, - proxyShimSalt: proxyShimSalt, - proxySalt: proxySalt, - determinsticProxyAddress: determinsticProxyAddress - }); - - serializeAndSaveOutput(result); - - // extract results - console2.log("deployer address: ", deployerAddress); - // only used for test purposes - // console2.log("deployer pivate key", deployerPrivateKey); - console2.log("new factory proxy deployer salt:", vm.toString(proxyDeployerSalt)); - console2.log("proxy shim bytes32 salt:", vm.toString(proxyShimSalt)); - console2.log("factory proxy bytes32 salt: ", vm.toString(proxySalt)); - console2.log("expected address: ", determinsticProxyAddress); - } -} diff --git a/script/PremintProxyDeterminsticParams.sol b/script/PremintProxyDeterminsticParams.sol new file mode 100644 index 000000000..78ccecc27 --- /dev/null +++ b/script/PremintProxyDeterminsticParams.sol @@ -0,0 +1,31 @@ +// spdx-license-identifier: mit +pragma solidity ^0.8.17; + +import "forge-std/Script.sol"; +import "forge-std/console2.sol"; + +import {ZoraDeployerBase} from "./ZoraDeployerBase.sol"; +import {Zora1155PremintExecutor} from "../src/proxies/Zora1155PremintExecutor.sol"; +import {ProxyShim} from "../src/utils/ProxyShim.sol"; +import {LibString} from "solady/utils/LibString.sol"; +import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; +import {ZoraDeployerUtils} from "../src/deployment/ZoraDeployerUtils.sol"; +import {DeterminsticDeployerScript, DeterminsticParams} from "../src/deployment/DeterminsticDeployerScript.sol"; +import {NewFactoryProxyDeployer} from "../src/deployment/NewFactoryProxyDeployer.sol"; +import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; + +/// @title Gets parameters for determinstically deploying a new 1155 factory proxy at an address starting with 0x777777, regardless of the chain. +/// Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi +/// @author +/// @notice +contract PremintProxyDeterminsticParams is ZoraDeployerBase, DeterminsticDeployerScript { + function run() public returns (DeterminsticParams memory determinsticParams) { + address deployerAddress = 0x4F9991C82C76aE04CC39f23aB909AA919886ba12; + + bytes memory proxyCreationCode = type(Zora1155PremintExecutor).creationCode; + + determinsticParams = getDeterminsticDeploymentParams(deployerAddress, proxyCreationCode, 200); + + serializeAndSaveOutput(determinsticParams, "premintExecutorProxy"); + } +} diff --git a/script/UpgradePreminter.s.sol b/script/UpgradePreminter.s.sol index a8e34ab4c..aae6ba3a3 100644 --- a/script/UpgradePreminter.s.sol +++ b/script/UpgradePreminter.s.sol @@ -23,7 +23,7 @@ contract UpgradePreminter is ZoraDeployerBase { upgradeCalldata = abi.encodeWithSelector(UUPSUpgradeable.upgradeTo.selector, preminterImplementation); - upgradeTarget = deployment.preminter; + upgradeTarget = deployment.preminterImpl; console2.log("Upgrade PremintExecutor target and implementatin:", upgradeTarget, preminterImplementation); console2.log("To upgrade, use this calldata:"); diff --git a/script/ZoraDeployerBase.sol b/script/ZoraDeployerBase.sol index b790a7740..f6bb7d272 100644 --- a/script/ZoraDeployerBase.sol +++ b/script/ZoraDeployerBase.sol @@ -30,7 +30,8 @@ abstract contract ZoraDeployerBase is ScriptDeploymentConfig { vm.serializeString(deploymentJsonKey, CONTRACT_1155_IMPL_VERSION, deployment.contract1155ImplVersion); vm.serializeAddress(deploymentJsonKey, CONTRACT_1155_IMPL, deployment.contract1155Impl); vm.serializeAddress(deploymentJsonKey, FACTORY_IMPL, deployment.factoryImpl); - vm.serializeAddress(deploymentJsonKey, PREMINTER, deployment.preminter); + vm.serializeAddress(deploymentJsonKey, PREMINTER_PROXY, deployment.preminterImpl); + vm.serializeAddress(deploymentJsonKey, PREMINTER_IMPL, deployment.preminterImpl); deploymentJson = vm.serializeAddress(deploymentJsonKey, FACTORY_PROXY, deployment.factoryProxy); console2.log(deploymentJson); } @@ -51,11 +52,11 @@ abstract contract ZoraDeployerBase is ScriptDeploymentConfig { deployment.factoryImpl = factoryImplAddress; } - function deployNewPreminterProxy(Deployment memory deployment) internal { - address proxyOwner = getChainConfig().factoryOwner; + // function deployNewPreminterProxy(Deployment memory deployment) internal { + // address proxyOwner = getChainConfig().factoryOwner; - deployment.preminter = ZoraDeployerUtils.deployNewPreminterProxy(deployment.factoryProxy, proxyOwner); - } + // deployment.preminter = ZoraDeployerUtils.deployNewPreminterProxy(deployment.factoryProxy, proxyOwner); + // } /// @notice Deploy a test contract for etherscan auto-verification /// @param factoryProxy Factory address to use diff --git a/script/copy-deployed-contracts.mjs b/script/copy-deployed-contracts.mjs index 8f6faabc4..11775d61a 100644 --- a/script/copy-deployed-contracts.mjs +++ b/script/copy-deployed-contracts.mjs @@ -39,7 +39,7 @@ async function copyEnvironmentRunFiles(scriptName) { if (esMain(import.meta)) { const command = process.argv[2]; - let scriptName = 'Deploy.s.sol'; + let scriptName = 'DeployNewImplementation.s.sol'; if (command === "upgrade"){ scriptName = 'Upgrade.s.sol'; diff --git a/script/signDeploymentTransactions.ts b/script/signDeploymentTransactions.ts index c30725b64..d93d3be5c 100644 --- a/script/signDeploymentTransactions.ts +++ b/script/signDeploymentTransactions.ts @@ -1,57 +1,81 @@ import { createAccount } from "@turnkey/viem"; import { TurnkeyClient } from "@turnkey/http"; -import { Address } from "viem"; +import { Address, LocalAccount } from "viem"; import { ApiKeyStamper } from "@turnkey/api-key-stamper"; -// import { getDeployFactoryProxyDeterminsticTx } from '../package/deployment'; -// import { testConfig } from "../package/deploymentConfig"; -import deployConfig from '../determinsticConfig/factoryProxy/params.json'; +import factoryProxyDeployConfig from '../determinsticConfig/factoryProxy/params.json'; import { glob } from "glob"; import * as path from "path"; import * as dotenv from "dotenv"; import { promisify } from 'util'; -import { writeFile } from 'fs'; +import { writeFile, readFile } from 'fs'; import { ConfiguredSalt, DeterminsticDeploymentConfig, signDeployFactory } from "../package/deployment"; import { fileURLToPath } from 'url'; import { dirname } from 'path'; +import { config } from "process"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const writeFileAsync = promisify(writeFile); +const readFileAsync = promisify(readFile); // Load environment variables from `.env.local` dotenv.config({ path: path.resolve(__dirname, "../.env") }); -async function main() { - // Create a Turnkey HTTP client with API key credentials - const httpClient = new TurnkeyClient( - { - baseUrl: "https://api.turnkey.com", - }, - // This uses API key credentials. - // If you're using passkeys, use `@turnkey/webauthn-stamper` to collect webauthn signatures: - // new WebauthnStamper({...options...}) - new ApiKeyStamper({ - apiPublicKey: process.env.API_PUBLIC_KEY!, - apiPrivateKey: process.env.API_PRIVATE_KEY!, - }) - ); +type ChainConfig = { + chainId: number, + implementationAddress: Address, + owner: Address +}; + +async function signAndSaveSignatures({ + turnkeyAccount, + chainConfigs, + proxyName +}: { + turnkeyAccount: LocalAccount, + chainConfigs: ChainConfig[], + proxyName: "factoryProxy" | "premintExecutorProxy" +}) { + const configFolder = path.resolve(__dirname, `../determinsticConfig/${proxyName}/`); + const configFile = path.join(configFolder, 'params.json'); + const determinsticDeployConfig = JSON.parse(await readFileAsync(configFile, 'utf-8')); - // Create the Viem custom account - const turnkeyAccount = await createAccount({ - client: httpClient, - organizationId: "f7e5bec5-b7f9-486a-a8c3-cd1ec7362709", - privateKeyId: "3e3c5029-7ad7-4559-936f-93d21763143b", - // optional; will be fetched from Turnkey if not provided - ethereumAddress: "0x4F9991C82C76aE04CC39f23aB909AA919886ba12" - }); + const deploymentConfig: DeterminsticDeploymentConfig = { + proxyDeployerAddress: determinsticDeployConfig.proxyDeployerAddress as Address, + proxySalt: determinsticDeployConfig.proxySalt as ConfiguredSalt, + proxyShimSalt: determinsticDeployConfig.proxyShimSalt as ConfiguredSalt, + proxyCreationCode: determinsticDeployConfig.proxyCreationCode as Address + } + + const signedConfigs = await Promise.all(chainConfigs.map(async chainConfig => { + return { + chainId: chainConfig.chainId, + signature: await signDeployFactory({ + account: turnkeyAccount, + implementationAddress: chainConfig.implementationAddress, + owner: chainConfig.owner, + chainId: chainConfig.chainId, + determinsticDeploymentConfig: deploymentConfig + }), + } + })); + + // aggregate above to object of key value pair indexed by chain id as number: + const byChainId = signedConfigs.reduce((acc, { chainId, signature }) => { + acc[chainId] = signature; + return acc; + }, {} as { [key: number]: string } ); + + // write as json to ../determinsticConfig/factoryDeploySignatures.json: + await writeFileAsync(path.join(configFolder, "signatures.json"), JSON.stringify(byChainId, null, 2)); +} +const getFactoryImplConfigs = async () => { const addresseFiles = await glob( path.resolve(__dirname, "../addresses/*.json") ); - console.log(path.resolve(__dirname, "../addresses/*.json")); - const chainConfigs = await Promise.all(addresseFiles.map(async addressConfigFile => { const chainId = parseInt(path.basename(addressConfigFile).split(".")[0]); @@ -63,40 +87,74 @@ async function main() { return { chainId, - factoryImpl: fileContents['FACTORY_IMPL'] as Address, + implementationAddress: fileContents['FACTORY_IMPL'] as Address, owner: chainConfig['FACTORY_OWNER'] as Address } })); - const deploymentConfig: DeterminsticDeploymentConfig = { - proxyDeployerAddress: deployConfig.proxyDeployerAddress as Address, - proxySalt: deployConfig.proxySalt as ConfiguredSalt, - proxyShimSalt: deployConfig.proxyShimSalt as ConfiguredSalt, - proxyCreationCode: deployConfig.proxyCreationCode as Address - } + return chainConfigs; +} + +const getPreminterImplConfigs = async () => { + const addresseFiles = await glob( + path.resolve(__dirname, "../addresses/*.json") + ); + + const chainConfigs = await Promise.all(addresseFiles.map(async addressConfigFile => { + const chainId = parseInt(path.basename(addressConfigFile).split(".")[0]); + + // read file and process JSON contents: + const fileContents = await import(addressConfigFile); + + // read chain config file as json, which is located at: ../chainConfigs/${chainId}.json: + const chainConfig = await import(path.resolve(__dirname, `../chainConfigs/${chainId}.json`)); - const signedConfigs = await Promise.all(chainConfigs.map(async chainConfig => { return { - chainId: chainConfig.chainId, - signature: await signDeployFactory({ - account: turnkeyAccount, - factoryImplAddress: chainConfig.factoryImpl, - factoryOwner: chainConfig.owner, - chainId: chainConfig.chainId, - determinsticDeploymentConfig: deploymentConfig - }), + chainId, + implementationAddress: fileContents['PREMINTER_IMPL'] as Address, + owner: chainConfig['FACTORY_OWNER'] as Address } })); - // aggregate above to object of key value pair indexed by chain id as number: - const byChainId = signedConfigs.reduce((acc, { chainId, signature }) => { - acc[chainId] = signature; - return acc; - }, {} as { [key: number]: string } ); - // write as json to ../determinsticConfig/factoryDeploySignatures.json: - await writeFileAsync(path.resolve(__dirname, "../determinsticConfig/factoryProxy/signatures.json"), JSON.stringify(byChainId, null, 2)); + return chainConfigs.filter(x => x.implementationAddress !== undefined); +} + +async function main() { + // Create a Turnkey HTTP client with API key credentials + const httpClient = new TurnkeyClient( + { + baseUrl: "https://api.turnkey.com", + }, + // This uses API key credentials. + // If you're using passkeys, use `@turnkey/webauthn-stamper` to collect webauthn signatures: + new ApiKeyStamper({ + apiPublicKey: process.env.API_PUBLIC_KEY!, + apiPrivateKey: process.env.API_PRIVATE_KEY!, + }) + ); + + // Create the Viem custom account + const turnkeyAccount = await createAccount({ + client: httpClient, + organizationId: "f7e5bec5-b7f9-486a-a8c3-cd1ec7362709", + privateKeyId: "3e3c5029-7ad7-4559-936f-93d21763143b", + // optional; will be fetched from Turnkey if not provided + ethereumAddress: "0x4F9991C82C76aE04CC39f23aB909AA919886ba12" + }); + + await signAndSaveSignatures({ + turnkeyAccount, + chainConfigs: await getFactoryImplConfigs(), + proxyName: "factoryProxy" + }); + + await signAndSaveSignatures({ + turnkeyAccount, + chainConfigs: await getPreminterImplConfigs(), + proxyName: "premintExecutorProxy" + }); } main().catch((error) => { diff --git a/src/delegation/ZoraCreator1155PremintExecutor.sol b/src/delegation/ZoraCreator1155PremintExecutorImpl.sol similarity index 98% rename from src/delegation/ZoraCreator1155PremintExecutor.sol rename to src/delegation/ZoraCreator1155PremintExecutorImpl.sol index 7d7b3981d..7ffbd9dd8 100644 --- a/src/delegation/ZoraCreator1155PremintExecutor.sol +++ b/src/delegation/ZoraCreator1155PremintExecutorImpl.sol @@ -18,7 +18,7 @@ import {PremintConfig, ContractCreationConfig, TokenCreationConfig, ZoraCreator1 /// Signature must provided by the contract creator, or an account that's permitted to create new tokens on the contract. /// Mints the first x tokens to the executor of the transaction. /// @author @oveddan -contract ZoraCreator1155PremintExecutor is Ownable2StepUpgradeable, UUPSUpgradeable, IHasContractName, IZoraCreator1155Errors { +contract ZoraCreator1155PremintExecutorImpl is Ownable2StepUpgradeable, UUPSUpgradeable, IHasContractName, IZoraCreator1155Errors { IZoraCreator1155Factory public immutable zora1155Factory; /// @notice copied from SharedBaseConstants diff --git a/src/deployment/DeploymentConfig.sol b/src/deployment/DeploymentConfig.sol index 2e9dfb82c..291e81702 100644 --- a/src/deployment/DeploymentConfig.sol +++ b/src/deployment/DeploymentConfig.sol @@ -34,8 +34,10 @@ struct Deployment { address factoryImpl; /// @notice Factory proxy contract that creates zora drops style NFT contracts address factoryProxy; - /// @notice Preminter contract address - address preminter; + /// @notice Preminter proxy contract address + address preminterImpl; + /// @notice Preminter implementation contract address + address preminterProxy; } abstract contract DeploymentConfig is Script { @@ -61,7 +63,8 @@ abstract contract DeploymentConfig is Script { string constant CONTRACT_1155_IMPL_VERSION = "CONTRACT_1155_IMPL_VERSION"; string constant FACTORY_IMPL = "FACTORY_IMPL"; string constant FACTORY_PROXY = "FACTORY_PROXY"; - string constant PREMINTER = "PREMINTER"; + string constant PREMINTER_PROXY = "PREMINTER_PROXY"; + string constant PREMINTER_IMPL = "PREMINTER_IMPL"; /// @notice Return a prefixed key for reading with a ".". /// @param key key to prefix @@ -101,7 +104,8 @@ abstract contract DeploymentConfig is Script { deployment.contract1155ImplVersion = json.readString(getKeyPrefix(CONTRACT_1155_IMPL_VERSION)); deployment.factoryImpl = readAddressOrDefaultToZero(json, FACTORY_IMPL); deployment.factoryProxy = readAddressOrDefaultToZero(json, FACTORY_PROXY); - deployment.preminter = readAddressOrDefaultToZero(json, PREMINTER); + deployment.preminterImpl = readAddressOrDefaultToZero(json, PREMINTER_IMPL); + deployment.preminterProxy = readAddressOrDefaultToZero(json, PREMINTER_PROXY); } } diff --git a/src/deployment/DeterminsticDeployerScript.sol b/src/deployment/DeterminsticDeployerScript.sol index 62d6477e1..74f96df2f 100644 --- a/src/deployment/DeterminsticDeployerScript.sol +++ b/src/deployment/DeterminsticDeployerScript.sol @@ -46,13 +46,23 @@ contract DeterminsticDeployerScript is Script { salt = bytes32(vm.parseUint(saltStr)); } - function saltWithAddressInFirst20Bytes(address addressToMakeSaltWith) internal pure returns (bytes32) { + function saltWithAddressInFirst20Bytes(address addressToMakeSaltWith, uint256 suffix) internal pure returns (bytes32) { uint256 shifted = uint256(uint160(address(addressToMakeSaltWith))) << 96; - return bytes32(shifted); + // shifted on the left, suffix on the right: + + return bytes32(shifted | suffix); + } + + function paramsFilePath(string memory proxyName) internal pure returns (string memory) { + return string.concat(string.concat("determinsticConfig/", proxyName), "/params.json"); + } + + function signaturesFilePath(string memory proxyName) internal pure returns (string memory) { + return string.concat(string.concat("determinsticConfig/", proxyName), "/signatures.json"); } - function serializeAndSaveOutput(DeterminsticParams memory params) internal { + function serializeAndSaveOutput(DeterminsticParams memory params, string memory proxyName) internal { string memory result = "determinsitc_key"; vm.serializeBytes(result, "proxyDeployerCreationCode", params.proxyDeployerCreationCode); @@ -67,14 +77,12 @@ contract DeterminsticDeployerScript is Script { console2.log(finalOutput); - vm.writeJson(finalOutput, "determinsticConfig/factoryProxy/params.json"); + vm.writeJson(finalOutput, paramsFilePath(proxyName)); } - function readDeterminsticParams(string memory proxyName, uint256 chain) internal returns (DeterminsticParams memory params, bytes memory signature) { - string memory root = vm.projectRoot(); - string memory folder = string.concat(string.concat(root, "/determinsticConfig/"), proxyName); - string memory deployConfig = vm.readFile(string.concat(folder, "/params.json")); - string memory signatures = vm.readFile(string.concat(folder, "/signatures.json")); + function readDeterminsticParams(string memory proxyName, uint256 chain) internal view returns (DeterminsticParams memory params, bytes memory signature) { + string memory deployConfig = vm.readFile(paramsFilePath(proxyName)); + string memory signatures = vm.readFile(signaturesFilePath(proxyName)); params = DeterminsticParams({ proxyDeployerCreationCode: deployConfig.readBytes(".proxyDeployerCreationCode"), @@ -92,46 +100,34 @@ contract DeterminsticDeployerScript is Script { function getDeterminsticDeploymentParams( address deployerAddress, - bytes memory proxyCreationCode - ) - internal - returns ( - bytes32 newFactoryProxyDeployerSalt, - bytes memory newFactoryProxyDeployerInitCode, - address proxyDeployerContractAddress, - bytes32 proxyShimSalt, - bytes32 proxySalt, - address determinsticProxyAddress - ) - { + bytes memory proxyCreationCode, + uint256 proxyShimSaltSuffix + ) internal returns (DeterminsticParams memory) { // 1. Get salt with first bytes that match address, and resulting determinsitic factory proxy deployer address // replace first 20 characters of salt with deployer address, so that the salt can be used with // ImmutableCreate2Factory.safeCreate2 when called by this deployer's account: - newFactoryProxyDeployerSalt = ZoraDeployerUtils.FACTORY_DEPLOYER_DEPLOYMENT_SALT; + bytes32 proxyDeployerSalt = ZoraDeployerUtils.FACTORY_DEPLOYER_DEPLOYMENT_SALT; - newFactoryProxyDeployerInitCode = type(NewFactoryProxyDeployer).creationCode; + bytes memory proxyDeployerCreationCode = type(NewFactoryProxyDeployer).creationCode; // we can know determinstically what the address of the new factory proxy deployer will be, given it's deployed from with the salt and init code, // from the ImmutableCreate2Factory - proxyDeployerContractAddress = ZoraDeployerUtils.IMMUTABLE_CREATE2_FACTORY.findCreate2Address( - newFactoryProxyDeployerSalt, - newFactoryProxyDeployerInitCode - ); + address proxyDeployerAddress = ZoraDeployerUtils.IMMUTABLE_CREATE2_FACTORY.findCreate2Address(proxyDeployerSalt, proxyDeployerCreationCode); - console2.log("expected factory deployer address:", proxyDeployerContractAddress); + console2.log("expected factory deployer address:", proxyDeployerAddress); // 2. Get random proxy shim salt, and resulting determinstic address // Proxy shim will be initialized with the factory deployer address as the owner, allowing only the factory deployer to upgrade the proxy, // to the eventual factory implementation - bytes memory proxyShimInitCode = abi.encodePacked(type(ProxyShim).creationCode, abi.encode(proxyDeployerContractAddress)); + bytes memory proxyShimInitCode = abi.encodePacked(type(ProxyShim).creationCode, abi.encode(proxyDeployerAddress)); // create any arbitrary salt for proxy shim (this can be anything, we just care about the resulting address) - proxyShimSalt = saltWithAddressInFirst20Bytes(deployerAddress); + bytes32 proxyShimSalt = saltWithAddressInFirst20Bytes(deployerAddress, proxyShimSaltSuffix); // now get determinstic proxy shim address based on salt, deployer address, which will be NewFactoryProxyDeployer address and init code - address proxyShimAddress = Create2.computeAddress(proxyShimSalt, keccak256(proxyShimInitCode), proxyDeployerContractAddress); + address proxyShimAddress = Create2.computeAddress(proxyShimSalt, keccak256(proxyShimInitCode), proxyDeployerAddress); console2.log("proxy shim address:"); console2.log(proxyShimAddress); @@ -144,6 +140,51 @@ contract DeterminsticDeployerScript is Script { console.log("init code hash: ", LibString.toHexStringNoPrefix(uint256(creationCodeHash), 32)); - (proxySalt, determinsticProxyAddress) = mineSalt(proxyDeployerContractAddress, creationCodeHash, "777777"); + (bytes32 proxySalt, address determinsticProxyAddress) = mineSalt(proxyDeployerAddress, creationCodeHash, "777777"); + + DeterminsticParams memory result = DeterminsticParams({ + proxyDeployerCreationCode: proxyDeployerCreationCode, + proxyCreationCode: proxyCreationCode, + deployerAddress: deployerAddress, + proxyDeployerAddress: proxyDeployerAddress, + proxyDeployerSalt: proxyDeployerSalt, + proxyShimSalt: proxyShimSalt, + proxySalt: proxySalt, + determinsticProxyAddress: determinsticProxyAddress + }); + + return result; + } + + error MismatchedAddress(address expected, address actual); + + function deployDeterminsticProxy(string memory proxyName, address implementation, address owner, uint256 chain) internal returns (address) { + (DeterminsticParams memory params, bytes memory signature) = readDeterminsticParams(proxyName, chain); + + NewFactoryProxyDeployer factoryDeployer; + + if (ZoraDeployerUtils.IMMUTABLE_CREATE2_FACTORY.hasBeenDeployed(params.proxyDeployerAddress)) { + factoryDeployer = NewFactoryProxyDeployer(params.proxyDeployerAddress); + } else { + factoryDeployer = NewFactoryProxyDeployer( + ZoraDeployerUtils.IMMUTABLE_CREATE2_FACTORY.safeCreate2(params.proxyDeployerSalt, params.proxyDeployerCreationCode) + ); + } + + console2.log(address(factoryDeployer)); + console2.log(params.proxyDeployerAddress); + + if (address(factoryDeployer) != params.proxyDeployerAddress) revert MismatchedAddress(params.proxyDeployerAddress, address(factoryDeployer)); + + return + factoryDeployer.createFactoryProxyDeterminstic( + params.proxyShimSalt, + params.proxySalt, + params.proxyCreationCode, + params.determinsticProxyAddress, + implementation, + owner, + signature + ); } } diff --git a/src/deployment/ZoraDeployerUtils.sol b/src/deployment/ZoraDeployerUtils.sol index 109cb77c2..098cc7540 100644 --- a/src/deployment/ZoraDeployerUtils.sol +++ b/src/deployment/ZoraDeployerUtils.sol @@ -8,8 +8,7 @@ import {ZoraCreator1155FactoryImpl} from "../factory/ZoraCreator1155FactoryImpl. import {IMinter1155} from "../interfaces/IMinter1155.sol"; import {Deployment, ChainConfig} from "./DeploymentConfig.sol"; import {ProxyShim} from "../utils/ProxyShim.sol"; -import {ZoraCreator1155PremintExecutor} from "../delegation/ZoraCreator1155PremintExecutor.sol"; -import {Zora1155PremintExecutorProxy} from "../proxies/Zora1155PremintExecutorProxy.sol"; +import {ZoraCreator1155PremintExecutorImpl} from "../delegation/ZoraCreator1155PremintExecutorImpl.sol"; import {IImmutableCreate2Factory} from "./IImmutableCreate2Factory.sol"; import {NewFactoryProxyDeployer} from "./NewFactoryProxyDeployer.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; @@ -41,7 +40,7 @@ library ZoraDeployerUtils { // we dont care what this salt is, as long as it's the same for all deployments and it has first 20 bytes of 0 // so that anyone can deploy it - bytes32 constant FACTORY_DEPLOYER_DEPLOYMENT_SALT = bytes32(0x0000000000000000000000000000000000000000668d7f9eb18e35000dbaba0e); + bytes32 constant FACTORY_DEPLOYER_DEPLOYMENT_SALT = bytes32(0x0000000000000000000000000000000000000000668d7f9ec18e35000dbaba0e); function createDeterminsticFactoryProxyDeployer() internal returns (NewFactoryProxyDeployer) { return NewFactoryProxyDeployer(IMMUTABLE_CREATE2_FACTORY.safeCreate2(FACTORY_DEPLOYER_DEPLOYMENT_SALT, type(NewFactoryProxyDeployer).creationCode)); @@ -49,7 +48,7 @@ library ZoraDeployerUtils { function deployNewPreminterImplementation(address factoryProxyAddress) internal returns (address) { // create preminter implementation - ZoraCreator1155PremintExecutor preminterImplementation = new ZoraCreator1155PremintExecutor(ZoraCreator1155FactoryImpl(factoryProxyAddress)); + ZoraCreator1155PremintExecutorImpl preminterImplementation = new ZoraCreator1155PremintExecutorImpl(ZoraCreator1155FactoryImpl(factoryProxyAddress)); return address(preminterImplementation); } @@ -74,17 +73,4 @@ library ZoraDeployerUtils { proxyDeployerAddress ); } - - function deployNewPreminterProxy(address factoryProxyAddress, address premintOwner) internal returns (address preminterProxyAddress) { - address preminterImplementation = deployNewPreminterImplementation(factoryProxyAddress); - - // build the proxy - Zora1155PremintExecutorProxy proxy = new Zora1155PremintExecutorProxy(preminterImplementation, ""); - - // access the executor implementation via the proxy, and initialize the admin - ZoraCreator1155PremintExecutor preminterAtProxy = ZoraCreator1155PremintExecutor(address(proxy)); - preminterAtProxy.initialize(premintOwner); - - preminterProxyAddress = address(proxy); - } } diff --git a/src/proxies/Zora1155PremintExecutorProxy.sol b/src/proxies/Zora1155PremintExecutor.sol similarity index 96% rename from src/proxies/Zora1155PremintExecutorProxy.sol rename to src/proxies/Zora1155PremintExecutor.sol index 01bf0c0bc..a11249e5f 100644 --- a/src/proxies/Zora1155PremintExecutorProxy.sol +++ b/src/proxies/Zora1155PremintExecutor.sol @@ -30,6 +30,6 @@ import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.s /// Imagine. Mint. Enjoy. /// @notice Imagine. Mint. Enjoy. /// @author @oveddan -contract Zora1155PremintExecutorProxy is Enjoy, ERC1967Proxy { +contract Zora1155PremintExecutor is Enjoy, ERC1967Proxy { constructor(address _logic, bytes memory _data) ERC1967Proxy(_logic, _data) {} } diff --git a/test/premint/Zora1155PremintExecutorProxy.t.sol b/test/premint/Zora1155PremintExecutorProxy.t.sol index 107238020..0a4e67a75 100644 --- a/test/premint/Zora1155PremintExecutorProxy.t.sol +++ b/test/premint/Zora1155PremintExecutorProxy.t.sol @@ -5,9 +5,9 @@ import "forge-std/Test.sol"; import {Zora1155FactoryFixtures} from "../fixtures/Zora1155FactoryFixtures.sol"; import {Zora1155PremintFixtures} from "../fixtures/Zora1155PremintFixtures.sol"; import {ZoraCreator1155FactoryImpl} from "../../src/factory/ZoraCreator1155FactoryImpl.sol"; -import {Zora1155PremintExecutorProxy} from "../../src/proxies/Zora1155PremintExecutorProxy.sol"; +import {Zora1155PremintExecutor} from "../../src/proxies/Zora1155PremintExecutor.sol"; import {ZoraCreator1155Impl} from "../../src/nft/ZoraCreator1155Impl.sol"; -import {ZoraCreator1155PremintExecutor} from "../../src/delegation/ZoraCreator1155PremintExecutor.sol"; +import {ZoraCreator1155PremintExecutorImpl} from "../../src/delegation/ZoraCreator1155PremintExecutorImpl.sol"; import {Zora1155Factory} from "../../src/proxies/Zora1155Factory.sol"; import {IMinter1155} from "../../src/interfaces/IMinter1155.sol"; import {ProxyShim} from "../../src/utils/ProxyShim.sol"; @@ -24,7 +24,7 @@ contract Zora1155PremintExecutorProxyTest is Test, IHasContractName { Zora1155Factory internal factoryProxy; ZoraCreator1155FactoryImpl factoryAtProxy; uint256 internal mintFeeAmount = 0.000777 ether; - ZoraCreator1155PremintExecutor preminterAtProxy; + ZoraCreator1155PremintExecutorImpl preminterAtProxy; function setUp() external { zora = makeAddr("zora"); @@ -38,13 +38,13 @@ contract Zora1155PremintExecutorProxyTest is Test, IHasContractName { vm.stopPrank(); // create preminter implementation - ZoraCreator1155PremintExecutor preminterImplementation = new ZoraCreator1155PremintExecutor(ZoraCreator1155FactoryImpl(address(factoryProxy))); + ZoraCreator1155PremintExecutorImpl preminterImplementation = new ZoraCreator1155PremintExecutorImpl(ZoraCreator1155FactoryImpl(address(factoryProxy))); // build the proxy - Zora1155PremintExecutorProxy proxy = new Zora1155PremintExecutorProxy(address(preminterImplementation), ""); + Zora1155PremintExecutor proxy = new Zora1155PremintExecutor(address(preminterImplementation), ""); // access the executor implementation via the proxy, and initialize the admin - preminterAtProxy = ZoraCreator1155PremintExecutor(address(proxy)); + preminterAtProxy = ZoraCreator1155PremintExecutorImpl(address(proxy)); preminterAtProxy.initialize(owner); } @@ -82,7 +82,7 @@ contract Zora1155PremintExecutorProxyTest is Test, IHasContractName { function test_onlyOwnerCanUpgrade() external { // try to upgrade as non-owner - ZoraCreator1155PremintExecutor newImplementation = new ZoraCreator1155PremintExecutor(factoryAtProxy); + ZoraCreator1155PremintExecutorImpl newImplementation = new ZoraCreator1155PremintExecutorImpl(factoryAtProxy); vm.expectRevert(IOwnable2StepUpgradeable.ONLY_OWNER.selector); vm.prank(creator); @@ -97,13 +97,13 @@ contract Zora1155PremintExecutorProxyTest is Test, IHasContractName { function test_canOnlyBeUpgradedToContractWithSameName() external { // upgrade to bad contract with has wrong name (this contract has mismatched name) vm.expectRevert( - abi.encodeWithSelector(ZoraCreator1155PremintExecutor.UpgradeToMismatchedContractName.selector, preminterAtProxy.contractName(), contractName()) + abi.encodeWithSelector(ZoraCreator1155PremintExecutorImpl.UpgradeToMismatchedContractName.selector, preminterAtProxy.contractName(), contractName()) ); vm.prank(owner); preminterAtProxy.upgradeTo(address(this)); // upgrade to good contract which has correct name - it shouldn't revert - ZoraCreator1155PremintExecutor newImplementation = new ZoraCreator1155PremintExecutor(ZoraCreator1155FactoryImpl(address(factoryProxy))); + ZoraCreator1155PremintExecutorImpl newImplementation = new ZoraCreator1155PremintExecutorImpl(ZoraCreator1155FactoryImpl(address(factoryProxy))); vm.prank(owner); preminterAtProxy.upgradeTo(address(newImplementation)); diff --git a/test/premint/ZoraCreator1155PremintExecutor.t.sol b/test/premint/ZoraCreator1155PremintExecutor.t.sol index 5ace65879..fe4f7e47f 100644 --- a/test/premint/ZoraCreator1155PremintExecutor.t.sol +++ b/test/premint/ZoraCreator1155PremintExecutor.t.sol @@ -14,7 +14,7 @@ import {ICreatorRoyaltiesControl} from "../../src/interfaces/ICreatorRoyaltiesCo import {ZoraCreatorFixedPriceSaleStrategy} from "../../src/minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol"; import {Zora1155Factory} from "../../src/proxies/Zora1155Factory.sol"; import {ZoraCreator1155FactoryImpl} from "../../src/factory/ZoraCreator1155FactoryImpl.sol"; -import {ZoraCreator1155PremintExecutor} from "../../src/delegation/ZoraCreator1155PremintExecutor.sol"; +import {ZoraCreator1155PremintExecutorImpl} from "../../src/delegation/ZoraCreator1155PremintExecutorImpl.sol"; import {ZoraCreator1155Attribution, ContractCreationConfig, TokenCreationConfig, PremintConfig} from "../../src/delegation/ZoraCreator1155Attribution.sol"; import {ForkDeploymentConfig} from "../../src/deployment/DeploymentConfig.sol"; import {ProxyShim} from "../../src/utils/ProxyShim.sol"; @@ -23,7 +23,7 @@ contract ZoraCreator1155PreminterTest is ForkDeploymentConfig, Test { uint256 internal constant CONTRACT_BASE_ID = 0; uint256 internal constant PERMISSION_BIT_MINTER = 2 ** 2; - ZoraCreator1155PremintExecutor internal preminter; + ZoraCreator1155PremintExecutorImpl internal preminter; Zora1155Factory factoryProxy; ZoraCreator1155FactoryImpl factoryImpl; @@ -60,7 +60,7 @@ contract ZoraCreator1155PreminterTest is ForkDeploymentConfig, Test { factoryImpl = ZoraCreator1155FactoryImpl(address(factoryProxy)); - preminter = new ZoraCreator1155PremintExecutor(factoryImpl); + preminter = new ZoraCreator1155PremintExecutorImpl(factoryImpl); } function makeDefaultContractCreationConfig() internal view returns (ContractCreationConfig memory) { @@ -194,14 +194,14 @@ contract ZoraCreator1155PreminterTest is ForkDeploymentConfig, Test { // get contract hash, which is unique per contract creation config, and can be used // retreive the address created for a contract - address preminterAddress = getDeployment().preminter; + address preminterAddress = getDeployment().preminterImpl; if (preminterAddress == address(0)) { console.log("preminter not configured for chain...skipping"); return; } - preminter = ZoraCreator1155PremintExecutor(preminterAddress); + preminter = ZoraCreator1155PremintExecutorImpl(preminterAddress); factoryImpl = ZoraCreator1155FactoryImpl(getDeployment().factoryImpl);