Skip to content

Commit c765ef2

Browse files
committed
add deployRollupSafeInstance function
1 parent d8a6deb commit c765ef2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

script/DeployGnosisSafe.s.sol

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,26 @@ contract GnosisScript is Script {
7272
function addressToBytes32(address addr) internal pure returns (bytes32) {
7373
return bytes32(uint256(uint160(addr)));
7474
}
75+
76+
// deploy a safe instance to the rollup with the given owners, threshold, and saltnonce.
77+
// populates the address of the gnosis factory, singleton, and fallback handler.
78+
function deployRollupSafeInstance(address[] memory owners, uint256 threshold, uint256 saltNonce) public {
79+
address factory = 0x8ff5C1D5233CA055cD536b2b87294d17f9160801;
80+
address singleton = 0x2f2965efaCFc64Fb85dF1902260eB25C0c996195;
81+
address fallbackHandler = 0xe59838EB7f251489b50940BD640326215420B936;
82+
83+
SafeSetup memory setup = SafeSetup({
84+
owners: owners,
85+
threshold: threshold,
86+
to: address(0),
87+
data: "",
88+
fallbackHandler: fallbackHandler,
89+
paymentToken: address(0),
90+
payment: 0,
91+
paymentReceiver: payable(address(0)),
92+
saltNonce: saltNonce
93+
});
94+
95+
deploySafeInstance(factory, singleton, setup);
96+
}
7597
}

0 commit comments

Comments
 (0)