-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d88090
commit 52016c4
Showing
6 changed files
with
128 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
zkout/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@openzeppelin/=lib/openzeppelin-contracts/contracts/ | ||
@forge-std/=lib/forge-std/src/ | ||
@era-contracts/=lib/era-contracts/system-contracts/contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import "forge-std/Script.sol"; | ||
import "@era-contracts/libraries/SystemContractsCaller.sol"; | ||
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
import "../src/AAFactory.sol"; | ||
import "../src/TwoUserMultisig.sol"; | ||
|
||
contract DeployMultisig is Script { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
|
||
// Owners for the multisig account | ||
// Can be random | ||
address owner1 = vm.envAddress("OWNER_1"); | ||
address owner2 = vm.envAddress("OWNER_2"); | ||
|
||
// Read artifact file and get the bytecode hash | ||
string memory artifact = vm.readFile( | ||
"zkout/TwoUserMultisig.sol/TwoUserMultisig.json" | ||
); | ||
bytes32 bytecodeHash = vm.parseJsonBytes32(artifact, ".hash"); | ||
bytes32 salt = bytes32( | ||
uint256( | ||
uint160(address(0x0000000000000000000000000000000000000001)) | ||
) | ||
); | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
AAFactory factory = new AAFactory(bytecodeHash); | ||
|
||
address multisig = factory.deployAccount(salt, owner1, owner2); | ||
|
||
console.log("Multisig deployed at: ", multisig); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters