@@ -15,11 +15,13 @@ import {
1515import { IPlugin, PluginMetadata } from "modular-account-libs/interfaces/IPlugin.sol " ;
1616
1717import { ACCOUNT_IMPL, ENTRYPOINT } from "webauthn-owner-plugin/../script/Factory.s.sol " ;
18+ import { WebauthnOwnerPlugin } from "webauthn-owner-plugin/WebauthnOwnerPlugin.sol " ;
1819
1920import { EXA } from "@exactly/protocol/periphery/EXA.sol " ;
2021
2122import { ExaAccountFactory } from "../src/ExaAccountFactory.sol " ;
2223import {
24+ ExaPlugin,
2325 IAuditor,
2426 IDebtManager,
2527 IFlashLoaner,
@@ -67,56 +69,51 @@ contract Redeployer is BaseScript {
6769 if (admin == acct ("redeployer " )) revert AdminIsDeployer ();
6870 vm.startBroadcast (admin);
6971 if (address (dummy).code.length == 0 ) {
70- dummy = Dummy (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("Dummy " )), vm. getCode ( " Redeployer.s.sol: Dummy" ) ));
72+ dummy = Dummy (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("Dummy " )), type ( Dummy).creationCode ));
7173 }
7274 if (address (proxyAdmin).code.length == 0 ) {
7375 proxyAdmin = ProxyAdmin (
7476 CREATE3_FACTORY.deploy (
75- keccak256 (abi.encode ("ProxyAdmin " )),
76- abi.encodePacked (vm.getCode ("ProxyAdmin.sol:ProxyAdmin " ), abi.encode (admin))
77+ keccak256 (abi.encode ("ProxyAdmin " )), abi.encodePacked (type (ProxyAdmin).creationCode, abi.encode (admin))
7778 )
7879 );
7980 }
8081 if (address (auditor).code.length == 0 ) {
81- auditor = IAuditor (
82- CREATE3_FACTORY.deploy (keccak256 (abi.encode ("StubAuditor " )), vm.getCode ("Redeployer.s.sol:StubAuditor " ))
83- );
82+ auditor = IAuditor (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("StubAuditor " )), type (StubAuditor).creationCode));
8483 }
8584 if (address (marketUSDC).code.length == 0 || address (marketWETH).code.length == 0 ) {
8685 address stubAsset = CREATE3_FACTORY.getDeployed (admin, keccak256 (abi.encode ("StubAsset " )));
8786 if (stubAsset.code.length == 0 ) {
88- stubAsset = CREATE3_FACTORY.deploy (keccak256 (abi.encode ("StubAsset " )), vm. getCode ( " Redeployer.s.sol: StubAsset" ) );
87+ stubAsset = CREATE3_FACTORY.deploy (keccak256 (abi.encode ("StubAsset " )), type ( StubAsset).creationCode );
8988 }
9089 if (address (marketUSDC).code.length == 0 ) {
9190 marketUSDC = IMarket (
9291 CREATE3_FACTORY.deploy (
9392 keccak256 (abi.encode ("StubMarketUSDC " )),
94- abi.encodePacked (vm. getCode ( " Redeployer.s.sol: StubMarket" ) , abi.encode (stubAsset))
93+ abi.encodePacked (type ( StubMarket).creationCode , abi.encode (stubAsset))
9594 )
9695 );
9796 }
9897 if (address (marketWETH).code.length == 0 ) {
9998 marketWETH = IMarket (
10099 CREATE3_FACTORY.deploy (
101100 keccak256 (abi.encode ("StubMarketWETH " )),
102- abi.encodePacked (vm. getCode ( " Redeployer.s.sol: StubMarket" ) , abi.encode (stubAsset))
101+ abi.encodePacked (type ( StubMarket).creationCode , abi.encode (stubAsset))
103102 )
104103 );
105104 }
106105 }
107106 if (address (ownerPlugin).code.length == 0 ) {
108107 ownerPlugin = IPlugin (
109- CREATE3_FACTORY.deploy (
110- keccak256 (abi.encode ("WebauthnOwnerPlugin " )), vm.getCode ("WebauthnOwnerPlugin.sol:WebauthnOwnerPlugin " )
111- )
108+ CREATE3_FACTORY.deploy (keccak256 (abi.encode ("WebauthnOwnerPlugin " )), type (WebauthnOwnerPlugin).creationCode)
112109 );
113110 }
114111 address proposalManagerAddr = _broadcastOrCreate3 ("broadcast/ProposalManager " , "ProposalManager " );
115112 if (proposalManagerAddr.code.length == 0 ) {
116113 proposalManagerAddr = CREATE3_FACTORY.deploy (
117114 keccak256 (abi.encode ("ProposalManager " )),
118115 abi.encodePacked (
119- vm. getCode ( " ProposalManager.sol:ProposalManager " ) ,
116+ type ( ProposalManager).creationCode ,
120117 abi.encode (admin, auditor, IDebtManager (address (1 )), IInstallmentsRouter (address (1 )), admin, _allowlist (), 1 )
121118 )
122119 );
@@ -126,7 +123,7 @@ contract Redeployer is BaseScript {
126123 CREATE3_FACTORY.deploy (
127124 keccak256 (abi.encode ("ExaPlugin " )),
128125 abi.encodePacked (
129- vm. getCode ( " ExaPlugin.sol:ExaPlugin " ) ,
126+ type ( ExaPlugin).creationCode ,
130127 abi.encode (
131128 Parameters ({
132129 owner: admin,
@@ -155,8 +152,7 @@ contract Redeployer is BaseScript {
155152 payable (CREATE3_FACTORY.deploy (
156153 keccak256 (abi.encode ("ExaAccountFactory " )),
157154 abi.encodePacked (
158- vm.getCode ("ExaAccountFactory.sol:ExaAccountFactory " ),
159- abi.encode (admin, ownerPlugin, exaPlugin, ACCOUNT_IMPL, ENTRYPOINT)
155+ type (ExaAccountFactory).creationCode, abi.encode (admin, ownerPlugin, exaPlugin, ACCOUNT_IMPL, ENTRYPOINT)
160156 )
161157 ))
162158 );
@@ -196,14 +192,13 @@ contract Redeployer is BaseScript {
196192
197193 exa = EXA (CREATE3_FACTORY.getDeployed (admin, keccak256 (abi.encode ("EXA " ))));
198194 if (address (exa).code.length == 0 ) {
199- exa = EXA (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("EXA " )), vm. getCode ( " EXA.sol:EXA " ) ));
195+ exa = EXA (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("EXA " )), type ( EXA).creationCode ));
200196 }
201197
202198 address proxyTransferer = CREATE3_FACTORY.getDeployed (admin, keccak256 (abi.encode ("ProxyTransferer " )));
203199 if (proxyTransferer.code.length == 0 ) {
204- proxyTransferer = CREATE3_FACTORY.deploy (
205- keccak256 (abi.encode ("ProxyTransferer " )), vm.getCode ("Redeployer.s.sol:ProxyTransferer " )
206- );
200+ proxyTransferer =
201+ CREATE3_FACTORY.deploy (keccak256 (abi.encode ("ProxyTransferer " )), type (ProxyTransferer).creationCode);
207202 }
208203
209204 proxyAdmin.upgradeAndCall (ITransparentUpgradeableProxy (proxy), address (exa), abi.encodeCall (EXA.initialize, ()));
@@ -227,7 +222,7 @@ contract Redeployer is BaseScript {
227222 exa = EXA (CREATE3_FACTORY.getDeployed (admin, keccak256 (abi.encode ("EXA " ))));
228223 if (address (exa).code.length != 0 ) return ;
229224 vm.broadcast (admin);
230- exa = EXA (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("EXA " )), vm. getCode ( " EXA.sol:EXA " ) ));
225+ exa = EXA (CREATE3_FACTORY.deploy (keccak256 (abi.encode ("EXA " )), type ( EXA).creationCode ));
231226 }
232227
233228 /// @notice Upgrades a proxy to the cached ExaAccountFactory implementation.
@@ -251,8 +246,7 @@ contract Redeployer is BaseScript {
251246 payable (CREATE3_FACTORY.deploy (
252247 salt,
253248 abi.encodePacked (
254- vm.getCode ("ExaAccountFactory.sol:ExaAccountFactory " ),
255- abi.encode (admin, ownerPlugin, exaPlugin, ACCOUNT_IMPL, ENTRYPOINT)
249+ type (ExaAccountFactory).creationCode, abi.encode (admin, ownerPlugin, exaPlugin, ACCOUNT_IMPL, ENTRYPOINT)
256250 )
257251 ))
258252 );
0 commit comments