Skip to content

Commit

Permalink
👷🏻‍♂️ Improve CannotExecuteOrder Error
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders authored May 28, 2024
2 parents 6bf2ebb + 6323908 commit 31603c2
Show file tree
Hide file tree
Showing 6 changed files with 1,114 additions and 453 deletions.
90 changes: 45 additions & 45 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 420851)
CanExecute:test_canExecute_false_invalid_signature() (gas: 455238)
CanExecute:test_canExecute_false_invalid_signer() (gas: 448229)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 403715)
CanExecute:test_canExecute_false_nonce_used() (gas: 1028874)
CanExecute:test_canExecute_false_require_verify_condition_not_met() (gas: 538419)
CanExecute:test_canExecute_false_trusted_executor() (gas: 444513)
CanExecute:test_canExecute_true() (gas: 444130)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 421074)
CanExecute:test_canExecute_false_invalid_signature() (gas: 455458)
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_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_Unauthorized() (gas: 37862)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 425887)
Expand All @@ -25,20 +25,20 @@ Conditions:test_isPriceAbove() (gas: 175814)
Conditions:test_isPriceBelow() (gas: 175643)
Conditions:test_isTimestampAfter() (gas: 13288)
Conditions:test_isTimestampBefore() (gas: 13376)
Credit:test_credit(uint256) (runs: 256, μ: 94630, ~: 105108)
Credit:test_credit(uint256) (runs: 256, μ: 96854, ~: 105108)
Credit:test_credit_event() (gas: 88151)
Credit:test_credit_zap() (gas: 677111)
Debit:test_debit(uint256) (runs: 256, μ: 136580, ~: 147259)
Debit:test_debit(uint256) (runs: 256, μ: 136737, ~: 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_zap_InsufficientBalance() (gas: 680643)
Debit:test_debit_zap_Unauthorized() (gas: 122887)
DeploymentTest:test_deploy() (gas: 4543332)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 58607)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 56011)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 55998)
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_availableMargin() (gas: 437890)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 433843)
Expand All @@ -51,62 +51,62 @@ 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: 322478)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 103691)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 469124)
Execute:test_execute_event() (gas: 635809)
Execute:test_execute_order_committed() (gas: 632376)
Fee:test_fee_exceeds_account_credit() (gas: 125039)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 124601)
Fee:test_fee_imposed() (gas: 719887)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 322511)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 103724)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 469157)
Execute:test_execute_event() (gas: 635846)
Execute:test_execute_order_committed() (gas: 632413)
Fee:test_fee_exceeds_account_credit() (gas: 125744)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 125306)
Fee:test_fee_imposed() (gas: 719924)
FulfillOracleQuery:test_fulfillOracleQuery(bytes) (runs: 256, μ: 31280, ~: 31272)
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, μ: 578, ~: 603)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 451, ~: 436)
MathLibTest:test_fuzz_toInt256(uint256) (runs: 256, μ: 1000, ~: 438)
MathLibTest:test_fuzz_abs128(int128) (runs: 256, μ: 577, ~: 603)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 450, ~: 436)
MathLibTest:test_fuzz_toInt256(uint256) (runs: 256, μ: 567, ~: 438)
MathLibTest:test_isSameSign() (gas: 999)
MathLibTest:test_toInt256() (gas: 3347)
MathLibTest:test_toInt256_overflow() (gas: 3251)
MockUpgrade:test_upgrade() (gas: 4567510)
MockUpgrade:test_upgrade_credit_state(uint256) (runs: 256, μ: 4646007, ~: 4646007)
MockUpgrade:test_upgrade_nonce_state(uint256) (runs: 256, μ: 4601314, ~: 4601314)
MockUpgrade:test_upgrade_only_pDAO() (gas: 4552610)
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)
Multicall:testMulticallablePreservesMsgSender() (gas: 11116)
Multicall:testMulticallableReturnDataIsProperlyEncoded() (gas: 11637)
Multicall:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 9680, ~: 7435)
Multicall:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 9570, ~: 7423)
Multicall:testMulticallableReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 11695, ~: 11695)
Multicall:testMulticallableRevertWithCustomError() (gas: 11746)
Multicall:testMulticallableRevertWithMessage() (gas: 13451)
Multicall:testMulticallableRevertWithMessage(string) (runs: 256, μ: 14138, ~: 14177)
Multicall:testMulticallableRevertWithMessage(string) (runs: 256, μ: 14035, ~: 13883)
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, μ: 58059, ~: 58059)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 59813)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 83116)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 196587)
NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 58094, ~: 58094)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 59883)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 83563)
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: 634098)
ReduceOnly:test_reduce_only_same_sign() (gas: 77892)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 634238)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 614783)
ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 166346)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 166380)
RemoveUpgradability:test_removeUpgradability() (gas: 4537931)
SignatureCheckerLibTest:testSignatureChecker(bytes32) (runs: 256, μ: 31623, ~: 28584)
SignatureCheckerLibTest:test_isValidSignatureNowCalldata(address,bytes32,bytes) (runs: 256, μ: 35465847065546046, ~: 3451)
ReduceOnly:test_reduce_only() (gas: 634127)
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_when_position_doesnt_exist() (gas: 167039)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 167073)
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)
StorageLayout:test_nonceBitmap_slot() (gas: 5520)
VerifyConditions:test_max_condition_size_exceeded() (gas: 51317)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 19085)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 19096)
VerifyConditions:test_verify_conditions_not_verified() (gas: 127923)
VerifyConditions:test_verify_conditions_verified() (gas: 175747)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 30169, ~: 30169)
Expand Down
Loading

0 comments on commit 31603c2

Please sign in to comment.