From 1ae6ad994d65637fd2d820f15ef7e4040080d0d8 Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Wed, 25 Oct 2023 11:47:12 -0400 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F=20Update=20nonce=20type=20in=20library?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libraries/ConditionalOrderHashLib.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/ConditionalOrderHashLib.sol b/src/libraries/ConditionalOrderHashLib.sol index 5956c663..25f02600 100644 --- a/src/libraries/ConditionalOrderHashLib.sol +++ b/src/libraries/ConditionalOrderHashLib.sol @@ -14,7 +14,7 @@ library ConditionalOrderHashLib { /// @notice pre-computed keccak256(ConditionalOrder struct) bytes32 public constant _CONDITIONAL_ORDER_TYPEHASH = keccak256( - "ConditionalOrder(OrderDetails orderDetails,address signer,uint128 nonce,bool requireVerified,address trustedExecutor,uint256 maxExecutorFee,bytes[] conditions)OrderDetails(uint128 marketId,uint128 accountId,int128 sizeDelta,uint128 settlementStrategyId,uint256 acceptablePrice,bool isReduceOnly,bytes32 trackingCode,address referrer)" + "ConditionalOrder(OrderDetails orderDetails,address signer,uint256 nonce,bool requireVerified,address trustedExecutor,uint256 maxExecutorFee,bytes[] conditions)OrderDetails(uint128 marketId,uint128 accountId,int128 sizeDelta,uint128 settlementStrategyId,uint256 acceptablePrice,bool isReduceOnly,bytes32 trackingCode,address referrer)" ); /// @notice hash the OrderDetails struct From 6b9cecf42c88ca8fd8e5a6b66c064a746787bdef Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Wed, 25 Oct 2023 11:47:31 -0400 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=85=20Update=20nonce=20type=20in=20te?= =?UTF-8?q?st=20util?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/ConditionalOrderSignature.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/ConditionalOrderSignature.sol b/test/utils/ConditionalOrderSignature.sol index 82585d10..be7802e9 100644 --- a/test/utils/ConditionalOrderSignature.sol +++ b/test/utils/ConditionalOrderSignature.sol @@ -15,7 +15,7 @@ contract ConditionalOrderSignature { /// @notice pre-computed keccak256(ConditionalOrder struct) bytes32 public constant _CONDITIONAL_ORDER_TYPEHASH = keccak256( - "ConditionalOrder(OrderDetails orderDetails,address signer,uint128 nonce,bool requireVerified,address trustedExecutor,uint256 maxExecutorFee,bytes[] conditions)OrderDetails(uint128 marketId,uint128 accountId,int128 sizeDelta,uint128 settlementStrategyId,uint256 acceptablePrice,bool isReduceOnly,bytes32 trackingCode,address referrer)" + "ConditionalOrder(OrderDetails orderDetails,address signer,uint256 nonce,bool requireVerified,address trustedExecutor,uint256 maxExecutorFee,bytes[] conditions)OrderDetails(uint128 marketId,uint128 accountId,int128 sizeDelta,uint128 settlementStrategyId,uint256 acceptablePrice,bool isReduceOnly,bytes32 trackingCode,address referrer)" ); function getConditionalOrderSignatureRaw( From f5e0eaa5370d1d1284aa884953675cdc16dc28ab Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Wed, 25 Oct 2023 12:03:00 -0400 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=85=20Fuzz=20nonce=20in=20verifySigna?= =?UTF-8?q?ture=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/ConditionalOrder.t.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ConditionalOrder.t.sol b/test/ConditionalOrder.t.sol index 92bdb326..fd0910a9 100644 --- a/test/ConditionalOrder.t.sol +++ b/test/ConditionalOrder.t.sol @@ -233,7 +233,7 @@ contract VerifySigner is ConditionalOrderTest { } contract VerifySignature is ConditionalOrderTest { - function test_verifySignature() public { + function test_verifySignature(uint256 fuzzyNonce) public { IEngine.OrderDetails memory orderDetails = IEngine.OrderDetails({ marketId: 0, accountId: 0, @@ -248,7 +248,7 @@ contract VerifySignature is ConditionalOrderTest { IEngine.ConditionalOrder memory co = IEngine.ConditionalOrder({ orderDetails: orderDetails, signer: signer, - nonce: 0, + nonce: fuzzyNonce, requireVerified: false, trustedExecutor: address(this), maxExecutorFee: type(uint256).max, From 308520edba1140285029ae91e0095a58dfb7f9cc Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Wed, 25 Oct 2023 12:18:42 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=9A=80=20Deploy=20SMv3=20to=20Testnet?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployments/BaseGoerli.json | 4 ++-- deployments/OptimismGoerli.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployments/BaseGoerli.json b/deployments/BaseGoerli.json index 0e610090..ccfc3238 100644 --- a/deployments/BaseGoerli.json +++ b/deployments/BaseGoerli.json @@ -1,4 +1,4 @@ { - "Engine": "0xD56b9537ee5E0779F0522475525053eE614b07Ba", - "TrustedMulticallForwarder": "0xF84CcAD694ad8F37495b25D3Dd11edAd33d69Fb2" + "Engine": "0x91DFAbeb5a6DEf989a227A2D091589cf6Cd37f36", + "TrustedMulticallForwarder": "0x79bB35A27bfC441b21078debeE52DE3215106A5B" } \ No newline at end of file diff --git a/deployments/OptimismGoerli.json b/deployments/OptimismGoerli.json index 6961bfc4..882e5f5f 100644 --- a/deployments/OptimismGoerli.json +++ b/deployments/OptimismGoerli.json @@ -1,4 +1,4 @@ { - "Engine": "0xAF9C3649db02B97100aD99801613C8166516E486", - "TrustedMulticallForwarder": "0x00681795118B33814B5B53D8A2d43b5ff71e1Fd7" + "Engine": "0xb120612084CffFF52c2B005597C3d738124C4193", + "TrustedMulticallForwarder": "0xe8bd72765CAED2Ce995B06Fbf51c9c8fDea3f47C" } \ No newline at end of file From fe9aea67e92446bc9432b44cbef8a7f0d9c8271b Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Wed, 25 Oct 2023 12:21:28 -0400 Subject: [PATCH 5/5] =?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 | 6 ++--- lcov.info | 74 +++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 4cd3686b..f4394fda 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -22,7 +22,7 @@ Conditions:test_isPriceAbove() (gas: 19186) Conditions:test_isPriceBelow() (gas: 19092) Conditions:test_isTimestampAfter() (gas: 7711) Conditions:test_isTimestampBefore() (gas: 7645) -DeploymentTest:test_deploy() (gas: 4550522) +DeploymentTest:test_deploy() (gas: 4550600) DeploymentTest:test_deploy_oracle_zero_address() (gas: 1681379) DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 1681295) DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 1681362) @@ -30,7 +30,7 @@ DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 1681375) DeploymentTest:test_deploy_trusted_forwarder_zero_address() (gas: 37411) Deposit:test_depositEth() (gas: 40987) Deposit:test_depositEth_event() (gas: 42524) -Deposit:test_depositEth_fuzz(uint256,uint128) (runs: 256, μ: 39369, ~: 40409) +Deposit:test_depositEth_fuzz(uint256,uint128) (runs: 256, μ: 39473, ~: 40409) Deposit:test_depositEth_via_trustedForwarder() (gas: 68274) Deposit:test_depositEth_via_trustedForwarder_value_mismatch() (gas: 72575) DepositCollateral:test_depositCollateral() (gas: 258530) @@ -68,7 +68,7 @@ VerifyConditions:test_max_condition_size_exceeded() (gas: 45101) VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14132) VerifyConditions:test_verify_conditions_not_verified() (gas: 29751) VerifyConditions:test_verify_conditions_verified() (gas: 135901) -VerifySignature:test_verifySignature() (gas: 23931) +VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 24009, ~: 24009) VerifySignature:test_verifySignature_false_private_key() (gas: 26685) VerifySigner:test_verifySigner() (gas: 25884) VerifySigner:test_verifySigner_false() (gas: 28636) diff --git a/lcov.info b/lcov.info index 927dfc35..9d5cf331 100644 --- a/lcov.info +++ b/lcov.info @@ -1,17 +1,15 @@ TN: SF:script/Deploy.s.sol +FN:24,Setup.deploySystem +FNDA:5,Setup.deploySystem +DA:36,5 +DA:38,5 FN:90,DeployOptimism.run FNDA:0,DeployOptimism.run DA:91,0 DA:92,0 DA:94,0 DA:101,0 -FN:71,DeployBaseGoerli.run -FNDA:0,DeployBaseGoerli.run -DA:72,0 -DA:73,0 -DA:75,0 -DA:82,0 FN:109,DeployOptimismGoerli.run FNDA:0,DeployOptimismGoerli.run DA:110,0 @@ -24,10 +22,12 @@ DA:53,0 DA:54,0 DA:56,0 DA:63,0 -FN:24,Setup.deploySystem -FNDA:5,Setup.deploySystem -DA:36,5 -DA:38,5 +FN:71,DeployBaseGoerli.run +FNDA:0,DeployBaseGoerli.run +DA:72,0 +DA:73,0 +DA:75,0 +DA:82,0 FNF:5 FNH:1 LF:18 @@ -185,8 +185,8 @@ FN:561,Engine.verifySigner FNDA:2,Engine.verifySigner DA:567,19 FN:571,Engine.verifySignature -FNDA:2,Engine.verifySignature -DA:575,18 +FNDA:257,Engine.verifySignature +DA:575,273 FN:581,Engine.verifyConditions FNDA:4,Engine.verifyConditions DA:587,4 @@ -315,20 +315,20 @@ FNDA:0,EIP712._domainNameAndVersion DA:74,0 DA:75,0 FN:80,EIP712.DOMAIN_SEPARATOR -FNDA:26,EIP712.DOMAIN_SEPARATOR -DA:81,26 -DA:82,26 +FNDA:281,EIP712.DOMAIN_SEPARATOR +DA:81,281 +DA:82,281 BRDA:82,0,0,- -BRDA:82,0,1,26 +BRDA:82,0,1,281 DA:83,0 FN:100,EIP712._hashTypedData -FNDA:18,EIP712._hashTypedData -DA:105,18 -DA:106,18 +FNDA:273,EIP712._hashTypedData +DA:105,273 +DA:106,273 BRDA:106,1,0,- -BRDA:106,1,1,18 +BRDA:106,1,1,273 DA:107,0 -DA:115,18 +DA:115,273 FN:127,EIP712.eip712Domain FNDA:0,EIP712.eip712Domain DA:140,0 @@ -343,10 +343,10 @@ DA:154,0 DA:155,0 DA:164,0 FN:169,EIP712._cachedDomainSeparatorInvalidated -FNDA:44,EIP712._cachedDomainSeparatorInvalidated -DA:174,44 -DA:175,44 -DA:178,44 +FNDA:554,EIP712._cachedDomainSeparatorInvalidated +DA:174,554 +DA:175,554 +DA:178,554 FNF:6 FNH:3 LF:21 @@ -448,6 +448,18 @@ BRH:0 end_of_record TN: SF:test/utils/Bootstrap.sol +FN:146,BootstrapOptimismGoerli.init +FNDA:0,BootstrapOptimismGoerli.init +DA:150,0 +DA:151,0 +DA:158,0 +DA:166,0 +FN:113,BootstrapOptimism.init +FNDA:0,BootstrapOptimism.init +DA:117,0 +DA:118,0 +DA:125,0 +DA:133,0 FN:41,Bootstrap.initializeOptimismGoerli FNDA:0,Bootstrap.initializeOptimismGoerli DA:42,0 @@ -486,18 +498,6 @@ DA:100,0 DA:101,0 DA:106,0 DA:108,0 -FN:146,BootstrapOptimismGoerli.init -FNDA:0,BootstrapOptimismGoerli.init -DA:150,0 -DA:151,0 -DA:158,0 -DA:166,0 -FN:113,BootstrapOptimism.init -FNDA:0,BootstrapOptimism.init -DA:117,0 -DA:118,0 -DA:125,0 -DA:133,0 FNF:4 FNH:0 LF:42