From d58f9aae6106ce3526221d1d5166a418191293a2 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 12:41:55 -0400 Subject: [PATCH 01/11] =?UTF-8?q?=F0=9F=93=9A=20adjust=20natspec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Engine.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Engine.sol b/src/Engine.sol index 572ee2df..a3831f8e 100644 --- a/src/Engine.sol +++ b/src/Engine.sol @@ -17,8 +17,7 @@ import {UUPSUpgradeable} from "lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol"; /// @title Kwenta Smart Margin v3: Engine contract -/// @notice Responsible for interacting with -/// Synthetix v3 perps markets +/// @notice Responsible for interacting with Synthetix v3 perps markets /// @author JaredBorders (jaredborders@pm.me) /// @author Flocqst (florian@kwenta.io) contract Engine is From 53547e5d386c05180e1e0283bab2e458b0037d08 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 12:42:09 -0400 Subject: [PATCH 02/11] =?UTF-8?q?=E2=9C=85=20improve=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Upgrade.t.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Upgrade.t.sol b/test/Upgrade.t.sol index 0bb24288..72ae583c 100644 --- a/test/Upgrade.t.sol +++ b/test/Upgrade.t.sol @@ -13,18 +13,21 @@ contract UpgradeTest is Bootstrap { } contract StorageLayout is UpgradeTest { + uint constant NONCE_BITMAP_SLOT = 19; + uint constant CREDIT_SLOT = 20; + function test_nonceBitmap_slot() public { uint256 slot = engineExposed.getNonceBitmapSlot(); // nonceBitmap storage slot should NEVER change - assertEq(slot, 19); + assertEq(slot, NONCE_BITMAP_SLOT); } function test_credit_slot() public { uint256 slot = engineExposed.getCreditSlot(); // credit storage slot should NEVER change - assertEq(slot, 20); + assertEq(slot, CREDIT_SLOT); } } @@ -146,9 +149,6 @@ contract MockUpgrade is UpgradeTest { } } -/// @custom:write-future-engine-upgrade-tests-here -contract UpgradeEngineV2 is UpgradeTest {} - contract RemoveUpgradability is UpgradeTest { function test_removeUpgradability() public { MockEngineUpgrade mockEngineUpgrade = new MockEngineUpgrade( From 52e9690ec4800e414061ff44b2852f827208d158 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 12:42:35 -0400 Subject: [PATCH 03/11] =?UTF-8?q?=E2=9C=A8=20prettify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Upgrade.t.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Upgrade.t.sol b/test/Upgrade.t.sol index 72ae583c..8109f955 100644 --- a/test/Upgrade.t.sol +++ b/test/Upgrade.t.sol @@ -13,8 +13,8 @@ contract UpgradeTest is Bootstrap { } contract StorageLayout is UpgradeTest { - uint constant NONCE_BITMAP_SLOT = 19; - uint constant CREDIT_SLOT = 20; + uint256 constant NONCE_BITMAP_SLOT = 19; + uint256 constant CREDIT_SLOT = 20; function test_nonceBitmap_slot() public { uint256 slot = engineExposed.getNonceBitmapSlot(); From 2452e29b6c1f866a1cb40b0e400fefecd4fec10c Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 13:14:20 -0400 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=9A=80=20deploy=20mainnet=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/Base.json | 10 +++------- deployments/BaseGoerli.json | 14 -------------- deployments/BaseSepolia.json | 8 ++------ deployments/Optimism.json | 6 +----- deployments/OptimismGoerli.json | 6 +----- 5 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 deployments/BaseGoerli.json diff --git a/deployments/Base.json b/deployments/Base.json index 20c152bf..4419fa8a 100644 --- a/deployments/Base.json +++ b/deployments/Base.json @@ -1,14 +1,10 @@ { - "Synthetix": { - "EngineImplementation": "", - "EngineProxy": "" - }, "Andromeda": { "EngineImplementation": "0xD1F129e0cDd3Cc5c65ea00041623841C3d709F83", "EngineProxy": "0xe331a7eeC851Ba702aA8BF43070a178451d6D28E" }, - "Kwenta": { - "EngineImplementation": "", - "EngineProxy": "" + "test": { + "EngineImplementation": "0x3eF73cD1B3B708ab1F2ccB4AcDA036Ac3FDc3615", + "EngineProxy": "0xA2dF816B2C5D8d799069d6a8a9f8464D402b5D25" } } \ No newline at end of file diff --git a/deployments/BaseGoerli.json b/deployments/BaseGoerli.json deleted file mode 100644 index 49a55e11..00000000 --- a/deployments/BaseGoerli.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Synthetix": { - "EngineImplementation": "", - "EngineProxy": "" - }, - "Andromeda": { - "EngineImplementation": "0x15725a8159629ca9763deC4211e309c94d9f5CB0", - "EngineProxy": "0xb2a20fCdc506a685122847b21E34536359E94C56" - }, - "Kwenta": { - "EngineImplementation": "", - "EngineProxy": "" - } -} diff --git a/deployments/BaseSepolia.json b/deployments/BaseSepolia.json index 31979363..0a7db8a1 100644 --- a/deployments/BaseSepolia.json +++ b/deployments/BaseSepolia.json @@ -1,14 +1,10 @@ { - "Synthetix": { - "EngineImplementation": "", - "EngineProxy": "" - }, "Andromeda": { "EngineImplementation": "0x33B725a1B2dE9178121D423D2A1c062C5452f310", "EngineProxy": "0xe5bB889B1f0B6B4B7384Bd19cbb37adBDDa941a6" }, - "Kwenta": { + "test": { "EngineImplementation": "", "EngineProxy": "" } -} +} \ No newline at end of file diff --git a/deployments/Optimism.json b/deployments/Optimism.json index 80524e9d..920ecb84 100644 --- a/deployments/Optimism.json +++ b/deployments/Optimism.json @@ -1,13 +1,9 @@ { - "Synthetix": { - "EngineImplementation": "", - "EngineProxy": "" - }, "Andromeda": { "EngineImplementation": "", "EngineProxy": "" }, - "Kwenta": { + "test": { "EngineImplementation": "", "EngineProxy": "" } diff --git a/deployments/OptimismGoerli.json b/deployments/OptimismGoerli.json index 80524e9d..920ecb84 100644 --- a/deployments/OptimismGoerli.json +++ b/deployments/OptimismGoerli.json @@ -1,13 +1,9 @@ { - "Synthetix": { - "EngineImplementation": "", - "EngineProxy": "" - }, "Andromeda": { "EngineImplementation": "", "EngineProxy": "" }, - "Kwenta": { + "test": { "EngineImplementation": "", "EngineProxy": "" } From f4b23efd08070511863b0ba5a024685433f940b3 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 13:14:41 -0400 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=9A=80=20update=20upgrade=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Upgrade.s.sol | 107 +++---------------------------------------- 1 file changed, 7 insertions(+), 100 deletions(-) diff --git a/script/Upgrade.s.sol b/script/Upgrade.s.sol index bd1206d2..3698ce1c 100644 --- a/script/Upgrade.s.sol +++ b/script/Upgrade.s.sol @@ -5,15 +5,9 @@ pragma solidity 0.8.20; import {Engine} from "src/Engine.sol"; // parameters -import {BaseGoerliParameters} from - "script/utils/parameters/BaseGoerliParameters.sol"; +import {BaseSepoliaParameters} from + "script/utils/parameters/BaseSepoliaParameters.sol"; 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"; // forge utils import {Script} from "lib/forge-std/src/Script.sol"; @@ -43,8 +37,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/Upgrade.s.sol:DeployBase_Synthetix --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` -contract DeployBase_Synthetix is Setup, BaseParameters { +/// (2) run `forge script script/Upgrade.s.sol:DeployBase_Andromeda --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` +contract DeployBase_Andromeda is Setup, BaseParameters { function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey); @@ -62,97 +56,10 @@ 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/Upgrade.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.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - 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/Upgrade.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); - - Setup.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - -/// @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/Upgrade.s.sol:DeployBaseGoerli_Andromeda --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` -contract DeployBaseGoerli_Andromeda is Setup, BaseGoerliParameters { - function run() public { - uint256 privateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(privateKey); - - Setup.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, - spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, - sUSDProxy: USD_PROXY_ANDROMEDA, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - 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/Upgrade.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); - - Setup.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - -/// @dev steps to deploy and verify on Optimism Goerli: +/// @dev steps to deploy and verify on Base: /// (1) load the variables in the .env file via `source .env` -/// (2) run `forge script script/Upgrade.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 { +/// (2) run `forge script script/Upgrade.s.sol:DeployBaseSepolia_Andromeda --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` +contract DeployBaseSepolia_Andromeda is Setup, BaseSepoliaParameters { function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey); From ca4208580cafa809a1be89df32e6f9020c58d3de Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 13:14:58 -0400 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20remove=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseGoerliKwentaForkParameters.sol | 21 ------------ .../utils/parameters/BaseGoerliParameters.sol | 34 ------------------- 2 files changed, 55 deletions(-) delete mode 100644 script/utils/parameters/BaseGoerliKwentaForkParameters.sol delete mode 100644 script/utils/parameters/BaseGoerliParameters.sol diff --git a/script/utils/parameters/BaseGoerliKwentaForkParameters.sol b/script/utils/parameters/BaseGoerliKwentaForkParameters.sol deleted file mode 100644 index 7173062e..00000000 --- a/script/utils/parameters/BaseGoerliKwentaForkParameters.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity 0.8.20; - -contract BaseGoerliKwentaForkParameters { - /// @dev this is an EOA used on testnet only - address public constant PDAO = 0x1b4fCFE451A15218aEeC811B508B4aa3f2A35904; - - address public constant PERPS_MARKET_PROXY = - 0x5D48528E90EDEFA8cff2A23E1e3fda46Acef0E2d; - - address public constant SPOT_MARKET_PROXY = - 0xB462f8FC435fD78E16C0287fDBF706BcE87076be; - - address public constant USD_PROXY = - 0xD3bcDae94B0c2EF16d1c43d29c23b1735d864fC6; - - // https://developers.circle.com/stablecoins/docs/usdc-on-test-networks#usdc-on-base-goerli - address public constant USDC = 0xF175520C52418dfE19C8098071a252da48Cd1C19; - - uint128 public constant SUSDC_SPOT_MARKET_ID = type(uint128).max; -} diff --git a/script/utils/parameters/BaseGoerliParameters.sol b/script/utils/parameters/BaseGoerliParameters.sol deleted file mode 100644 index 369f8495..00000000 --- a/script/utils/parameters/BaseGoerliParameters.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity 0.8.20; - -contract BaseGoerliParameters { - /// @dev this is an EOA used on testnet only - address public constant PDAO = 0x1b4fCFE451A15218aEeC811B508B4aa3f2A35904; - - address public constant PERPS_MARKET_PROXY = - 0x9863Dae3f4b5F4Ffe3A841a21565d57F2BA10E87; - - address public constant SPOT_MARKET_PROXY = - 0x17633A63083dbd4941891F87Bdf31B896e91e2B9; - - address public constant USD_PROXY = - 0x579c612E4Bf390f5504DB9f76b6F5759A3172279; - - // https://usecannon.com/packages/synthetix-perps-market/3.3.5/84531-andromeda - address public constant PERPS_MARKET_PROXY_ANDROMEDA = - 0x75c43165ea38cB857C45216a37C5405A7656673c; - - // https://usecannon.com/packages/synthetix-spot-market/3.3.5/84531-andromeda - address public constant SPOT_MARKET_PROXY_ANDROMEDA = - 0x26f3EcFa0Aa924649cfd4b74C57637e910A983a4; - - // https://usecannon.com/packages/synthetix/3.3.5/84531-andromeda - address public constant USD_PROXY_ANDROMEDA = - 0xa89163A087fe38022690C313b5D4BBF12574637f; - - // https://goerli.basescan.org/address/0x4967d1987930b2cd183dab4b6c40b8745dd2eba1 - address public constant USDC = 0x4967d1987930b2CD183dAB4B6C40B8745DD2eba1; - - // https://usecannon.com/packages/synthetix-spot-market/3.3.5/84531-andromeda - uint128 public constant SUSDC_SPOT_MARKET_ID = 1; -} From b627361cb60d76f0887859ee4029b9cf0afafa6e Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 13:30:38 -0400 Subject: [PATCH 07/11] =?UTF-8?q?=E2=9C=85=20update=20bootstrap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/Bootstrap.sol | 249 +-------------------------------------- 1 file changed, 1 insertion(+), 248 deletions(-) diff --git a/test/utils/Bootstrap.sol b/test/utils/Bootstrap.sol index 79c95303..a815e041 100644 --- a/test/utils/Bootstrap.sol +++ b/test/utils/Bootstrap.sol @@ -7,14 +7,7 @@ import {Conditions} from "test/utils/Conditions.sol"; import {Constants} from "test/utils/Constants.sol"; import {SynthetixV3Errors} from "test/utils/errors/SynthetixV3Errors.sol"; import {EngineExposed} from "test/utils/exposed/EngineExposed.sol"; -import { - Engine, - OptimismGoerliParameters, - OptimismParameters, - BaseParameters, - BaseGoerliParameters, - Setup -} from "script/Deploy.s.sol"; +import {Engine, BaseParameters, Setup} from "script/Deploy.s.sol"; import {IERC20} from "src/interfaces/tokens/IERC20.sol"; import {IPerpsMarketProxy} from "test/utils/interfaces/IPerpsMarketProxy.sol"; import {ISpotMarketProxy} from "src/interfaces/synthetix/ISpotMarketProxy.sol"; @@ -62,76 +55,6 @@ contract Bootstrap is Test, Constants, Conditions, SynthetixV3Errors { // ACTOR's account id in the Synthetix v3 perps market uint128 public accountId; - function initializeOptimism() public { - BootstrapOptimismGoerli bootstrap = new BootstrapOptimismGoerli(); - ( - address _engineAddress, - address _engineExposedAddress, - address _perpsMarketProxyAddress, - address _spotMarketProxyAddress, - address _sUSDAddress, - address _pDAOAddress, - address _usdc, - uint128 _sUSDCId - ) = bootstrap.init(); - - engine = Engine(_engineAddress); - engineExposed = EngineExposed(_engineExposedAddress); - perpsMarketProxy = IPerpsMarketProxy(_perpsMarketProxyAddress); - spotMarketProxy = ISpotMarketProxy(_spotMarketProxyAddress); - sUSD = IERC20(_sUSDAddress); - synthMinter = new SynthMinter(_sUSDAddress, _spotMarketProxyAddress); - pDAO = _pDAOAddress; - USDC = IERC20(_usdc); - sUSDCId = _sUSDCId; - - vm.startPrank(ACTOR); - accountId = perpsMarketProxy.createAccount(); - perpsMarketProxy.grantPermission({ - accountId: accountId, - permission: ADMIN_PERMISSION, - user: address(engine) - }); - vm.stopPrank(); - - synthMinter.mint_sUSD(ACTOR, AMOUNT); - } - - function initializeOptimismGoerli() public { - BootstrapOptimismGoerli bootstrap = new BootstrapOptimismGoerli(); - ( - address _engineAddress, - address _engineExposedAddress, - address _perpsMarketProxyAddress, - address _spotMarketProxyAddress, - address _sUSDAddress, - address _pDAOAddress, - address _usdc, - uint128 _sUSDCId - ) = bootstrap.init(); - - engine = Engine(_engineAddress); - engineExposed = EngineExposed(_engineExposedAddress); - perpsMarketProxy = IPerpsMarketProxy(_perpsMarketProxyAddress); - spotMarketProxy = ISpotMarketProxy(_spotMarketProxyAddress); - sUSD = IERC20(_sUSDAddress); - synthMinter = new SynthMinter(_sUSDAddress, _spotMarketProxyAddress); - pDAO = _pDAOAddress; - USDC = IERC20(_usdc); - sUSDCId = _sUSDCId; - - vm.startPrank(ACTOR); - accountId = perpsMarketProxy.createAccount(); - perpsMarketProxy.grantPermission({ - accountId: accountId, - permission: ADMIN_PERMISSION, - user: address(engine) - }); - vm.stopPrank(); - - synthMinter.mint_sUSD(ACTOR, AMOUNT); - } - function initializeBase() public { BootstrapBase bootstrap = new BootstrapBase(); ( @@ -166,131 +89,6 @@ contract Bootstrap is Test, Constants, Conditions, SynthetixV3Errors { synthMinter.mint_sUSD(ACTOR, AMOUNT); } - - function initializeBaseGoerli() public { - BootstrapBaseGoerli bootstrap = new BootstrapBaseGoerli(); - ( - address _engineAddress, - address _engineExposedAddress, - address _perpsMarketProxyAddress, - address _spotMarketProxyAddress, - address _sUSDAddress, - address _pDAOAddress, - address _usdc, - uint128 _sUSDCId - ) = bootstrap.init(); - - engine = Engine(_engineAddress); - engineExposed = EngineExposed(_engineExposedAddress); - perpsMarketProxy = IPerpsMarketProxy(_perpsMarketProxyAddress); - spotMarketProxy = ISpotMarketProxy(_spotMarketProxyAddress); - sUSD = IERC20(_sUSDAddress); - synthMinter = new SynthMinter(_sUSDAddress, _spotMarketProxyAddress); - pDAO = _pDAOAddress; - USDC = IERC20(_usdc); - sUSDCId = _sUSDCId; - - vm.startPrank(ACTOR); - accountId = perpsMarketProxy.createAccount(); - perpsMarketProxy.grantPermission({ - accountId: accountId, - permission: ADMIN_PERMISSION, - user: address(engine) - }); - vm.stopPrank(); - - synthMinter.mint_sUSD(ACTOR, AMOUNT); - } -} - -contract BootstrapOptimism is Setup, OptimismParameters { - function init() - public - returns ( - address, - address, - address, - address, - address, - address, - address, - uint128 - ) - { - (Engine engine) = Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - EngineExposed engineExposed = new EngineExposed({ - _perpsMarketProxy: PERPS_MARKET_PROXY, - _spotMarketProxy: SPOT_MARKET_PROXY, - _sUSDProxy: USD_PROXY, - _pDAO: PDAO, - _usdc: USDC, - _sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - return ( - address(engine), - address(engineExposed), - PERPS_MARKET_PROXY, - SPOT_MARKET_PROXY, - USD_PROXY, - PDAO, - USDC, - SUSDC_SPOT_MARKET_ID - ); - } -} - -contract BootstrapOptimismGoerli is Setup, OptimismGoerliParameters { - function init() - public - returns ( - address, - address, - address, - address, - address, - address, - address, - uint128 - ) - { - (Engine engine) = Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - EngineExposed engineExposed = new EngineExposed({ - _perpsMarketProxy: PERPS_MARKET_PROXY, - _spotMarketProxy: SPOT_MARKET_PROXY, - _sUSDProxy: USD_PROXY, - _pDAO: PDAO, - _usdc: USDC, - _sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - return ( - address(engine), - address(engineExposed), - PERPS_MARKET_PROXY, - SPOT_MARKET_PROXY, - USD_PROXY, - PDAO, - USDC, - SUSDC_SPOT_MARKET_ID - ); - } } contract BootstrapBase is Setup, BaseParameters { @@ -337,48 +135,3 @@ contract BootstrapBase is Setup, BaseParameters { ); } } - -contract BootstrapBaseGoerli is Setup, BaseGoerliParameters { - function init() - public - returns ( - address, - address, - address, - address, - address, - address, - address, - uint128 - ) - { - (Engine engine) = Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, - spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, - sUSDProxy: USD_PROXY_ANDROMEDA, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - EngineExposed engineExposed = new EngineExposed({ - _perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, - _spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, - _sUSDProxy: USD_PROXY_ANDROMEDA, - _pDAO: PDAO, - _usdc: USDC, - _sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - return ( - address(engine), - address(engineExposed), - PERPS_MARKET_PROXY_ANDROMEDA, - SPOT_MARKET_PROXY_ANDROMEDA, - USD_PROXY_ANDROMEDA, - PDAO, - USDC, - SUSDC_SPOT_MARKET_ID - ); - } -} From 5b34a7c4daa0d7c541a8ac05fc386fa083332248 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 14:07:05 -0400 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=9A=80=20update=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/Deploy.s.sol | 137 ------------------------------------------- script/Upgrade.s.sol | 14 ++--- 2 files changed, 7 insertions(+), 144 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 6c31374a..5ec6f446 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -9,15 +9,7 @@ import {ERC1967Proxy as Proxy} from import {Engine} from "src/Engine.sol"; // parameters -import {BaseGoerliParameters} from - "script/utils/parameters/BaseGoerliParameters.sol"; 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"; import {BaseSepoliaParameters} from "script/utils/parameters/BaseSepoliaParameters.sol"; @@ -52,27 +44,6 @@ 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_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); - - Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - /// @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_Andromeda --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` @@ -94,48 +65,6 @@ contract DeployBase_Andromeda 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 { - 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, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - -/// @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_Andromeda --rpc-url $BASE_GOERLI_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` -contract DeployBaseGoerli_Andromeda is Setup, BaseGoerliParameters { - function run() public { - uint256 privateKey = vm.envUint("PRIVATE_KEY"); - vm.startBroadcast(privateKey); - - Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, - spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, - sUSDProxy: USD_PROXY_ANDROMEDA, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - /// @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:DeployBaseSepolia_Andromeda --rpc-url $BASE_SEPOLIA_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` @@ -156,69 +85,3 @@ contract DeployBaseSepolia_Andromeda is Setup, BaseSepoliaParameters { 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); - - Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - 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_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); - - Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} - -/// @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_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); - - Setup.deploySystem({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, - pDAO: PDAO, - usdc: USDC, - sUSDCId: SUSDC_SPOT_MARKET_ID - }); - - vm.stopBroadcast(); - } -} diff --git a/script/Upgrade.s.sol b/script/Upgrade.s.sol index 3698ce1c..629fad66 100644 --- a/script/Upgrade.s.sol +++ b/script/Upgrade.s.sol @@ -44,9 +44,9 @@ contract DeployBase_Andromeda is Setup, BaseParameters { vm.startBroadcast(privateKey); Setup.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, + perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, + spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, + sUSDProxy: USD_PROXY_ANDROMEDA, pDAO: PDAO, usdc: USDC, sUSDCId: SUSDC_SPOT_MARKET_ID @@ -58,16 +58,16 @@ contract DeployBase_Andromeda is Setup, BaseParameters { /// @dev steps to deploy and verify on Base: /// (1) load the variables in the .env file via `source .env` -/// (2) run `forge script script/Upgrade.s.sol:DeployBaseSepolia_Andromeda --rpc-url $BASE_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` +/// (2) run `forge script script/Upgrade.s.sol:DeployBaseSepolia_Andromeda --rpc-url $BASE_SEPOLIA_RPC_URL --etherscan-api-key $BASESCAN_API_KEY --broadcast --verify -vvvv` contract DeployBaseSepolia_Andromeda is Setup, BaseSepoliaParameters { function run() public { uint256 privateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(privateKey); Setup.deployImplementation({ - perpsMarketProxy: PERPS_MARKET_PROXY, - spotMarketProxy: SPOT_MARKET_PROXY, - sUSDProxy: USD_PROXY, + perpsMarketProxy: PERPS_MARKET_PROXY_ANDROMEDA, + spotMarketProxy: SPOT_MARKET_PROXY_ANDROMEDA, + sUSDProxy: USD_PROXY_ANDROMEDA, pDAO: PDAO, usdc: USDC, sUSDCId: SUSDC_SPOT_MARKET_ID From 17535ba0ec6efd3cd38027c3c7f8b04d3a294a53 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 28 May 2024 14:07:20 -0400 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=9A=80=20update=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/utils/parameters/BaseSepoliaParameters.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/utils/parameters/BaseSepoliaParameters.sol b/script/utils/parameters/BaseSepoliaParameters.sol index d1aa7a63..4fb1b042 100644 --- a/script/utils/parameters/BaseSepoliaParameters.sol +++ b/script/utils/parameters/BaseSepoliaParameters.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.20; contract BaseSepoliaParameters { /// @dev this is an EOA used on testnet only - address public constant PDAO = 0x1b4fCFE451A15218aEeC811B508B4aa3f2A35904; + address public constant PDAO = 0x12d970154Ac171293323f20757130d5731850deB; address public constant PERPS_MARKET_PROXY = address(0); @@ -13,15 +13,15 @@ contract BaseSepoliaParameters { // https://usecannon.com/packages/synthetix-perps-market/3.3.5/84532-andromeda/ address public constant PERPS_MARKET_PROXY_ANDROMEDA = - 0xE6C5f05C415126E6b81FCc3619f65Db2fCAd58D0; + 0xf53Ca60F031FAf0E347D44FbaA4870da68250c8d; // https://usecannon.com/packages/synthetix-perps-market/3.3.5/84532-andromeda/ address public constant SPOT_MARKET_PROXY_ANDROMEDA = - 0xA4fE63F8ea9657990eA8E05Ebfa5C19a7D4d7337; + 0xaD2fE7cd224c58871f541DAE01202F93928FEF72; // https://usecannon.com/packages/synthetix-perps-market/3.3.5/84532-andromeda/ address public constant USD_PROXY_ANDROMEDA = - 0xa89163A087fe38022690C313b5D4BBF12574637f; + 0x682f0d17feDC62b2a0B91f8992243Bf44cAfeaaE; // https://base-sepolia.blockscout.com/address/0x69980C3296416820623b3e3b30703A74e2320bC8 address public constant USDC = 0x69980C3296416820623b3e3b30703A74e2320bC8; From df480012592ca0ecf69cc7d29d72b68c2b612e02 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 4 Jun 2024 14:07:04 -0400 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=9A=80=20upgrade=20smv3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/Base.json | 2 +- deployments/BaseSepolia.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/Base.json b/deployments/Base.json index 4419fa8a..fe377fde 100644 --- a/deployments/Base.json +++ b/deployments/Base.json @@ -1,6 +1,6 @@ { "Andromeda": { - "EngineImplementation": "0xD1F129e0cDd3Cc5c65ea00041623841C3d709F83", + "EngineImplementation": "0x7219cECaA0923dDfE7cDB3b782Aff7a69A2Ae478", "EngineProxy": "0xe331a7eeC851Ba702aA8BF43070a178451d6D28E" }, "test": { diff --git a/deployments/BaseSepolia.json b/deployments/BaseSepolia.json index 0a7db8a1..ddff365c 100644 --- a/deployments/BaseSepolia.json +++ b/deployments/BaseSepolia.json @@ -1,6 +1,6 @@ { "Andromeda": { - "EngineImplementation": "0x33B725a1B2dE9178121D423D2A1c062C5452f310", + "EngineImplementation": "0xA2dF816B2C5D8d799069d6a8a9f8464D402b5D25", "EngineProxy": "0xe5bB889B1f0B6B4B7384Bd19cbb37adBDDa941a6" }, "test": { From 552788e88439fff13694d21586589b6a3883253f Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 4 Jun 2024 14:09:59 -0400 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=93=B8=20update=20gas-snapshot/lcov?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gas-snapshot | 122 +++--- lcov.info | 1062 +++++++++++++++++-------------------------------- 2 files changed, 431 insertions(+), 753 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 1f69f0f5..daf0e72d 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,119 +1,119 @@ AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26743) -AccountDelegate:test_isAccountDelegate_false() (gas: 397500) -AccountDelegate:test_isAccountDelegate_true() (gas: 395470) -AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 27985) +AccountDelegate:test_isAccountDelegate_false() (gas: 397433) +AccountDelegate:test_isAccountDelegate_true() (gas: 395403) +AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 28007) AccountOwner:test_isAccountOwner_account_doesnt_exist() (gas: 29956) -AccountOwner:test_isAccountOwner_false() (gas: 235147) -AccountOwner:test_isAccountOwner_true() (gas: 235137) -AccountOwner:test_isAccountOwner_zero_address_caller() (gas: 15655) +AccountOwner:test_isAccountOwner_false() (gas: 235169) +AccountOwner:test_isAccountOwner_true() (gas: 235159) +AccountOwner:test_isAccountOwner_zero_address_caller() (gas: 15677) CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 421074) -CanExecute:test_canExecute_false_invalid_signature() (gas: 455458) +CanExecute:test_canExecute_false_invalid_signature() (gas: 455480) CanExecute:test_canExecute_false_invalid_signer() (gas: 448449) -CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 403938) -CanExecute:test_canExecute_false_nonce_used() (gas: 1029134) +CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 403960) +CanExecute:test_canExecute_false_nonce_used() (gas: 1029091) CanExecute:test_canExecute_false_require_verify_condition_not_met() (gas: 538639) CanExecute:test_canExecute_false_trusted_executor() (gas: 444733) CanExecute:test_canExecute_true() (gas: 444350) -CommitOrder:test_commitOrder() (gas: 585293) +CommitOrder:test_commitOrder() (gas: 585271) CommitOrder:test_commitOrder_Unauthorized() (gas: 37862) CommitOrder:test_commitOrder_insufficient_collateral() (gas: 425887) -CommitOrder:test_commitOrder_invalid_market() (gas: 44546) -Conditions:test_isOrderFeeBelow() (gas: 154802) -Conditions:test_isPositionSizeAbove() (gas: 24623) -Conditions:test_isPositionSizeBelow() (gas: 24598) -Conditions:test_isPriceAbove() (gas: 175814) +CommitOrder:test_commitOrder_invalid_market() (gas: 44524) +Conditions:test_isOrderFeeBelow() (gas: 154824) +Conditions:test_isPositionSizeAbove() (gas: 24579) +Conditions:test_isPositionSizeBelow() (gas: 24575) +Conditions:test_isPriceAbove() (gas: 175836) Conditions:test_isPriceBelow() (gas: 175643) -Conditions:test_isTimestampAfter() (gas: 13288) -Conditions:test_isTimestampBefore() (gas: 13376) -Credit:test_credit(uint256) (runs: 256, μ: 96854, ~: 105108) +Conditions:test_isTimestampAfter() (gas: 13310) +Conditions:test_isTimestampBefore() (gas: 13398) +Credit:test_credit(uint256) (runs: 256, μ: 94831, ~: 105108) Credit:test_credit_event() (gas: 88151) -Credit:test_credit_zap() (gas: 677111) -Debit:test_debit(uint256) (runs: 256, μ: 136737, ~: 147259) +Credit:test_credit_zap() (gas: 677093) +Debit:test_debit(uint256) (runs: 256, μ: 136580, ~: 147259) Debit:test_debit_InsufficientBalance() (gas: 122814) -Debit:test_debit_Unauthorized() (gas: 122831) -Debit:test_debit_event() (gas: 104507) -Debit:test_debit_zap() (gas: 985220) +Debit:test_debit_Unauthorized() (gas: 122875) +Debit:test_debit_event() (gas: 104489) +Debit:test_debit_zap() (gas: 985201) Debit:test_debit_zap_InsufficientBalance() (gas: 680643) Debit:test_debit_zap_Unauthorized() (gas: 122887) DeploymentTest:test_deploy() (gas: 4578038) DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 58661) DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 56065) DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 56052) -DepositCollateral:test_depositCollateral() (gas: 433723) +DepositCollateral:test_depositCollateral() (gas: 433700) DepositCollateral:test_depositCollateral_availableMargin() (gas: 437890) -DepositCollateral:test_depositCollateral_collateralAmount() (gas: 433843) +DepositCollateral:test_depositCollateral_collateralAmount() (gas: 433865) DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 61158) DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 435519) -DepositCollateral:test_depositCollateral_zap() (gas: 940531) +DepositCollateral:test_depositCollateral_zap() (gas: 940477) EIP712Test:test_DOMAIN_SEPARATOR() (gas: 5729) EIP712Test:test_buildDomainSeparator() (gas: 6363) EIP712Test:test_cachedDomainSeparatorInvalidated() (gas: 5454) EIP712Test:test_domainNameAndVersion() (gas: 1261) EIP712Test:test_eip712Domain() (gas: 10831) EIP712Test:test_hashTypedData() (gas: 37085) -Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 322511) -Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 103724) +Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 322533) +Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 103746) Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 469157) -Execute:test_execute_event() (gas: 635846) +Execute:test_execute_event() (gas: 635823) Execute:test_execute_order_committed() (gas: 632413) -Fee:test_fee_exceeds_account_credit() (gas: 125744) +Fee:test_fee_exceeds_account_credit() (gas: 125721) Fee:test_fee_exceeds_maxExecutorFee() (gas: 125306) Fee:test_fee_imposed() (gas: 719924) -FulfillOracleQuery:test_fulfillOracleQuery(bytes) (runs: 256, μ: 31280, ~: 31272) +FulfillOracleQuery:test_fulfillOracleQuery(bytes) (runs: 256, μ: 31258, ~: 31250) FulfillOracleQuery:test_fulfillOracleQuery_refund(bytes) (runs: 256, μ: 40303, ~: 40295) FulfillOracleQuery:test_fulfillOracleQuery_revert(bytes) (runs: 256, μ: 32927, ~: 32919) MathLibTest:test_abs128() (gas: 448) MathLibTest:test_abs256() (gas: 458) -MathLibTest:test_fuzz_abs128(int128) (runs: 256, μ: 577, ~: 603) +MathLibTest:test_fuzz_abs128(int128) (runs: 256, μ: 578, ~: 603) MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 450, ~: 436) -MathLibTest:test_fuzz_toInt256(uint256) (runs: 256, μ: 567, ~: 438) +MathLibTest:test_fuzz_toInt256(uint256) (runs: 256, μ: 989, ~: 438) MathLibTest:test_isSameSign() (gas: 999) MathLibTest:test_toInt256() (gas: 3347) MathLibTest:test_toInt256_overflow() (gas: 3251) MockUpgrade:test_upgrade() (gas: 4602208) -MockUpgrade:test_upgrade_credit_state(uint256) (runs: 256, μ: 4680705, ~: 4680705) -MockUpgrade:test_upgrade_nonce_state(uint256) (runs: 256, μ: 4636012, ~: 4636012) -MockUpgrade:test_upgrade_only_pDAO() (gas: 4587308) -Multicall:testMulticallableBenchmark() (gas: 29229) -Multicall:testMulticallableOriginalBenchmark() (gas: 38452) +MockUpgrade:test_upgrade_credit_state(uint256) (runs: 256, μ: 4680727, ~: 4680727) +MockUpgrade:test_upgrade_nonce_state(uint256) (runs: 256, μ: 4635945, ~: 4635945) +MockUpgrade:test_upgrade_only_pDAO() (gas: 4587330) +Multicall:testMulticallableBenchmark() (gas: 29251) +Multicall:testMulticallableOriginalBenchmark() (gas: 38474) Multicall:testMulticallablePreservesMsgSender() (gas: 11116) Multicall:testMulticallableReturnDataIsProperlyEncoded() (gas: 11637) -Multicall:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 9570, ~: 7423) -Multicall:testMulticallableReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 11695, ~: 11695) +Multicall:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 10035, ~: 11887) +Multicall:testMulticallableReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 11738, ~: 11738) Multicall:testMulticallableRevertWithCustomError() (gas: 11746) Multicall:testMulticallableRevertWithMessage() (gas: 13451) -Multicall:testMulticallableRevertWithMessage(string) (runs: 256, μ: 14035, ~: 13883) +Multicall:testMulticallableRevertWithMessage(string) (runs: 256, μ: 14013, ~: 13861) Multicall:testMulticallableRevertWithNothing() (gas: 11655) Multicall:testMulticallableWithNoData() (gas: 6311) MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall(bytes) (runs: 256, μ: 34608, ~: 34543) -MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall_double_spend(bytes) (runs: 256, μ: 47637, ~: 47511) -MulticallableEngine:test_multicall_engine_fulfillOracleQuery_modifyCollateral() (gas: 454331) -NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 58094, ~: 58094) -NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 59883) -NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 83563) +MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall_double_spend(bytes) (runs: 256, μ: 47615, ~: 47489) +MulticallableEngine:test_multicall_engine_fulfillOracleQuery_modifyCollateral() (gas: 454353) +NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 58116, ~: 58116) +NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 59860) +NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 83585) NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 196657) NonceBitmapTest:test_invalidateUnorderedNonces_Unauthorized() (gas: 35549) -NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 58312) -ReduceOnly:test_reduce_only() (gas: 634127) +NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 58334) +ReduceOnly:test_reduce_only() (gas: 634104) ReduceOnly:test_reduce_only_same_sign() (gas: 78584) ReduceOnly:test_reduce_only_truncate_size_down() (gas: 634267) -ReduceOnly:test_reduce_only_truncate_size_up() (gas: 614812) +ReduceOnly:test_reduce_only_truncate_size_up() (gas: 614854) ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 167039) -ReduceOnly:test_reduce_only_zero_size_delta() (gas: 167073) +ReduceOnly:test_reduce_only_zero_size_delta() (gas: 167050) RemoveUpgradability:test_removeUpgradability() (gas: 4572629) -SignatureCheckerLibTest:testSignatureChecker(bytes32) (runs: 256, μ: 31267, ~: 28574) -SignatureCheckerLibTest:test_isValidSignatureNowCalldata(address,bytes32,bytes) (runs: 256, μ: 3493, ~: 3451) -StorageLayout:test_credit_slot() (gas: 5584) +SignatureCheckerLibTest:testSignatureChecker(bytes32) (runs: 256, μ: 31232, ~: 28441) +SignatureCheckerLibTest:test_isValidSignatureNowCalldata(address,bytes32,bytes) (runs: 256, μ: 3487, ~: 3451) +StorageLayout:test_credit_slot() (gas: 5517) StorageLayout:test_nonceBitmap_slot() (gas: 5520) VerifyConditions:test_max_condition_size_exceeded() (gas: 51317) VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 19096) VerifyConditions:test_verify_conditions_not_verified() (gas: 127923) -VerifyConditions:test_verify_conditions_verified() (gas: 175747) +VerifyConditions:test_verify_conditions_verified() (gas: 175769) VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 30169, ~: 30169) -VerifySignature:test_verifySignature_false_private_key() (gas: 32833) -VerifySigner:test_verifySigner() (gas: 30918) -VerifySigner:test_verifySigner_false() (gas: 33626) -WithdrawCollateral:test_withdrawCollateral() (gas: 539605) -WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 445821) -WithdrawCollateral:test_withdrawCollateral_zap() (gas: 934846) -WithdrawCollateral:test_withdrawCollateral_zero() (gas: 441471) \ No newline at end of file +VerifySignature:test_verifySignature_false_private_key() (gas: 32788) +VerifySigner:test_verifySigner() (gas: 30873) +VerifySigner:test_verifySigner_false() (gas: 33603) +WithdrawCollateral:test_withdrawCollateral() (gas: 539627) +WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 445843) +WithdrawCollateral:test_withdrawCollateral_zap() (gas: 934868) +WithdrawCollateral:test_withdrawCollateral_zero() (gas: 441404) \ No newline at end of file diff --git a/lcov.info b/lcov.info index 7488d067..ffac25cb 100644 --- a/lcov.info +++ b/lcov.info @@ -1,214 +1,92 @@ TN: SF:script/Deploy.s.sol -FN:209,DeployOptimismGoerli_Synthetix.run -FNDA:0,DeployOptimismGoerli_Synthetix.run -DA:210,0 -DA:210,0 -DA:210,0 -DA:211,0 -DA:211,0 -DA:213,0 -DA:213,0 -DA:222,0 -DA:222,0 -FN:59,DeployBase_Synthetix.run -FNDA:0,DeployBase_Synthetix.run -DA:60,0 -DA:60,0 -DA:60,0 -DA:61,0 -DA:61,0 -DA:63,0 -DA:63,0 -DA:72,0 -DA:72,0 -FN:143,DeployBaseSepolia_Andromeda.run -FNDA:0,DeployBaseSepolia_Andromeda.run -DA:144,0 -DA:144,0 -DA:144,0 -DA:145,0 -DA:145,0 -DA:147,0 -DA:147,0 -DA:156,0 -DA:156,0 -FN:80,DeployBase_Andromeda.run -FNDA:0,DeployBase_Andromeda.run -DA:81,0 -DA:81,0 -DA:81,0 -DA:82,0 -DA:82,0 -DA:84,0 -DA:84,0 -DA:93,0 -DA:93,0 -FN:188,DeployOptimism_Synthetix.run -FNDA:0,DeployOptimism_Synthetix.run -DA:189,0 -DA:189,0 -DA:189,0 -DA:190,0 -DA:190,0 -DA:192,0 -DA:192,0 -DA:201,0 -DA:201,0 -FN:122,DeployBaseGoerli_Andromeda.run -FNDA:0,DeployBaseGoerli_Andromeda.run -DA:123,0 -DA:123,0 -DA:123,0 -DA:124,0 -DA:124,0 -DA:126,0 -DA:126,0 -DA:135,0 -DA:135,0 -FN:101,DeployBaseGoerli_Synthetix.run -FNDA:0,DeployBaseGoerli_Synthetix.run -DA:102,0 -DA:102,0 -DA:102,0 -DA:103,0 -DA:103,0 -DA:105,0 -DA:105,0 -DA:114,0 -DA:114,0 -FN:167,DeployBaseGoerli_KwentaFork.run -FNDA:0,DeployBaseGoerli_KwentaFork.run -DA:168,0 -DA:168,0 -DA:168,0 -DA:169,0 -DA:169,0 -DA:171,0 -DA:171,0 -DA:180,0 -DA:180,0 -FN:30,Setup.deploySystem +FN:22,Setup.deploySystem FNDA:4,Setup.deploySystem -DA:38,103 -DA:38,103 -DA:48,100 -DA:48,100 -DA:48,100 -DA:51,100 -DA:51,100 -FNF:9 +DA:30,103 +DA:30,103 +DA:40,100 +DA:40,100 +DA:40,100 +DA:43,100 +DA:43,100 +FN:51,DeployBase_Andromeda.run +FNDA:0,DeployBase_Andromeda.run +DA:52,0 +DA:52,0 +DA:52,0 +DA:53,0 +DA:53,0 +DA:55,0 +DA:55,0 +DA:64,0 +DA:64,0 +FN:72,DeployBaseSepolia_Andromeda.run +FNDA:0,DeployBaseSepolia_Andromeda.run +DA:73,0 +DA:73,0 +DA:73,0 +DA:74,0 +DA:74,0 +DA:76,0 +DA:76,0 +DA:85,0 +DA:85,0 +FNF:3 FNH:1 -LF:35 +LF:11 LH:3 BRF:0 BRH:0 end_of_record TN: SF:script/Upgrade.s.sol -FN:69,DeployBaseGoerli_Synthetix.run -FNDA:0,DeployBaseGoerli_Synthetix.run -DA:70,0 -DA:70,0 -DA:70,0 -DA:71,0 -DA:71,0 -DA:73,0 -DA:73,0 -DA:82,0 -DA:82,0 -FN:114,DeployBaseGoerli_Andromeda.run -FNDA:0,DeployBaseGoerli_Andromeda.run -DA:115,0 -DA:115,0 -DA:115,0 -DA:116,0 -DA:116,0 -DA:118,0 -DA:118,0 -DA:127,0 -DA:127,0 -FN:93,DeployBaseGoerli_KwentaFork.run -FNDA:0,DeployBaseGoerli_KwentaFork.run -DA:94,0 -DA:94,0 -DA:94,0 -DA:95,0 -DA:95,0 -DA:97,0 -DA:97,0 -DA:106,0 -DA:106,0 -FN:48,DeployBase_Synthetix.run -FNDA:0,DeployBase_Synthetix.run -DA:49,0 -DA:49,0 -DA:49,0 -DA:50,0 -DA:50,0 -DA:52,0 -DA:52,0 -DA:61,0 -DA:61,0 -FN:135,DeployOptimism_Synthetix.run -FNDA:0,DeployOptimism_Synthetix.run -DA:136,0 -DA:136,0 -DA:136,0 -DA:137,0 -DA:137,0 -DA:139,0 -DA:139,0 -DA:148,0 -DA:148,0 -FN:156,DeployOptimismGoerli_Synthetix.run -FNDA:0,DeployOptimismGoerli_Synthetix.run -DA:157,0 -DA:157,0 -DA:157,0 -DA:158,0 -DA:158,0 -DA:160,0 -DA:160,0 -DA:169,0 -DA:169,0 -FN:25,Setup.deployImplementation +FN:42,DeployBase_Andromeda.run +FNDA:0,DeployBase_Andromeda.run +DA:43,0 +DA:43,0 +DA:43,0 +DA:44,0 +DA:44,0 +DA:46,0 +DA:46,0 +DA:55,0 +DA:55,0 +FN:19,Setup.deployImplementation FNDA:0,Setup.deployImplementation -DA:33,0 -DA:33,0 -FNF:7 +DA:27,0 +DA:27,0 +FN:63,DeployBaseSepolia_Andromeda.run +FNDA:0,DeployBaseSepolia_Andromeda.run +DA:64,0 +DA:64,0 +DA:64,0 +DA:65,0 +DA:65,0 +DA:67,0 +DA:67,0 +DA:76,0 +DA:76,0 +FNF:3 FNH:0 -LF:25 +LF:9 LH:0 BRF:0 BRH:0 end_of_record TN: SF:src/Engine.sol -FN:105,Engine. -FNDA:524,Engine. -DA:113,522 -DA:113,522 -DA:113,522 -BRDA:113,0,0,1 -BRDA:113,0,1,527 -DA:113,1 -DA:115,521 -DA:115,521 -DA:119,521 -DA:119,521 FN:127,Engine._authorizeUpgrade FNDA:516,Engine._authorizeUpgrade DA:132,516 DA:132,516 DA:132,516 -BRDA:132,1,0,1 -BRDA:132,1,1,515 +BRDA:132,0,0,1 +BRDA:132,0,1,515 DA:132,1 DA:133,515 DA:133,515 -BRDA:133,2,0,1 -BRDA:133,2,1,514 +BRDA:133,1,0,1 +BRDA:133,1,1,514 DA:133,1 FN:141,Engine.isAccountOwner FNDA:4,Engine.isAccountOwner @@ -238,8 +116,8 @@ FN:179,Engine.invalidateUnorderedNonces FNDA:518,Engine.invalidateUnorderedNonces DA:184,518 DA:184,518 -BRDA:184,3,0,517 -BRDA:184,3,1,1 +BRDA:184,2,0,517 +BRDA:184,2,1,1 DA:190,517 DA:190,517 DA:192,517 @@ -278,8 +156,8 @@ DA:275,13 DA:298,13 DA:298,13 DA:298,13 -BRDA:298,4,0,- -BRDA:298,4,1,13 +BRDA:298,3,0,- +BRDA:298,3,1,13 DA:298,0 FN:306,Engine.modifyCollateral FNDA:60,Engine.modifyCollateral @@ -288,14 +166,14 @@ DA:311,60 DA:311,60 DA:313,60 DA:313,60 -BRDA:313,5,0,57 -BRDA:313,5,1,3 +BRDA:313,4,0,57 +BRDA:313,4,1,3 DA:314,57 DA:314,57 DA:318,3 DA:318,3 -BRDA:318,6,0,- -BRDA:318,6,1,3 +BRDA:318,5,0,- +BRDA:318,5,1,3 DA:318,0 DA:320,3 DA:320,3 @@ -303,8 +181,8 @@ FN:327,Engine.modifyCollateralZap FNDA:2,Engine.modifyCollateralZap DA:332,2 DA:332,2 -BRDA:332,7,0,- -BRDA:332,7,1,1 +BRDA:332,6,0,- +BRDA:332,6,1,1 DA:336,1 DA:336,1 DA:336,1 @@ -314,8 +192,8 @@ DA:340,1 DA:340,1 DA:344,1 DA:344,1 -BRDA:344,8,0,- -BRDA:344,8,1,1 +BRDA:344,7,0,- +BRDA:344,7,1,1 DA:344,0 DA:346,1 DA:346,1 @@ -346,8 +224,8 @@ FN:410,Engine.commitOrder FNDA:4,Engine.commitOrder DA:426,4 DA:426,4 -BRDA:426,9,0,3 -BRDA:426,9,1,1 +BRDA:426,8,0,3 +BRDA:426,8,1,1 DA:427,3 DA:427,3 DA:437,1 @@ -362,8 +240,8 @@ DA:473,776 DA:473,776 DA:476,776 DA:476,776 -DA:478,658 -DA:478,658 +DA:478,656 +DA:478,656 FN:482,Engine.creditAccountZap FNDA:3,Engine.creditAccountZap DA:488,3 @@ -377,24 +255,24 @@ FN:496,Engine.debitAccount FNDA:259,Engine.debitAccount DA:501,259 DA:501,259 -BRDA:501,10,0,1 -BRDA:501,10,1,258 +BRDA:501,9,0,1 +BRDA:501,9,1,258 DA:501,1 DA:503,258 DA:503,258 -DA:505,146 -DA:505,146 +DA:505,143 +DA:505,143 FN:509,Engine.debitAccountZap FNDA:3,Engine.debitAccountZap DA:514,3 DA:514,3 -BRDA:514,11,0,1 -BRDA:514,11,1,2 +BRDA:514,10,0,1 +BRDA:514,10,1,2 DA:514,1 DA:516,2 DA:516,2 -BRDA:516,12,0,1 -BRDA:516,12,1,1 +BRDA:516,11,0,1 +BRDA:516,11,1,1 DA:516,1 DA:519,1 DA:519,1 @@ -409,13 +287,13 @@ FN:530,Engine._debit FNDA:259,Engine._debit DA:533,259 DA:533,259 -BRDA:533,13,0,110 -BRDA:533,13,1,149 -DA:533,110 -DA:536,149 -DA:536,149 -DA:539,149 -DA:539,149 +BRDA:533,12,0,101 +BRDA:533,12,1,158 +DA:533,101 +DA:536,158 +DA:536,158 +DA:539,158 +DA:539,158 FN:547,Engine.execute FNDA:15,Engine.execute DA:563,15 @@ -424,232 +302,233 @@ DA:564,15 DA:564,15 DA:565,15 DA:565,15 -BRDA:565,14,0,2 -BRDA:565,14,1,13 +BRDA:565,13,0,2 +BRDA:565,13,1,13 DA:565,2 DA:568,13 DA:568,13 DA:576,13 DA:576,13 -BRDA:576,15,0,1 -BRDA:576,15,1,13 +BRDA:576,14,0,1 +BRDA:576,14,1,13 DA:576,1 DA:579,13 DA:579,13 DA:582,13 -BRDA:582,16,0,2 -BRDA:582,16,1,3 +BRDA:582,15,0,2 +BRDA:582,15,1,3 DA:583,6 DA:583,6 DA:583,6 DA:589,6 DA:589,6 -BRDA:589,17,0,2 -BRDA:589,17,1,4 +BRDA:589,16,0,2 +BRDA:589,16,1,4 DA:590,2 DA:590,2 -DA:596,4 -DA:596,4 -DA:596,4 -DA:596,4 -BRDA:596,18,0,1 -BRDA:596,18,1,3 -DA:597,1 -DA:597,1 -DA:608,3 -DA:608,3 -DA:608,3 -DA:608,3 -BRDA:608,19,0,2 -BRDA:608,19,1,3 -DA:624,2 -DA:624,2 -DA:629,10 -DA:629,10 -DA:639,7 -DA:639,7 -FN:647,Engine.canExecute +DA:598,4 +DA:598,4 +DA:598,4 +DA:598,4 +BRDA:598,17,0,1 +BRDA:598,17,1,3 +DA:599,1 +DA:599,1 +DA:610,3 +DA:610,3 +DA:610,3 +DA:610,3 +BRDA:610,18,0,2 +BRDA:610,18,1,3 +DA:626,2 +DA:626,2 +DA:631,10 +DA:631,10 +DA:641,7 +DA:641,7 +FN:649,Engine.canExecute FNDA:10,Engine.canExecute -DA:654,25 -DA:654,25 -BRDA:654,20,0,2 -BRDA:654,20,1,23 -DA:655,2 -DA:655,2 -DA:659,23 -DA:659,23 -BRDA:659,21,0,2 -BRDA:659,21,1,21 -DA:660,2 -DA:660,2 -DA:664,21 -DA:664,21 -BRDA:664,22,0,2 -BRDA:664,22,1,19 -DA:665,2 -DA:665,2 -DA:670,19 -DA:670,19 -BRDA:670,23,0,1 -BRDA:670,23,1,18 -DA:670,1 -DA:673,18 -DA:673,18 -BRDA:673,24,0,1 -BRDA:673,24,1,17 -DA:674,1 -DA:674,1 -DA:678,17 -BRDA:678,25,0,1 -BRDA:678,25,1,- -DA:681,1 -DA:681,1 -BRDA:681,26,0,1 -BRDA:681,26,1,- -DA:682,1 -DA:682,1 -DA:687,16 -DA:687,16 -BRDA:687,27,0,1 -BRDA:687,27,1,15 -DA:688,1 -DA:688,1 -DA:692,15 -DA:692,15 -FN:700,Engine.verifySigner +DA:656,25 +DA:656,25 +BRDA:656,19,0,2 +BRDA:656,19,1,23 +DA:657,2 +DA:657,2 +DA:661,23 +DA:661,23 +BRDA:661,20,0,2 +BRDA:661,20,1,21 +DA:662,2 +DA:662,2 +DA:666,21 +DA:666,21 +BRDA:666,21,0,2 +BRDA:666,21,1,19 +DA:667,2 +DA:667,2 +DA:672,19 +DA:672,19 +BRDA:672,22,0,1 +BRDA:672,22,1,18 +DA:673,1 +DA:673,1 +DA:677,18 +DA:677,18 +BRDA:677,23,0,1 +BRDA:677,23,1,17 +DA:678,1 +DA:678,1 +DA:682,17 +BRDA:682,24,0,1 +BRDA:682,24,1,- +DA:685,1 +DA:685,1 +BRDA:685,25,0,1 +BRDA:685,25,1,- +DA:686,1 +DA:686,1 +DA:691,16 +DA:691,16 +BRDA:691,26,0,1 +BRDA:691,26,1,15 +DA:692,1 +DA:692,1 +DA:696,15 +DA:696,15 +FN:704,Engine.verifySigner FNDA:2,Engine.verifySigner -DA:706,21 -DA:706,21 -DA:706,21 -FN:710,Engine.verifySignature +DA:710,21 +DA:710,21 +DA:710,21 +FN:714,Engine.verifySignature FNDA:257,Engine.verifySignature -DA:714,275 -DA:714,275 -DA:714,275 -FN:722,Engine.verifyConditions +DA:718,275 +DA:718,275 +DA:718,275 +FN:726,Engine.verifyConditions FNDA:4,Engine.verifyConditions -DA:728,5 -DA:728,5 -DA:729,5 -DA:729,5 -BRDA:729,28,0,1 -BRDA:729,28,1,4 -DA:730,1 -DA:730,1 -DA:733,4 -DA:733,4 -DA:733,15 -DA:734,14 -DA:734,14 -DA:735,14 -DA:735,14 -DA:738,14 +DA:732,5 +DA:732,5 +DA:733,5 +DA:733,5 +BRDA:733,27,0,1 +BRDA:733,27,1,4 +DA:734,1 +DA:734,1 +DA:737,4 +DA:737,4 +DA:737,15 DA:738,14 DA:738,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:744,14 -DA:745,12 -DA:745,12 -DA:746,10 -DA:746,10 -DA:747,7 -DA:747,7 -DA:748,5 -DA:748,5 -DA:749,4 -DA:749,4 -DA:750,3 -DA:750,3 -DA:751,2 -DA:751,2 -BRDA:743,29,0,2 -BRDA:743,29,1,11 -DA:755,13 -DA:755,13 -DA:758,13 -DA:758,13 -DA:758,13 -DA:758,13 -BRDA:758,30,0,2 -BRDA:758,30,1,11 -DA:758,2 -DA:761,11 -DA:761,11 -DA:764,1 -DA:764,1 +DA:739,14 +DA:739,14 +DA:742,14 +DA:742,14 +DA:742,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:748,14 +DA:749,12 +DA:749,12 +DA:750,10 +DA:750,10 +DA:751,7 +DA:751,7 +DA:752,5 +DA:752,5 +DA:753,4 +DA:753,4 +DA:754,3 +DA:754,3 +DA:755,2 +DA:755,2 +BRDA:747,28,0,2 +BRDA:747,28,1,11 +DA:759,13 +DA:759,13 +DA:762,13 +DA:762,13 +DA:762,13 +DA:762,13 +BRDA:762,29,0,2 +BRDA:762,29,1,11 +DA:762,2 +DA:765,11 +DA:765,11 DA:768,1 DA:768,1 -FN:776,Engine.isTimestampAfter +DA:772,1 +DA:772,1 +FN:780,Engine.isTimestampAfter FNDA:6,Engine.isTimestampAfter -DA:782,6 -DA:782,6 -DA:782,6 -FN:786,Engine.isTimestampBefore +DA:786,6 +DA:786,6 +DA:786,6 +FN:790,Engine.isTimestampBefore FNDA:5,Engine.isTimestampBefore -DA:792,5 -DA:792,5 -DA:792,5 -FN:796,Engine.isPriceAbove +DA:796,5 +DA:796,5 +DA:796,5 +FN:800,Engine.isPriceAbove FNDA:6,Engine.isPriceAbove -DA:802,6 -DA:802,6 -DA:802,6 -DA:807,6 -DA:807,6 -DA:807,6 -FN:811,Engine.isPriceBelow +DA:806,6 +DA:806,6 +DA:806,6 +DA:811,6 +DA:811,6 +DA:811,6 +FN:815,Engine.isPriceBelow FNDA:6,Engine.isPriceBelow -DA:817,6 -DA:817,6 -DA:817,6 -DA:822,6 -DA:822,6 -DA:822,6 -FN:826,Engine.isMarketOpen +DA:821,6 +DA:821,6 +DA:821,6 +DA:826,6 +DA:826,6 +DA:826,6 +FN:830,Engine.isMarketOpen FNDA:1,Engine.isMarketOpen -DA:832,1 -DA:832,1 -DA:832,1 -DA:832,1 -FN:836,Engine.isPositionSizeAbove +DA:836,1 +DA:836,1 +DA:836,1 +DA:836,1 +FN:840,Engine.isPositionSizeAbove FNDA:4,Engine.isPositionSizeAbove -DA:841,4 -DA:841,4 -DA:842,4 -DA:842,4 -DA:844,4 -DA:844,4 -DA:844,4 -FN:848,Engine.isPositionSizeBelow +DA:845,4 +DA:845,4 +DA:846,4 +DA:846,4 +DA:848,4 +DA:848,4 +DA:848,4 +FN:852,Engine.isPositionSizeBelow FNDA:4,Engine.isPositionSizeBelow -DA:853,4 -DA:853,4 -DA:854,4 -DA:854,4 -DA:856,4 -DA:856,4 -DA:856,4 -FN:860,Engine.isOrderFeeBelow +DA:857,4 +DA:857,4 +DA:858,4 +DA:858,4 +DA:860,4 +DA:860,4 +DA:860,4 +FN:864,Engine.isOrderFeeBelow FNDA:4,Engine.isOrderFeeBelow -DA:866,4 -DA:866,4 -DA:866,4 -DA:871,4 -DA:871,4 -DA:871,4 -FNF:34 -FNH:34 -LF:132 -LH:132 -BRF:62 -BRH:56 +DA:870,4 +DA:870,4 +DA:870,4 +DA:875,4 +DA:875,4 +DA:875,4 +FNF:33 +FNH:33 +LF:130 +LH:130 +BRF:60 +BRH:54 end_of_record TN: SF:src/libraries/ConditionalOrderHashLib.sol @@ -706,11 +585,11 @@ FNDA:262,MathLib.toInt256 DA:63,262 DA:63,262 DA:63,262 -BRDA:63,1,0,8 -BRDA:63,1,1,254 -DA:72,254 -DA:72,254 -DA:72,254 +BRDA:63,1,0,53 +BRDA:63,1,1,209 +DA:72,209 +DA:72,209 +DA:72,209 FNF:4 FNH:4 LF:6 @@ -721,7 +600,7 @@ end_of_record TN: SF:src/libraries/SignatureCheckerLib.sol FN:32,SignatureCheckerLib.isValidSignatureNowCalldata -FNDA:666,SignatureCheckerLib.isValidSignatureNowCalldata +FNDA:665,SignatureCheckerLib.isValidSignatureNowCalldata FNF:1 FNH:1 LF:0 @@ -731,37 +610,12 @@ BRH:0 end_of_record TN: SF:src/utils/EIP712.sol -FN:38,EIP712. -FNDA:530,EIP712. -DA:39,530 -DA:39,530 -DA:40,541 -DA:40,541 -DA:42,535 -DA:42,535 -DA:42,535 -DA:43,536 -DA:43,536 -DA:43,535 -DA:44,541 -DA:44,541 -DA:44,541 -DA:45,535 -DA:45,535 -DA:46,540 -DA:46,540 -DA:48,535 -DA:48,535 -DA:57,535 -DA:57,535 -DA:59,546 -DA:59,546 FN:69,EIP712._domainNameAndVersion -FNDA:537,EIP712._domainNameAndVersion -DA:74,537 -DA:74,537 -DA:75,537 -DA:75,537 +FNDA:1,EIP712._domainNameAndVersion +DA:74,1 +DA:74,1 +DA:75,1 +DA:75,1 FN:80,EIP712.DOMAIN_SEPARATOR FNDA:283,EIP712.DOMAIN_SEPARATOR DA:81,283 @@ -814,10 +668,10 @@ DA:177,558 DA:177,558 DA:180,558 DA:180,558 -FNF:7 -FNH:6 -LF:31 -LH:25 +FNF:6 +FNH:5 +LF:21 +LH:15 BRF:4 BRH:4 end_of_record @@ -839,9 +693,9 @@ SF:src/utils/MulticallablePayable.sol FN:24,MulticallablePayable.multicall FNDA:1288,MulticallablePayable.multicall DA:33,1288 -BRDA:33,0,0,132 -DA:43,1156 -DA:43,1156 +BRDA:33,0,0,126 +DA:43,1162 +DA:43,1162 FNF:1 FNH:1 LF:2 @@ -1011,197 +865,56 @@ BRH:0 end_of_record TN: SF:test/utils/Bootstrap.sol -FN:252,BootstrapOptimismGoerli.init -FNDA:0,BootstrapOptimismGoerli.init -DA:265,0 -DA:265,0 -DA:265,0 -DA:274,0 -DA:274,0 -DA:274,0 -DA:283,0 -DA:283,0 -FN:65,Bootstrap.initializeOptimism -FNDA:0,Bootstrap.initializeOptimism -DA:66,0 -DA:66,0 -DA:66,0 -DA:67,0 -DA:67,0 -DA:76,0 -DA:76,0 -DA:78,0 -DA:78,0 -DA:79,0 -DA:79,0 -DA:80,0 -DA:80,0 -DA:81,0 -DA:81,0 -DA:82,0 -DA:82,0 -DA:83,0 -DA:83,0 -DA:84,0 -DA:84,0 -DA:85,0 -DA:85,0 -DA:86,0 -DA:86,0 -DA:88,0 -DA:88,0 -DA:89,0 -DA:89,0 -DA:90,0 -DA:90,0 -DA:95,0 -DA:95,0 -DA:97,0 -DA:97,0 -FN:100,Bootstrap.initializeOptimismGoerli -FNDA:0,Bootstrap.initializeOptimismGoerli -DA:101,0 -DA:101,0 -DA:101,0 -DA:102,0 -DA:102,0 -DA:111,0 -DA:111,0 -DA:113,0 -DA:113,0 -DA:114,0 -DA:114,0 -DA:115,0 -DA:115,0 -DA:116,0 -DA:116,0 -DA:117,0 -DA:117,0 -DA:118,0 -DA:118,0 -DA:119,0 -DA:119,0 -DA:120,0 -DA:120,0 -DA:121,0 -DA:121,0 -DA:123,0 -DA:123,0 -DA:124,0 -DA:124,0 -DA:125,0 -DA:125,0 -DA:130,0 -DA:130,0 -DA:132,0 -DA:132,0 -FN:135,Bootstrap.initializeBase +FN:58,Bootstrap.initializeBase FNDA:0,Bootstrap.initializeBase -DA:136,99 -DA:136,99 -DA:136,99 -DA:137,99 -DA:137,99 -DA:146,99 -DA:146,99 -DA:148,99 -DA:148,99 -DA:149,99 -DA:149,99 -DA:150,99 -DA:150,99 -DA:151,99 -DA:151,99 -DA:152,99 -DA:152,99 -DA:153,99 -DA:153,99 -DA:154,99 -DA:154,99 -DA:155,99 -DA:155,99 -DA:156,99 -DA:156,99 -DA:158,99 -DA:158,99 -DA:159,99 -DA:159,99 -DA:160,99 -DA:160,99 -DA:165,99 -DA:165,99 -DA:167,99 -DA:167,99 -FN:170,Bootstrap.initializeBaseGoerli -FNDA:0,Bootstrap.initializeBaseGoerli -DA:171,0 -DA:171,0 -DA:171,0 -DA:172,0 -DA:172,0 -DA:181,0 -DA:181,0 -DA:183,0 -DA:183,0 -DA:184,0 -DA:184,0 -DA:185,0 -DA:185,0 -DA:186,0 -DA:186,0 -DA:187,0 -DA:187,0 -DA:188,0 -DA:188,0 -DA:189,0 -DA:189,0 -DA:190,0 -DA:190,0 -DA:191,0 -DA:191,0 -DA:193,0 -DA:193,0 -DA:194,0 -DA:194,0 -DA:195,0 -DA:195,0 -DA:200,0 -DA:200,0 -DA:202,0 -DA:202,0 -FN:297,BootstrapBase.init +DA:59,99 +DA:59,99 +DA:59,99 +DA:60,99 +DA:60,99 +DA:69,99 +DA:69,99 +DA:71,99 +DA:71,99 +DA:72,99 +DA:72,99 +DA:73,99 +DA:73,99 +DA:74,99 +DA:74,99 +DA:75,99 +DA:75,99 +DA:76,99 +DA:76,99 +DA:77,99 +DA:77,99 +DA:78,99 +DA:78,99 +DA:79,99 +DA:79,99 +DA:81,99 +DA:81,99 +DA:82,99 +DA:82,99 +DA:83,99 +DA:83,99 +DA:88,99 +DA:88,99 +DA:90,99 +DA:90,99 +FN:95,BootstrapBase.init FNDA:99,BootstrapBase.init -DA:310,99 -DA:310,99 -DA:310,99 -DA:319,99 -DA:319,99 -DA:319,99 -DA:328,99 -DA:328,99 -FN:342,BootstrapBaseGoerli.init -FNDA:0,BootstrapBaseGoerli.init -DA:355,0 -DA:355,0 -DA:355,0 -DA:364,0 -DA:364,0 -DA:364,0 -DA:373,0 -DA:373,0 -FN:207,BootstrapOptimism.init -FNDA:0,BootstrapOptimism.init -DA:220,0 -DA:220,0 -DA:220,0 -DA:229,0 -DA:229,0 -DA:229,0 -DA:238,0 -DA:238,0 -FNF:8 +DA:108,99 +DA:108,99 +DA:108,99 +DA:117,99 +DA:117,99 +DA:117,99 +DA:126,99 +DA:126,99 +FNF:2 FNH:1 -LF:80 +LF:20 LH:20 BRF:0 BRH:0 @@ -1300,10 +1013,10 @@ end_of_record TN: SF:test/utils/RandomSigner.sol FN:8,RandomSigner._random -FNDA:1316,RandomSigner._random -DA:17,1316 -DA:17,1316 -DA:20,1316 +FNDA:1315,RandomSigner._random +DA:17,1315 +DA:17,1315 +DA:20,1315 BRDA:20,0,0,257 DA:21,257 DA:21,257 @@ -1334,27 +1047,19 @@ BRH:2 end_of_record TN: SF:test/utils/SynthMinter.sol -FN:13,SynthMinter. -FNDA:0,SynthMinter. -DA:14,0 -DA:14,0 -DA:15,0 -DA:15,0 FN:18,SynthMinter.mint_sUSD FNDA:142,SynthMinter.mint_sUSD DA:19,142 DA:19,142 -FNF:2 +FNF:1 FNH:1 -LF:3 +LF:1 LH:1 BRF:0 BRH:0 end_of_record TN: SF:test/utils/exposed/EngineExposed.sol -FN:9,EngineExposed. -FNDA:0,EngineExposed. FN:27,EngineExposed.getSynthAddress FNDA:0,EngineExposed.getSynthAddress DA:32,0 @@ -1368,7 +1073,7 @@ FN:41,EngineExposed.getCreditSlot FNDA:1,EngineExposed.getCreditSlot DA:43,1 DA:43,1 -FNF:4 +FNF:3 FNH:2 LF:3 LH:2 @@ -1411,31 +1116,6 @@ BRH:3 end_of_record TN: SF:test/utils/mocks/MockEIP712.sol -FN:15,MockEIP712. -FNDA:6,MockEIP712. -DA:16,6 -DA:16,6 -DA:17,6 -DA:17,6 -DA:19,6 -DA:19,6 -DA:19,6 -DA:20,6 -DA:20,6 -DA:20,6 -DA:21,6 -DA:21,6 -DA:21,6 -DA:22,6 -DA:22,6 -DA:23,6 -DA:23,6 -DA:25,6 -DA:25,6 -DA:34,6 -DA:34,6 -DA:36,6 -DA:36,6 FN:39,MockEIP712.hashTypedData FNDA:0,MockEIP712.hashTypedData DA:44,0 @@ -1457,23 +1137,21 @@ DA:71,0 DA:71,0 DA:74,0 DA:74,0 -FNF:4 -FNH:1 -LF:17 -LH:10 +FNF:3 +FNH:0 +LF:7 +LH:0 BRF:0 BRH:0 end_of_record TN: SF:test/utils/mocks/MockEngineUpgrade.sol -FN:9,MockEngineUpgrade. -FNDA:530,MockEngineUpgrade. FN:27,MockEngineUpgrade.echo FNDA:1,MockEngineUpgrade.echo DA:28,1 DA:28,1 -FNF:2 -FNH:2 +FNF:1 +FNH:1 LF:1 LH:1 BRF:0 @@ -1498,9 +1176,9 @@ FNDA:534,MockMulticallablePayable.returnsTuple DA:34,534 DA:34,534 FN:37,MockMulticallablePayable.returnsString -FNDA:125,MockMulticallablePayable.returnsString -DA:42,125 -DA:42,125 +FNDA:131,MockMulticallablePayable.returnsString +DA:42,131 +DA:42,131 FN:47,MockMulticallablePayable.pay FNDA:0,MockMulticallablePayable.pay DA:48,0