-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/update deployment logic using factory #52
Changes from 14 commits
0177f5e
68c5399
e50c303
6ea336e
39b43a0
7427a96
7b0235f
2769102
2fb6e3e
68119bc
9f6b16d
e7255a3
fd6b30f
cc8e115
e2640ec
564bb55
a36cf98
6857cfa
5a0c283
e0e1b53
39905c2
3a61642
618ed4f
14f0626
0069604
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,3 +82,4 @@ book | |
|
||
# For zksync | ||
zkout | ||
.cache |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// // SPDX-License-Identifier: UNLICENSED | ||
// pragma solidity ^0.8.13; | ||
|
||
// import "forge-std/Script.sol"; | ||
|
||
// import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
// import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
// import "../src/EmailAuth.sol"; | ||
// import {ZKSyncCreate2Factory} from "../src/utils/ZKSyncCreate2Factory.sol"; | ||
|
||
// contract Deploy is Script { | ||
// using ECDSA for *; | ||
|
||
// function run() external { | ||
// uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
// if (deployerPrivateKey == 0) { | ||
// console.log("PRIVATE_KEY env var not set"); | ||
// return; | ||
// } | ||
|
||
// vm.startBroadcast(deployerPrivateKey); | ||
|
||
// EmailAuth emailAuth = new EmailAuth(); | ||
|
||
// address recoveredAccount = address(0x1); | ||
// bytes32 accountSalt = 0x0; | ||
|
||
// ERC1967Proxy proxy = new ERC1967Proxy( | ||
// address(emailAuth), | ||
// abi.encodeCall(emailAuth.initialize, (recoveredAccount, accountSalt, address(this))) | ||
// ); | ||
// console.log("normal deployed proxyAddress %s", address(proxy)); | ||
|
||
// ZKSyncCreate2Factory factory = new ZKSyncCreate2Factory(); | ||
// string memory artifact = vm.readFile("zkout/ERC1967Proxy.sol/ERC1967Proxy.json"); | ||
// bytes32 bytecodeHash = vm.parseJsonBytes32(artifact, ".hash"); | ||
// console.log("bytecodeHash"); | ||
// console.logBytes32(bytes32(bytecodeHash)); | ||
|
||
// bytes memory emailAuthInit = abi.encode( | ||
// address(emailAuth), abi.encodeCall(EmailAuth.initialize, (recoveredAccount, accountSalt, address(this))) | ||
// ); | ||
|
||
// address computedAddress = factory.computeAddress(accountSalt, bytecodeHash, emailAuthInit); | ||
// console.log("computedAddress", computedAddress); | ||
|
||
// (bool success, bytes memory returnData) = factory.deploy(accountSalt, bytecodeHash, emailAuthInit); | ||
|
||
// address payable proxyAddress = abi.decode(returnData, (address)); | ||
// console.log("proxyAddress %s", proxyAddress); | ||
|
||
// EmailAuth emailAuthProxy = EmailAuth(proxyAddress); | ||
// console.log("emailAuthProxy.controller() %s", emailAuthProxy.controller()); | ||
// vm.stopBroadcast(); | ||
// } | ||
// } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is fully commented out, please remove this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why I commented out is it needs for via-ir option when we compile contracts directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to avoid commenting out those zksync files by adding an option to the command of
yarn build
that excludes zksync files?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SoraSuegami Maybe we can use --skip flag, let me try it.