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

🔎 [M-02] fulfillOracleQuery #24

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c4f6614
📚 Update docs
JaredBorders Dec 4, 2023
dca5f4c
✅ Improve tests
JaredBorders Dec 4, 2023
3b2f1a1
✨ Prettify
JaredBorders Dec 4, 2023
2e1e974
📸 Update gas-snapshot/lcov
JaredBorders Dec 4, 2023
ae5c23d
📚 Update natspec
JaredBorders Dec 4, 2023
e3c0de5
👷🏻‍♂️ Add check for reduce-only co specifying zero size delta to prev…
JaredBorders Dec 5, 2023
f9dec95
✅ Add test for zero size delta reduce-only co
JaredBorders Dec 5, 2023
7440b62
👷🏻‍♂️ Replace Solady with OZ ECDSA Library
JaredBorders Dec 5, 2023
309139c
👷🏻‍♂️ Update sig verification logic
JaredBorders Dec 5, 2023
771c3ce
🗑️ Remove unused code
JaredBorders Dec 5, 2023
ed856a5
📚 Improve docs
JaredBorders Dec 5, 2023
721171a
📸 Update gas-snapshot/lcov
JaredBorders Dec 5, 2023
7aec488
✂️ Trim IPyth
JaredBorders Dec 5, 2023
d811436
✂️ Trim IERC7412
JaredBorders Dec 5, 2023
32d3793
✂️ Trim IPerpsMarketProxy
JaredBorders Dec 5, 2023
543a34c
✅ Add interface to tests
JaredBorders Dec 5, 2023
77ceb54
✨ Prettify
JaredBorders Dec 5, 2023
3ecb7bc
✨ Prettify
JaredBorders Dec 5, 2023
272e30d
📸 Update gas-snapshot/lcov
JaredBorders Dec 5, 2023
c40d38c
👷🏻‍♂️ Add logic check to authentication
JaredBorders Dec 5, 2023
cacc5a3
✅ Test new logic
JaredBorders Dec 5, 2023
a175ec7
📸 Update gas-snapshot/lcov
JaredBorders Dec 5, 2023
23bb0a3
📚 Updates docs
JaredBorders Dec 6, 2023
85f744b
🗑️ Remove cast
JaredBorders Dec 6, 2023
d96e51c
📸 Update gas-snapshot/lcov
JaredBorders Dec 6, 2023
e1ad372
🗑️ Remove lib function
JaredBorders Dec 6, 2023
c28c24b
🗑️ Remove test
JaredBorders Dec 6, 2023
d58bba2
📸 Update gas-snapshot/lcov
JaredBorders Dec 6, 2023
a4076e8
🔎 [N-09] Unused Code
JaredBorders Dec 7, 2023
bb67493
🔎 [N-08] Unnecessary Cast
JaredBorders Dec 7, 2023
f884e3b
🔎 [N-04] Documentation Issues
JaredBorders Dec 7, 2023
8f88fb2
🔎 [L-08] Insufficient Input Validation
JaredBorders Dec 7, 2023
8cbea98
🔎 [L-07] Inclusion of Full External Interfaces Is Error-Prone
JaredBorders Dec 7, 2023
a1b475c
🔎 [M-03 & L-04] Executor Griefing Mitigations
JaredBorders Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 66 additions & 63 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,84 +1,87 @@
AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26514)
AccountDelegate:test_isAccountDelegate_false() (gas: 391969)
AccountDelegate:test_isAccountDelegate_true() (gas: 389938)
AccountOwner:test_isAccountOwner_account_doesnt_exist() (gas: 25032)
AccountOwner:test_isAccountOwner_false() (gas: 229812)
AccountOwner:test_isAccountOwner_true() (gas: 229802)
AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26492)
AccountDelegate:test_isAccountDelegate_false() (gas: 391973)
AccountDelegate:test_isAccountDelegate_true() (gas: 389942)
AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 23137)
AccountOwner:test_isAccountOwner_account_doesnt_exist() (gas: 25066)
AccountOwner:test_isAccountOwner_false() (gas: 229891)
AccountOwner:test_isAccountOwner_true() (gas: 229814)
AccountOwner:test_isAccountOwner_zero_address_caller() (gas: 10830)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 414865)
CanExecute:test_canExecute_false_invalid_signature() (gas: 448920)
CanExecute:test_canExecute_false_invalid_signer() (gas: 442079)
CanExecute:test_canExecute_false_invalid_signature() (gas: 446821)
CanExecute:test_canExecute_false_invalid_signer() (gas: 442110)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 397600)
CanExecute:test_canExecute_false_nonce_used() (gas: 826183)
CanExecute:test_canExecute_false_trusted_executor() (gas: 438724)
CanExecute:test_canExecute_true() (gas: 438318)
CommitOrder:test_commitOrder() (gas: 382895)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 441137)
CommitOrder:test_commitOrder_invalid_market() (gas: 38252)
Conditions:test_isMarketOpen() (gas: 26619)
CanExecute:test_canExecute_false_nonce_used() (gas: 826820)
CanExecute:test_canExecute_false_trusted_executor() (gas: 439348)
CanExecute:test_canExecute_true() (gas: 438987)
CommitOrder:test_commitOrder() (gas: 382926)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 441146)
CommitOrder:test_commitOrder_invalid_market() (gas: 38283)
Conditions:test_isMarketOpen() (gas: 26596)
Conditions:test_isOrderFeeBelow() (gas: 179894)
Conditions:test_isPositionSizeAbove() (gas: 18801)
Conditions:test_isPositionSizeBelow() (gas: 18806)
Conditions:test_isPriceAbove() (gas: 19098)
Conditions:test_isPriceBelow() (gas: 19070)
Conditions:test_isTimestampAfter() (gas: 7668)
Conditions:test_isTimestampBefore() (gas: 7668)
DeploymentTest:test_deploy() (gas: 2956698)
DeploymentTest:test_deploy_oracle_zero_address() (gas: 42752)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 42646)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 42669)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 42748)
Deposit:test_depositEth() (gas: 55243)
Deposit:test_depositEth_Account_Doesnt_Exist() (gas: 34314)
Deposit:test_depositEth_event() (gas: 56770)
Deposit:test_depositEth_fuzz(uint256,uint128) (runs: 256, μ: 36573, ~: 34889)
DeploymentTest:test_deploy() (gas: 3093637)
DeploymentTest:test_deploy_oracle_zero_address() (gas: 42919)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 42813)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 42836)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 42915)
Deposit:test_depositEth() (gas: 55221)
Deposit:test_depositEth_Account_Doesnt_Exist() (gas: 34292)
Deposit:test_depositEth_event() (gas: 56837)
Deposit:test_depositEth_fuzz(uint256,uint128) (runs: 256, μ: 36624, ~: 34844)
DepositCollateral:test_depositCollateral() (gas: 258418)
DepositCollateral:test_depositCollateral_availableMargin() (gas: 265986)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 258994)
DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 55936)
DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 263370)
EIP7412Test:test_fulfillOracleQuery(bytes) (runs: 256, μ: 149614, ~: 149516)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 330775)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 96651)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 361348)
Execute:test_execute_event() (gas: 433757)
Execute:test_execute_order_committed() (gas: 430249)
Fee:test_fee_exceeds_account_credit() (gas: 67929)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 67530)
Fee:test_fee_imposed() (gas: 468460)
MathLibTest:test_abs128() (gas: 448)
EIP7412Test:test_fulfillOracleQuery(bytes) (runs: 256, μ: 152546, ~: 152542)
EIP7412Test:test_fulfillOracleQuery_refund(bytes) (runs: 256, μ: 161835, ~: 161831)
EIP7412Test:test_fulfillOracleQuery_revert(bytes) (runs: 256, μ: 154898, ~: 154894)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 331389)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 97310)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 362028)
Execute:test_execute_event() (gas: 434372)
Execute:test_execute_order_committed() (gas: 430886)
Fee:test_fee_exceeds_account_credit() (gas: 67971)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 67506)
Fee:test_fee_imposed() (gas: 469073)
MathLibTest:test_abs128() (gas: 425)
MathLibTest:test_abs256() (gas: 480)
MathLibTest:test_castU128() (gas: 350)
MathLibTest:test_castU128_overflow() (gas: 3509)
MathLibTest:test_fuzz_abs128(int128) (runs: 256, μ: 577, ~: 603)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 472, ~: 458)
MathLibTest:test_isSameSign() (gas: 999)
NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 52614, ~: 52614)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 53925)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 76347)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 190012)
NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 53353)
ReduceOnly:test_reduce_only() (gas: 431949)
ReduceOnly:test_reduce_only_same_sign() (gas: 72305)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 432056)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 408718)
ReduceOnly:test_reduce_only_zero_size() (gas: 162822)
NonceBitmapTest:test_fuzz_invalidateUnorderedNonces(uint256) (runs: 256, μ: 52645, ~: 52645)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 53956)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 77024)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 190074)
NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 53384)
ReduceOnly:test_reduce_only() (gas: 432664)
ReduceOnly:test_reduce_only_same_sign() (gas: 73593)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 432706)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 409455)
ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 163438)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 164022)
VerifyConditions:test_max_condition_size_exceeded() (gas: 45079)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14110)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14111)
VerifyConditions:test_verify_conditions_not_verified() (gas: 29685)
VerifyConditions:test_verify_conditions_verified() (gas: 135880)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 24402, ~: 24402)
VerifySignature:test_verifySignature_false_private_key() (gas: 27145)
VerifySigner:test_verifySigner() (gas: 25908)
VerifySigner:test_verifySigner_false() (gas: 28616)
Withdraw:test_withdrawEth() (gas: 52456)
Withdraw:test_withdrawEth_EthTransferFailed() (gas: 92980)
Withdraw:test_withdrawEth_InsufficientEthBalance() (gas: 59670)
Withdraw:test_withdrawEth_Unauthorized() (gas: 59310)
Withdraw:test_withdrawEth_event() (gas: 51718)
Withdraw:test_withdrawEth_fuzz(uint256) (runs: 256, μ: 70799, ~: 71375)
WithdrawCollateral:test_withdrawCollateral() (gas: 353056)
WithdrawCollateral:test_withdrawCollateral_availableMargin() (gas: 354575)
WithdrawCollateral:test_withdrawCollateral_collateralAmount() (gas: 353567)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 274019)
WithdrawCollateral:test_withdrawCollateral_totalCollateralValue() (gas: 354073)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 265977)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 25016, ~: 25016)
VerifySignature:test_verifySignature_false_private_key() (gas: 24992)
VerifySigner:test_verifySigner() (gas: 25917)
VerifySigner:test_verifySigner_false() (gas: 28647)
Withdraw:test_withdrawEth() (gas: 52484)
Withdraw:test_withdrawEth_EthTransferFailed() (gas: 92992)
Withdraw:test_withdrawEth_InsufficientEthBalance() (gas: 59659)
Withdraw:test_withdrawEth_Unauthorized() (gas: 59409)
Withdraw:test_withdrawEth_event() (gas: 51728)
Withdraw:test_withdrawEth_fuzz(uint256) (runs: 256, μ: 70837, ~: 71387)
WithdrawCollateral:test_withdrawCollateral() (gas: 353084)
WithdrawCollateral:test_withdrawCollateral_availableMargin() (gas: 354602)
WithdrawCollateral:test_withdrawCollateral_collateralAmount() (gas: 353594)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 274053)
WithdrawCollateral:test_withdrawCollateral_totalCollateralValue() (gas: 354100)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 266011)
Loading
Loading