Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Kwenta/smart-margin-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders committed Nov 15, 2023
2 parents 2dc0522 + 36b67ac commit 1cf7c9f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
6 changes: 3 additions & 3 deletions deployments/BaseGoerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"TrustedMulticallForwarder": "0xB502070B4EC27d6809A32fd15D0F635b2F20d595"
},
"Kwenta": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164",
"TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a"
}
}
}
40 changes: 32 additions & 8 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {BaseGoerliParameters} from
import {BaseParameters} from "script/utils/parameters/BaseParameters.sol";
import {OptimismGoerliParameters} from
"script/utils/parameters/OptimismGoerliParameters.sol";
import {BaseGoerliKwentaForkParameters} from
"script/utils/parameters/BaseGoerliKwentaForkParameters.sol";
import {OptimismParameters} from
"script/utils/parameters/OptimismParameters.sol";

Expand Down Expand Up @@ -47,8 +49,8 @@ contract Setup is Script {

/// @dev steps to deploy and verify on Base:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployBase --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv`
contract DeployBase is Setup, BaseParameters {
/// (2) run `forge script script/Deploy.s.sol:DeployBase_Synthetix --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv`
contract DeployBase_Synthetix is Setup, BaseParameters {
function run() public {
uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);
Expand All @@ -66,8 +68,30 @@ contract DeployBase is Setup, BaseParameters {

/// @dev steps to deploy and verify on Base Goerli:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployBaseGoerli --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv`
contract DeployBaseGoerli is Setup, BaseGoerliParameters {
/// (2) run `forge script script/Deploy.s.sol:DeployBaseGoerli_Synthetix --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv`
contract DeployBaseGoerli_Synthetix is Setup, BaseGoerliParameters {
function run() public {
uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);

Setup.deploySystem({
perpsMarketProxy: PERPS_MARKET_PROXY,
spotMarketProxy: SPOT_MARKET_PROXY,
sUSDProxy: USD_PROXY,
oracle: PYTH
});

vm.stopBroadcast();
}
}

/// @dev steps to deploy and verify on Base Goerli for the Kwenta Synthetix V3 Fork:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployBaseGoerli_KwentaFork --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv`
contract DeployBaseGoerli_KwentaFork is
Setup,
BaseGoerliKwentaForkParameters
{
function run() public {
uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);
Expand Down Expand Up @@ -104,8 +128,8 @@ contract DeployBaseGoerli_Andromeda is Setup, BaseGoerliParameters {

/// @dev steps to deploy and verify on Optimism:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployOptimism --rpc-url $OPTIMISM_RPC_URL --etherscan-api-key $OPTIMISM_ETHERSCAN_API_KEY --broadcast --verify -vvvv`
contract DeployOptimism is Setup, OptimismParameters {
/// (2) run `forge script script/Deploy.s.sol:DeployOptimism_Synthetix --rpc-url $OPTIMISM_RPC_URL --etherscan-api-key $OPTIMISM_ETHERSCAN_API_KEY --broadcast --verify -vvvv`
contract DeployOptimism_Synthetix is Setup, OptimismParameters {
function run() public {
uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);
Expand All @@ -123,8 +147,8 @@ contract DeployOptimism is Setup, OptimismParameters {

/// @dev steps to deploy and verify on Optimism Goerli:
/// (1) load the variables in the .env file via `source .env`
/// (2) run `forge script script/Deploy.s.sol:DeployOptimismGoerli --rpc-url $OPTIMISM_GOERLI_RPC_URL --etherscan-api-key $OPTIMISM_ETHERSCAN_API_KEY --broadcast --verify -vvvv`
contract DeployOptimismGoerli is Setup, OptimismGoerliParameters {
/// (2) run `forge script script/Deploy.s.sol:DeployOptimismGoerli_Synthetix --rpc-url $OPTIMISM_GOERLI_RPC_URL --etherscan-api-key $OPTIMISM_ETHERSCAN_API_KEY --broadcast --verify -vvvv`
contract DeployOptimismGoerli_Synthetix is Setup, OptimismGoerliParameters {
function run() public {
uint256 privateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(privateKey);
Expand Down
15 changes: 15 additions & 0 deletions script/utils/parameters/BaseGoerliKwentaForkParameters.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.18;

contract BaseGoerliKwentaForkParameters {
address public constant PERPS_MARKET_PROXY =
0x5D48528E90EDEFA8cff2A23E1e3fda46Acef0E2d;

address public constant SPOT_MARKET_PROXY =
0xB462f8FC435fD78E16C0287fDBF706BcE87076be;

address public constant USD_PROXY =
0xD3bcDae94B0c2EF16d1c43d29c23b1735d864fC6;

address public constant PYTH = 0x5955C1478F0dAD753C7E2B4dD1b4bC530C64749f;
}

0 comments on commit 1cf7c9f

Please sign in to comment.