Skip to content

Commit

Permalink
feat: add deployment script for exocore multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
adu-web3 committed Sep 9, 2024
1 parent ff5831d commit 3fa4c85
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 14 deletions.
43 changes: 29 additions & 14 deletions script/15_DeploySafeMulstisigWallet.s.sol
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import {BaseScript} from "./BaseScript.sol";
import "@safe-contracts/proxies/GnosisSafeProxyFactory.sol";
import "@safe-contracts/GnosisSafe.sol";
import "@safe-contracts/GnosisSafeL2.sol";
import "forge-std/StdJson.sol";
import "forge-std/Script.sol";

contract CreateMultisigScript is Script {
function setUp() public {}
contract CreateMultisigScript is BaseScript {
using stdJson for string;

function setUp() public override {
super.setUp();

exocore = vm.createSelectFork(exocoreRPCURL);
_topUpPlayer(exocore, address(0), exocoreGenesis, deployer.addr, 2 ether);
}

function run() public {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
vm.selectFork(exocore);
vm.startBroadcast(deployer.privateKey);

// Read deployed Safe contracts from JSON file
string memory json = vm.readFile("script/safe_contracts_on_exocore.json");

address proxyFactoryAddress = json.readAddress(".GnosisSafeProxyFactory");
address safeSingletonAddress = json.readAddress(".GnosisSafeL2");
address fallbackHandlerAddress = json.readAddress(".CompatibilityFallbackHandler");

// Load deployed contract addresses
GnosisSafeProxyFactory proxyFactory = GnosisSafeProxyFactory(0xd92Eb22d59D2736C12ef8e009833b98dB812BC5F);
GnosisSafe safeSingleton = GnosisSafe(payable(0xE28848a95D96dFc200A48f976b32B726253a8e14));
GnosisSafeProxyFactory proxyFactory = GnosisSafeProxyFactory(proxyFactoryAddress);
GnosisSafeL2 safeSingleton = GnosisSafeL2(payable(safeSingletonAddress));

// Set up owners (replace with actual addresses)
// Set up owners
address[] memory owners = new address[](3);
owners[0] = address(0x1111111111111111111111111111111111111111);
owners[1] = address(0x2222222222222222222222222222222222222222);
owners[2] = address(0x3333333333333333333333333333333333333333);
owners[0] = deployer.addr;
owners[1] = exocoreValidatorSet.addr;
owners[2] = relayer.addr;

// Set up Safe parameters
uint256 threshold = 2;
address to = address(0);
bytes memory data = "";
address fallbackHandler = 0x820ed29524601172Fe4aec900Bc48432067CBCDF; // CompatibilityFallbackHandler
address fallbackHandler = fallbackHandlerAddress;
address paymentToken = address(0);
uint256 payment = 0;
address payable paymentReceiver = payable(address(0));
Expand Down
18 changes: 18 additions & 0 deletions script/deployedMultisigWallets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"holesky": {
"multisig": "0x9A7b23a0BB29F77BaBB8add484b34c02EfD327BE",
"signers": [
"0x481E020DB4709e6EdDbf8134D41b866c6Fc8555e",
"0x3583fF95f96b356d716881C871aF7Eb55ea34a93",
"0xA1dfab3234f49e02e04E6C56a021F1a497CD0f82"
]
},
"exocore": {
"multisig": "0xF27865277D8Cc608F279B3C09719A9Ceaa25A58f",
"signers": [
"0x481E020DB4709e6EdDbf8134D41b866c6Fc8555e",
"0x3583fF95f96b356d716881C871aF7Eb55ea34a93",
"0xA1dfab3234f49e02e04E6C56a021F1a497CD0f82"
]
}
}

0 comments on commit 3fa4c85

Please sign in to comment.