Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions script/DeployGnosisSafe.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,19 @@ struct SafeSetup {
uint256 saltNonce;
}

address constant OWNER_ONE = 0x1111111111111111111111111111111111111111;
address constant OWNER_TWO = 0x2222222222222222222222222222222222222222;
bytes32 constant SENTINEL_VALUE = 0x0000000000000000000000000000000000000000000000000000000000000001;

contract GnosisScript is Script {
// deploy:
// forge script GnosisScript --sig "deployGnosis()" --rpc-url $RPC_URL --broadcast [signing args]
function deployGnosis()
public
returns (address gnosisFactory, address gnosisSingleton, address gnosisFallbackHandler, address usdcAdmin)
returns (address gnosisFactory, address gnosisSingleton, address gnosisFallbackHandler)
{
vm.startBroadcast();

// deploy gnosis safe singleton & proxy factory
(gnosisFactory, gnosisSingleton, gnosisFallbackHandler) = deployGnosisCore();

// deploy a gnosis safe proxy as the USDC admin
usdcAdmin = deploySafeInstance(gnosisFactory, gnosisSingleton, getUsdcAdminSetup(gnosisFallbackHandler));
}

function deployGnosisCore() public returns (address factory, address singleton, address fallbackHandler) {
Expand All @@ -64,25 +59,6 @@ contract GnosisScript is Script {
safe = address(SafeProxyFactory(factory).createProxyWithNonce(singleton, init, setup.saltNonce));
}

// setup the gnosis safe with 2 owners, threshold of 1.
// make the owners recognizable addrs to aid in inspecting storage layout
function getUsdcAdminSetup(address fallbackHandler) public pure returns (SafeSetup memory usdcAdminSetup) {
address[] memory owners = new address[](2);
owners[0] = OWNER_ONE;
owners[1] = OWNER_TWO;
usdcAdminSetup = SafeSetup({
owners: owners,
threshold: 1,
to: address(0),
data: "",
fallbackHandler: fallbackHandler,
paymentToken: address(0),
payment: 0,
paymentReceiver: payable(address(0)),
saltNonce: 17001
});
}

// example run:
// forge script GnosisScript --sig "printOwnerSlots" "[0x1111111111111111111111111111111111111111, 0x2222222222222222222222222222222222222222]"
function printOwnerSlots(address[] memory owners) public pure {
Expand Down
2 changes: 1 addition & 1 deletion script/ZenithL2.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract L2Script is Script {

// deploy simple erc20 tokens
wbtc = address(new SimpleERC20{salt: "zenith.wbtc"}(MINTER, "Wrapped BTC", "WBTC", 8));
usdt = address(new SimpleERC20{salt: "zenith.usdt"}(MINTER, "Tether USD", "USDT", 6));
usdt = address(new SimpleERC20{salt: "zenith.weth"}(MINTER, "Wrapped Ether", "WETH", 18));
}
}

Expand Down