Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷🏻‍♂️ Make Engine Upgradable #36

Merged
merged 15 commits into from
Dec 20, 2023
Merged
169 changes: 87 additions & 82 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,72 +1,76 @@
AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26492)
AccountDelegate:test_isAccountDelegate_false() (gas: 392017)
AccountDelegate:test_isAccountDelegate_true() (gas: 389964)
AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 23181)
AccountOwner:test_isAccountOwner_account_doesnt_exist() (gas: 25044)
AccountOwner:test_isAccountOwner_false() (gas: 229891)
AccountOwner:test_isAccountOwner_true() (gas: 229814)
AccountOwner:test_isAccountOwner_zero_address_caller() (gas: 10785)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 414884)
CanExecute:test_canExecute_false_invalid_signature() (gas: 448966)
CanExecute:test_canExecute_false_invalid_signer() (gas: 442163)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 397594)
CanExecute:test_canExecute_false_nonce_used() (gas: 825200)
CanExecute:test_canExecute_false_require_verify_condition_not_met() (gas: 532204)
CanExecute:test_canExecute_false_trusted_executor() (gas: 438771)
CanExecute:test_canExecute_true() (gas: 438410)
CommitOrder:test_commitOrder() (gas: 382992)
CommitOrder:test_commitOrder_Unauthorized() (gas: 33029)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 441149)
CommitOrder:test_commitOrder_invalid_market() (gas: 38262)
Conditions:test_isMarketOpen() (gas: 26596)
Conditions:test_isOrderFeeBelow() (gas: 179828)
Conditions:test_isPositionSizeAbove() (gas: 18893)
Conditions:test_isPositionSizeBelow() (gas: 18863)
Conditions:test_isPriceAbove() (gas: 196473)
Conditions:test_isPriceBelow() (gas: 196438)
Conditions:test_isTimestampAfter() (gas: 7668)
Conditions:test_isTimestampBefore() (gas: 7645)
Credit:test_credit(uint256) (runs: 256, μ: 102617, ~: 112702)
Credit:test_credit_AccountDoesNotExist() (gas: 28011)
Credit:test_credit_event() (gas: 97230)
Debit:test_debit(uint256) (runs: 256, μ: 133085, ~: 142379)
Debit:test_debit_InsufficientBalance() (gas: 119995)
Debit:test_debit_Unauthorized() (gas: 120025)
Debit:test_debit_event() (gas: 102161)
DeploymentTest:test_deploy() (gas: 3094956)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 42548)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 42615)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 42606)
DepositCollateral:test_depositCollateral() (gas: 258395)
DepositCollateral:test_depositCollateral_availableMargin() (gas: 265963)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 259016)
DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 55978)
DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 263325)
AccountDelegate:test_isAccountDelegate_false() (gas: 396923)
AccountDelegate:test_isAccountDelegate_true() (gas: 394870)
AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 28087)
AccountOwner:test_isAccountOwner_account_doesnt_exist() (gas: 29906)
AccountOwner:test_isAccountOwner_false() (gas: 234753)
AccountOwner:test_isAccountOwner_true() (gas: 234676)
AccountOwner:test_isAccountOwner_zero_address_caller() (gas: 15647)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 420796)
CanExecute:test_canExecute_false_invalid_signature() (gas: 455166)
CanExecute:test_canExecute_false_invalid_signer() (gas: 448221)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 403646)
CanExecute:test_canExecute_false_nonce_used() (gas: 831410)
CanExecute:test_canExecute_false_require_verify_condition_not_met() (gas: 538325)
CanExecute:test_canExecute_false_trusted_executor() (gas: 444486)
CanExecute:test_canExecute_true() (gas: 444080)
CommitOrder:test_commitOrder() (gas: 387933)
CommitOrder:test_commitOrder_Unauthorized() (gas: 37944)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 446067)
CommitOrder:test_commitOrder_invalid_market() (gas: 43202)
Conditions:test_isMarketOpen() (gas: 31858)
Conditions:test_isOrderFeeBelow() (gas: 185520)
Conditions:test_isPositionSizeAbove() (gas: 24560)
Conditions:test_isPositionSizeBelow() (gas: 24468)
Conditions:test_isPriceAbove() (gas: 202533)
Conditions:test_isPriceBelow() (gas: 202498)
Conditions:test_isTimestampAfter() (gas: 13288)
Conditions:test_isTimestampBefore() (gas: 13288)
Credit:test_credit(uint256) (runs: 256, μ: 107465, ~: 117605)
Credit:test_credit_AccountDoesNotExist() (gas: 32831)
Credit:test_credit_event() (gas: 102066)
Debit:test_debit(uint256) (runs: 256, μ: 138131, ~: 148022)
Debit:test_debit_InsufficientBalance() (gas: 125261)
Debit:test_debit_Unauthorized() (gas: 125291)
Debit:test_debit_event() (gas: 106371)
DeploymentTest:test_deploy() (gas: 3590064)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 43343)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 43366)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 43423)
DepositCollateral:test_depositCollateral() (gas: 263304)
DepositCollateral:test_depositCollateral_availableMargin() (gas: 270872)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 263858)
DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 60810)
DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 268212)
EIP712Test:test_DOMAIN_SEPARATOR() (gas: 165)
EIP712Test:test_buildDomainSeparator() (gas: 165)
EIP712Test:test_cachedDomainSeparatorInvalidated() (gas: 144)
EIP712Test:test_constructor() (gas: 164)
EIP712Test:test_domainNameAndVersion() (gas: 1261)
EIP712Test:test_eip712Domain() (gas: 187)
EIP712Test:test_hashTypedData() (gas: 187)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 329711)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 95632)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 360306)
Execute:test_execute_event() (gas: 432759)
Execute:test_execute_order_committed() (gas: 429206)
Fee:test_fee_exceeds_account_credit() (gas: 133066)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 132599)
Fee:test_fee_imposed() (gas: 518738)
FulfillOracleQuery:test_fulfillOracleQuery(bytes) (runs: 256, μ: 26404, ~: 26400)
FulfillOracleQuery:test_fulfillOracleQuery_refund(bytes) (runs: 256, μ: 35041, ~: 35037)
FulfillOracleQuery:test_fulfillOracleQuery_revert(bytes) (runs: 256, μ: 28105, ~: 28101)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 335437)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 101310)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 365987)
Execute:test_execute_event() (gas: 438457)
Execute:test_execute_order_committed() (gas: 434904)
Fee:test_fee_exceeds_account_credit() (gas: 138974)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 138485)
Fee:test_fee_imposed() (gas: 524817)
FulfillOracleQuery:test_fulfillOracleQuery(bytes) (runs: 256, μ: 31323, ~: 31315)
FulfillOracleQuery:test_fulfillOracleQuery_refund(bytes) (runs: 256, μ: 40346, ~: 40338)
FulfillOracleQuery:test_fulfillOracleQuery_revert(bytes) (runs: 256, μ: 32970, ~: 32962)
MathLibTest:test_abs128() (gas: 425)
MathLibTest:test_abs256() (gas: 480)
MathLibTest:test_fuzz_abs128(int128) (runs: 256, μ: 577, ~: 603)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 472, ~: 458)
MathLibTest:test_isSameSign() (gas: 999)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall(bytes) (runs: 256, μ: 29315, ~: 29258)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall_double_spend(bytes) (runs: 256, μ: 41932, ~: 41822)
MockUpgrade:test_upgrade() (gas: 3575535)
MockUpgrade:test_upgrade_credit_state(uint256) (runs: 256, μ: 3670043, ~: 3670043)
MockUpgrade:test_upgrade_nonce_state(uint256) (runs: 256, μ: 3611256, ~: 3611256)
MockUpgrade:test_upgrade_only_pDAO() (gas: 3560685)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall(bytes) (runs: 256, μ: 34651, ~: 34586)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall_double_spend(bytes) (runs: 256, μ: 47701, ~: 47575)
MulticallablePayableTest:testMulticallableBenchmark() (gas: 29229)
MulticallablePayableTest:testMulticallableOriginalBenchmark() (gas: 38407)
MulticallablePayableTest:testMulticallablePreservesMsgSender() (gas: 11065)
Expand All @@ -78,30 +82,31 @@ MulticallablePayableTest:testMulticallableRevertWithMessage() (gas: 13406)
MulticallablePayableTest:testMulticallableRevertWithMessage(string) (runs: 256, μ: 14013, ~: 13861)
MulticallablePayableTest:testMulticallableRevertWithNothing() (gas: 11633)
MulticallablePayableTest:testMulticallableWithNoData() (gas: 6266)
NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 52689, ~: 52689)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 53955)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 76562)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 190184)
NonceBitmapTest:test_invalidateUnorderedNonces_Unauthorized() (gas: 30607)
NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 53396)
ReduceOnly:test_reduce_only() (gas: 430941)
ReduceOnly:test_reduce_only_same_sign() (gas: 72142)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 431027)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 407776)
ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 162529)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 162586)
NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 58005, ~: 58005)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 59703)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 83122)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 196322)
NonceBitmapTest:test_invalidateUnorderedNonces_Unauthorized() (gas: 35565)
NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 58283)
ReduceOnly:test_reduce_only() (gas: 436631)
ReduceOnly:test_reduce_only_same_sign() (gas: 77813)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 436739)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 413488)
ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 168200)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 168257)
RemoveUpgradability:test_removeUpgradability() (gas: 3539625)
SignatureCheckerLibTest:test_isValidSignatureNowCalldata(address,bytes32,bytes) (runs: 256, μ: 35465847065546049, ~: 3474)
VerifyConditions:test_max_condition_size_exceeded() (gas: 45057)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14088)
VerifyConditions:test_verify_conditions_not_verified() (gas: 129563)
VerifyConditions:test_verify_conditions_verified() (gas: 184166)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 24445, ~: 24445)
VerifySignature:test_verifySignature_false_private_key() (gas: 27166)
VerifySigner:test_verifySigner() (gas: 25917)
VerifySigner:test_verifySigner_false() (gas: 28647)
WithdrawCollateral:test_withdrawCollateral() (gas: 353029)
WithdrawCollateral:test_withdrawCollateral_availableMargin() (gas: 354583)
WithdrawCollateral:test_withdrawCollateral_collateralAmount() (gas: 353557)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 274007)
WithdrawCollateral:test_withdrawCollateral_totalCollateralValue() (gas: 354046)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 265965)
VerifyConditions:test_max_condition_size_exceeded() (gas: 51339)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 19107)
VerifyConditions:test_verify_conditions_not_verified() (gas: 136154)
VerifyConditions:test_verify_conditions_verified() (gas: 192508)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 30147, ~: 30147)
VerifySignature:test_verifySignature_false_private_key() (gas: 32855)
VerifySigner:test_verifySigner() (gas: 30907)
VerifySigner:test_verifySigner_false() (gas: 33615)
WithdrawCollateral:test_withdrawCollateral() (gas: 357248)
WithdrawCollateral:test_withdrawCollateral_availableMargin() (gas: 358802)
WithdrawCollateral:test_withdrawCollateral_collateralAmount() (gas: 357776)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 279294)
WithdrawCollateral:test_withdrawCollateral_totalCollateralValue() (gas: 358283)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 271246)
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
Loading
Loading