From de2ea188beca730814f471981dd6b703a5f81e0c Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Mon, 13 Nov 2023 16:56:44 +0000 Subject: [PATCH 01/11] =?UTF-8?q?=F0=9F=92=BF=20Add=20BaseGoerliKwentaFork?= =?UTF-8?q?Parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameters/BaseGoerliKwentaForkParameters.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 script/utils/parameters/BaseGoerliKwentaForkParameters.sol diff --git a/script/utils/parameters/BaseGoerliKwentaForkParameters.sol b/script/utils/parameters/BaseGoerliKwentaForkParameters.sol new file mode 100644 index 00000000..b6fb8170 --- /dev/null +++ b/script/utils/parameters/BaseGoerliKwentaForkParameters.sol @@ -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; +} From 7a9b1e477762673b5f67624ca7a97b68d3424719 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Mon, 13 Nov 2023 16:56:53 +0000 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=9A=80=20Add=20DeployBaseKwentaFork?= =?UTF-8?q?Goerli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index b4b331c2..942100e9 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -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"; @@ -83,6 +85,25 @@ contract DeployBaseGoerli is Setup, BaseGoerliParameters { } } +/// @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:DeployBaseKwentaForkGoerli --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` +contract DeployBaseKwentaForkGoerli is Setup, BaseGoerliKwentaForkParameters { + 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 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` From 4435f95bc089efcd0c4c8ba764637cbaa87ab7dc Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Mon, 13 Nov 2023 16:59:17 +0000 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=92=BF=20BaseGoerliKwentaFork.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerliKwentaFork.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 deployments/BaseGoerliKwentaFork.json diff --git a/deployments/BaseGoerliKwentaFork.json b/deployments/BaseGoerliKwentaFork.json new file mode 100644 index 00000000..c468770e --- /dev/null +++ b/deployments/BaseGoerliKwentaFork.json @@ -0,0 +1,4 @@ +{ + "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", + "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" +} \ No newline at end of file From 68434e42ced3e514e276331590a814bacd5aabc4 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Mon, 13 Nov 2023 17:02:35 +0000 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=A7=B9=20Add=20newline=20to=20BaseG?= =?UTF-8?q?oerliKwentaFork.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerliKwentaFork.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/BaseGoerliKwentaFork.json b/deployments/BaseGoerliKwentaFork.json index c468770e..4db82613 100644 --- a/deployments/BaseGoerliKwentaFork.json +++ b/deployments/BaseGoerliKwentaFork.json @@ -1,4 +1,4 @@ { "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" -} \ No newline at end of file +} From f8c4aca441245d7fa9795898bd0be221cfc8a7c3 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Mon, 13 Nov 2023 17:03:17 +0000 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=93=9A=20Update=20DeployBaseKwentaF?= =?UTF-8?q?orkGoerli=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 942100e9..4a0c55aa 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -85,7 +85,7 @@ contract DeployBaseGoerli is Setup, BaseGoerliParameters { } } -/// @dev steps to deploy and verify on Base Goerli: +/// @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:DeployBaseKwentaForkGoerli --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` contract DeployBaseKwentaForkGoerli is Setup, BaseGoerliKwentaForkParameters { From ee737dbb0693182282f91001e3589e1a38dec486 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 19:55:49 +0000 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=9A=80=20=F0=9F=A7=B9=20Follow=20?= =?UTF-8?q?=5FSynthetix=20pattern=20for=20Deploy=20contracts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 4a0c55aa..68bef0d9 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -49,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); @@ -68,8 +68,8 @@ 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); @@ -88,7 +88,7 @@ contract DeployBaseGoerli is Setup, BaseGoerliParameters { /// @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:DeployBaseKwentaForkGoerli --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` -contract DeployBaseKwentaForkGoerli is Setup, BaseGoerliKwentaForkParameters { +contract DeployBaseGoerli_KwentaFork is Setup, BaseGoerliKwentaForkParameters { function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey); @@ -106,8 +106,8 @@ contract DeployBaseKwentaForkGoerli is Setup, BaseGoerliKwentaForkParameters { /// @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); @@ -125,8 +125,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); From 37940e6cab51840113735b033cff3dd506216b40 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 19:57:14 +0000 Subject: [PATCH 07/11] =?UTF-8?q?=F0=9F=92=BF=20=F0=9F=A7=B9=20Move=20Kwen?= =?UTF-8?q?taFork=20addresses=20into=20BaseGoerli.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerli.json | 10 ++++++++-- deployments/BaseGoerliKwentaFork.json | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 deployments/BaseGoerliKwentaFork.json diff --git a/deployments/BaseGoerli.json b/deployments/BaseGoerli.json index dbe2347c..e3fee8e5 100644 --- a/deployments/BaseGoerli.json +++ b/deployments/BaseGoerli.json @@ -1,4 +1,10 @@ { - "Engine": "0x13eBcd3aD7B4Aa0595Fe57085C62c4f9CaDdB000", - "TrustedMulticallForwarder": "0x5c8bAfBEA063D2E99325bD3FEdb678a1bEf42FDb" + "Synthetix": { + "Engine": "0x13eBcd3aD7B4Aa0595Fe57085C62c4f9CaDdB000", + "TrustedMulticallForwarder": "0x5c8bAfBEA063D2E99325bD3FEdb678a1bEf42FDb" + }, + "KwentaFork": { + "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", + "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" + } } \ No newline at end of file diff --git a/deployments/BaseGoerliKwentaFork.json b/deployments/BaseGoerliKwentaFork.json deleted file mode 100644 index 4db82613..00000000 --- a/deployments/BaseGoerliKwentaFork.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", - "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" -} From d8f43db922e891ca6fa4f45eedffd4deb19a8bb9 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 19:58:23 +0000 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=A7=B9=20Add=20newline=20to=20BaseG?= =?UTF-8?q?oerli.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerli.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/BaseGoerli.json b/deployments/BaseGoerli.json index e3fee8e5..10d5c0d9 100644 --- a/deployments/BaseGoerli.json +++ b/deployments/BaseGoerli.json @@ -7,4 +7,4 @@ "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" } -} \ No newline at end of file +} From 9a908f34ced47ddcf3c0b5045cafe8bb6c7af204 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 19:59:28 +0000 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=93=9A=20=F0=9F=94=A7=20Fix=20Deplo?= =?UTF-8?q?yBaseGoerli=5FKwentaFork=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 68bef0d9..db8f4b97 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -87,7 +87,7 @@ contract DeployBaseGoerli_Synthetix is Setup, BaseGoerliParameters { /// @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:DeployBaseKwentaForkGoerli --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` +/// (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"); From 921bc6b829ec330df5681972d80db42aac2546a9 Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 20:02:28 +0000 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=92=BF=20Rename=20BaseGoerli.json?= =?UTF-8?q?=20KwentaFork=20to=20Kwenta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerli.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/BaseGoerli.json b/deployments/BaseGoerli.json index 10d5c0d9..2f10fd28 100644 --- a/deployments/BaseGoerli.json +++ b/deployments/BaseGoerli.json @@ -3,7 +3,7 @@ "Engine": "0x13eBcd3aD7B4Aa0595Fe57085C62c4f9CaDdB000", "TrustedMulticallForwarder": "0x5c8bAfBEA063D2E99325bD3FEdb678a1bEf42FDb" }, - "KwentaFork": { + "Kwenta": { "Engine": "0xa55a8d00a05145185dbd11a94321b67eb478e164", "TrustedMulticallForwarder": "0xab3d53e788c64c074b4efd7fce993b598e51660a" } From af2ee245f510c088afbc6ef8927a285cfb7dffad Mon Sep 17 00:00:00 2001 From: tommyrharper Date: Tue, 14 Nov 2023 20:03:25 +0000 Subject: [PATCH 11/11] =?UTF-8?q?=E2=9C=A8=20Format=20Deploy.s.sol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index db8f4b97..dfe7f372 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -69,7 +69,7 @@ contract DeployBase_Synthetix 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_Synthetix --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` -contract DeployBaseGoerli_Synthetix is Setup, BaseGoerliParameters { +contract DeployBaseGoerli_Synthetix is Setup, BaseGoerliParameters { function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey); @@ -88,7 +88,10 @@ contract DeployBaseGoerli_Synthetix is Setup, BaseGoerliParameters { /// @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 { +contract DeployBaseGoerli_KwentaFork is + Setup, + BaseGoerliKwentaForkParameters +{ function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey);