Skip to content

Commit

Permalink
🚀 add DeployOptimismSepolia func
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders committed Feb 7, 2024
1 parent d15e106 commit 93d775d
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ import {
OPTIMISM_GOERLI_UNISWAP_UNIVERSAL_ROUTER,
OPTIMISM_GOERLI_UNISWAP_PERMIT2
} from "script/utils/parameters/OptimismGoerliParameters.sol";
import {
OPTIMISM_SEPOLIA_DEPLOYER,
OPTIMISM_SEPOLIA_PDAO,
OPTIMISM_SEPOLIA_SYNTHETIX_ADDRESS_RESOLVER,
OPTIMISM_SEPOLIA_GELATO,
OPTIMISM_SEPOLIA_OPS,
OPTIMISM_SEPOLIA_UNISWAP_UNIVERSAL_ROUTER,
OPTIMISM_SEPOLIA_UNISWAP_PERMIT2
} from "script/utils/parameters/OptimismSepoliaParameters.sol";

/// @title Script to deploy Kwenta's Smart Margin Account Factory
/// @author JaredBorders ([email protected])
Expand Down Expand Up @@ -61,19 +70,13 @@ contract Setup {
_deployer == address(0) ? address(this) : _deployer;

// deploy the factory
factory = new Factory({
_owner: temporaryOwner
});
factory = new Factory({_owner: temporaryOwner});

// deploy the events contract and set the factory
events = new Events({
_factory: address(factory)
});
events = new Events({_factory: address(factory)});

// deploy the settings contract
settings = new Settings({
_owner: _owner
});
settings = new Settings({_owner: _owner});

// resolve necessary addresses via the Synthetix Address Resolver
addressResolver = IAddressResolver(_addressResolver);
Expand Down Expand Up @@ -152,3 +155,25 @@ contract DeployOptimismGoerli is Script, Setup {
vm.stopBroadcast();
}
}

/// @dev steps to deploy and verify on Optimism Sepolia:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployOptimismSepolia --rpc-url $ARCHIVE_NODE_URL_SEPOLIA_L2 --broadcast --verify -vvvv`
contract DeployOptimismSepolia is Script, Setup {
function run() public {
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);

Setup.deploySystem({
_deployer: OPTIMISM_SEPOLIA_DEPLOYER,
_owner: OPTIMISM_SEPOLIA_PDAO,
_addressResolver: OPTIMISM_SEPOLIA_SYNTHETIX_ADDRESS_RESOLVER,
_gelato: OPTIMISM_SEPOLIA_GELATO,
_ops: OPTIMISM_SEPOLIA_OPS,
_universalRouter: OPTIMISM_SEPOLIA_UNISWAP_UNIVERSAL_ROUTER,
_permit2: OPTIMISM_SEPOLIA_UNISWAP_PERMIT2
});

vm.stopBroadcast();
}
}

0 comments on commit 93d775d

Please sign in to comment.