@@ -28,7 +28,6 @@ interface ZksyncCreate2Factory {
2828contract Deploy is Script {
2929 address immutable firstOwner = 0x6Ed7D526b020780f694f3c10Dfb25E1b134D3215 ;
3030
31- // ZksyncCreate2Factory immutable zksyncCreateFactory = ZksyncCreate2Factory(0x0000000000000000000000000000000000010000);
3231 Create2Factory immutable zksyncCreateFactory = Create2Factory (0x0000000000000000000000000000000000010000 );
3332 ZksyncCreate2Factory immutable zksyncContractDeployer = ZksyncCreate2Factory (0x0000000000000000000000000000000000008006 );
3433
@@ -38,55 +37,51 @@ contract Deploy is Script {
3837 // bytes32 registrySalt = 0x00000000000000000000000000000000000000002bbc593dd77cb93fbb932d5f;
3938
4039 bytes32 zkSinglesigSalt = 0x000000000000000000000000000000000000000091430a7ea982667861000090 ;
41- // bytes32 registrySalt = bytes32(0);
42- bytes32 registrySalt = 0x0000000000000000000000000000000000000000dc73d3e78582b023010000a0 ;
40+ bytes32 zkRegistrySalt = 0x000000000000000000000000000000000000000077151a04325c7971a80c00a0 ;
4341
4442 // bytes initCode = abi.encodePacked(type(Singlesig).creationCode, abi.encode(address(0x6Ed7D526b020780f694f3c10Dfb25E1b134D3215)));
4543 // bytes32 salt = 0x000000000000000000000000000000000000000016c7768a8c7a2824b846321d;
4644
4745 function run () external {
4846 vm.startBroadcast ();
4947
50- Singlesig predeploySinglesig = new Singlesig {salt: zkSinglesigSalt}(firstOwner);
51- bytes32 singlesigZKBytecodeHash = ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT.getRawCodeHash (address (predeploySinglesig));
52- bytes32 constructorHash = keccak256 (abi.encode (firstOwner));
53- console2.log (address (predeploySinglesig));
54- console2.logBytes (abi.encode (firstOwner));
55- console2.logBytes32 (singlesigZKBytecodeHash);
56- console2.logBytes32 (constructorHash);
57- bytes memory preimage = bytes .concat (CREATE2_PREFIX, bytes32 (uint256 (uint160 (address (zksyncCreateFactory)))), zkSinglesigSalt, singlesigZKBytecodeHash, constructorHash);
58- console2.logBytes (preimage);
48+ // Singlesig predeploySinglesig = new Singlesig{salt: zkSinglesigSalt}(firstOwner);
49+ // bytes32 singlesigZKBytecodeHash = ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT.getRawCodeHash(address(predeploySinglesig));
50+ // bytes32 constructorHash = keccak256(abi.encode(firstOwner));
51+ // console2.log(address(predeploySinglesig));
52+ // console2.logBytes(abi.encode(firstOwner));
53+ // console2.logBytes32(singlesigZKBytecodeHash);
54+ // console2.logBytes32(constructorHash);
55+ // bytes memory preimage = bytes.concat(CREATE2_PREFIX, bytes32(uint256(uint160(address(zksyncCreateFactory)))), zkSinglesigSalt, singlesigZKBytecodeHash, constructorHash);
56+ // console2.logBytes(preimage);
5957
60- // address singlesigAddress = factory.safeCreate2(singlesigSalt, initCode);
61- // Singlesig singlesig = Singlesig(payable(singlesigAddress));
62- // console2.log(address(singlesig));
58+ // --------
6359
6460 // DelegateRegistry existing = DelegateRegistry(0x6b176c958fb89Ddca0fc8214150DA4c4D0a32fbe);
6561 // bytes32[] memory hashes = existing.getOutgoingDelegationHashes(0x86362a4C99d900D72d787Ef1BddA38Fd318aa5E9);
6662 // console2.logBytes32(hashes[0]);
6763
68- // DelegateRegistry saltDeploy = new DelegateRegistry{salt: registrySalt }();
69- // console2.logBytes32(keccak256(""));
70- // console2.log(address(saltDeploy));
64+ DelegateRegistry saltDeploy = new DelegateRegistry {salt: zkRegistrySalt }();
65+ console2.logBytes32 (keccak256 ("" ));
66+ console2.log (address (saltDeploy));
7167
7268 // DelegateRegistry predeploy = new DelegateRegistry();
7369
7470 // bytes32 bytecodeHash = keccak256(initCode);
75- // bytes32 zkBytecodeHash = ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT.getRawCodeHash(address(predeploy ));
71+ bytes32 zkBytecodeHash = ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT.getRawCodeHash (address (saltDeploy ));
7672
7773 // console2.logBytes32(bytecodeHash);
78- // console2.logBytes32(zkBytecodeHash);
79- // console2.log(address(predeploy));
80- // console2.log(msg.sender);
81- // console2.logBytes32(registrySalt);
82- // bytes memory preimage = bytes.concat(CREATE2_PREFIX, bytes32(uint256(uint160(address(zksyncCreateFactory)))), registrySalt, zkBytecodeHash, keccak256(""));
83- // console2.logBytes(preimage);
84- // address localRegistryAddress = address(uint160(uint256(keccak256(
85- // bytes.concat(CREATE2_PREFIX, bytes32(uint256(uint160(address(zksyncCreateFactory)))), registrySalt, zkBytecodeHash, keccak256(""))
86- // ))));
87- // console2.log(localRegistryAddress);
88- // address registryAddress = zksyncContractDeployer.getNewAddressCreate2(address(zksyncCreateFactory), zkBytecodeHash, registrySalt, "");
89- // console2.log(registryAddress);
74+ console2.logBytes32 (zkBytecodeHash);
75+ console2.log (msg .sender );
76+ console2.logBytes32 (zkRegistrySalt);
77+ bytes memory preimage = bytes .concat (CREATE2_PREFIX, bytes32 (uint256 (uint160 (address (zksyncCreateFactory)))), zkRegistrySalt, zkBytecodeHash, keccak256 ("" ));
78+ console2.logBytes (preimage);
79+ address localRegistryAddress = address (uint160 (uint256 (keccak256 (
80+ bytes .concat (CREATE2_PREFIX, bytes32 (uint256 (uint160 (address (zksyncCreateFactory)))), zkRegistrySalt, zkBytecodeHash, keccak256 ("" ))
81+ ))));
82+ console2.log (localRegistryAddress);
83+ address registryAddress = zksyncContractDeployer.getNewAddressCreate2 (address (zksyncCreateFactory), zkBytecodeHash, zkRegistrySalt, "" );
84+ console2.log (registryAddress);
9085
9186 // zksyncCreateFactory.create2(registrySalt, zkBytecodeHash, "");
9287
0 commit comments