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

🏅 Guhu Audit Response #31

Merged
merged 105 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
b78ab49
🗑️ Remove git module
JaredBorders Dec 4, 2023
4b89315
🗑️ Remove Trusted Multicall Forwarder
JaredBorders Dec 4, 2023
f83f7a2
👷🏻‍♂️ Update Engine to not rely on ERC2771Context
JaredBorders Dec 4, 2023
9f9e547
✅ Update mocks
JaredBorders Dec 4, 2023
aa17a45
✅ Update tests
JaredBorders Dec 4, 2023
bccbbea
🚀 Update deployment logic/records
JaredBorders Dec 4, 2023
727df06
📸 Update gas-snapshot/lcov
JaredBorders Dec 4, 2023
97ced46
📚 Update README
JaredBorders Dec 4, 2023
2b3b780
✅ Update hh test
JaredBorders Dec 4, 2023
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
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
a3e2286
🗑️ Remove comment
JaredBorders Dec 6, 2023
3fe7212
👷🏻‍♂️ Create forwarder
JaredBorders Dec 6, 2023
eca5915
⛳️ Increment unchecked
JaredBorders Dec 6, 2023
c38ba08
forge install: openzeppelin-contracts
JaredBorders Dec 7, 2023
9dd6a36
✂️ Significantly trim trusted forwarder
JaredBorders Dec 7, 2023
6607d3d
✨ Prettify
JaredBorders Dec 7, 2023
a5acf7d
👷🏻‍♂️ Draft Minimal Trusted Forwarder
JaredBorders Dec 7, 2023
1919292
👷🏻‍♂️ Update Engine to deploy TrustedForwarder
JaredBorders Dec 7, 2023
70041fc
✅ Test skeleton commit
JaredBorders Dec 7, 2023
e811876
👷🏻‍♂️ Refactor Trusted Forwarder
JaredBorders Dec 7, 2023
6020f4e
✅ Test TrustedForwarder.aggregate()
JaredBorders Dec 7, 2023
e2704e4
🗑️ Remove duplicate tests
JaredBorders Dec 8, 2023
98aac57
📸 Update gas-snapshot/lcov
JaredBorders Dec 8, 2023
8ed0504
📚 Update README
JaredBorders Dec 8, 2023
ed767bf
👷🏻‍♂️ Update co price condition checks
JaredBorders Dec 11, 2023
340353a
👷🏻‍♂️ Update engine interface to reflect logic changes
JaredBorders Dec 11, 2023
e9dc3e8
🗑️ Remove function
JaredBorders Dec 12, 2023
4c6a525
📚 Update README
JaredBorders Dec 12, 2023
b06eda0
👷🏻‍♂️ Update co price condition checks
JaredBorders Dec 12, 2023
83879bf
🚀 Update deployment scripts
JaredBorders Dec 12, 2023
15f8bdc
✅ Update Bootstrap & constants
JaredBorders Dec 12, 2023
a17797a
✅ Update Mocks, Utils, etc
JaredBorders Dec 12, 2023
4393ea0
✅ Update forge tests
JaredBorders Dec 12, 2023
efbbb20
✅ Update hardhat test
JaredBorders Dec 12, 2023
890ca55
⚙️ Add npm script
JaredBorders Dec 12, 2023
688be49
📸 Update gas-snapshot/lcov
JaredBorders Dec 12, 2023
4ae03e8
✅ Add test
JaredBorders Dec 12, 2023
8837d58
📸 Update gas-snapshot/lcov
JaredBorders Dec 12, 2023
f3fddf9
✅ Add test
JaredBorders Dec 12, 2023
b7391e3
📸 Update gas-snapshot/lcov
JaredBorders Dec 12, 2023
539cf3c
✅ Add test
JaredBorders Dec 12, 2023
99ba169
📸 Update gas-snapshot/lcov
JaredBorders Dec 12, 2023
a4296da
📚 Update docs
JaredBorders Dec 14, 2023
2227ddb
🔮 Remove Pyth Oracle Query
JaredBorders Dec 14, 2023
258297d
⛳️ Optimize condition selector check
JaredBorders Dec 14, 2023
bd323c3
👷🏻‍♂️ Denominate co fee is sUSD
JaredBorders Dec 14, 2023
c5f53b9
🗑️ oz
JaredBorders Dec 14, 2023
8c8ce77
👷🏻‍♂️ Update constants and remove unused contracts
JaredBorders Dec 14, 2023
24fb67c
👷🏻‍♂️ Make Engine Multicallable
JaredBorders Dec 15, 2023
6e9233e
✅ Test multicallable and ensure no double spend
JaredBorders Dec 15, 2023
f283189
✅ Update tests
JaredBorders Dec 15, 2023
a3e1c6e
✅ Credit test bones
JaredBorders Dec 15, 2023
4fc8dad
📚 Update README
JaredBorders Dec 15, 2023
1e6141a
📸 Update gas-snapshot/lcov
JaredBorders Dec 15, 2023
10c11a6
📚 Update natspec
JaredBorders Dec 15, 2023
3654c30
✅ Refactor test
JaredBorders Dec 15, 2023
f5b27d6
✅ Add failing tests
JaredBorders Dec 15, 2023
242daa1
👷🏻‍♂️ Rename error
JaredBorders Dec 15, 2023
d69ab93
✅ Test credit management
JaredBorders Dec 15, 2023
7933cdc
📚 Rename section
JaredBorders Dec 15, 2023
e706285
📸 Update gas-snapshot/lcov
JaredBorders Dec 15, 2023
42cac7b
📚 Update system docs
JaredBorders Dec 15, 2023
541d205
📸 Update gas-snapshot/lcov
JaredBorders Dec 15, 2023
7439c41
✨ Prettify
JaredBorders Dec 15, 2023
0ccb149
🗑️ Remove unused code
JaredBorders Dec 18, 2023
7a4ecc3
📚 Add Solady author
JaredBorders Dec 18, 2023
0b0ffe4
👷🏻‍♂️ Update EIP-712
JaredBorders Dec 18, 2023
afc292b
👷🏻‍♂️ Revert when invalid reduce only co
JaredBorders Dec 18, 2023
338b018
✅ Update tests for reduce only co's
JaredBorders Dec 18, 2023
eba862a
🗑️ Remove custom errors
JaredBorders Dec 18, 2023
d7a10d5
👷🏻‍♂️ Rename deposit/withdraw to credit/debit
JaredBorders Dec 18, 2023
84dd922
✅ Update credit tests
JaredBorders Dec 18, 2023
657c52a
📚 Fix typo
JaredBorders Dec 18, 2023
d7d9458
👷🏻‍♂️ Rename multicallable for clarity
JaredBorders Dec 18, 2023
4346deb
✅ Update multicallable tests
JaredBorders Dec 18, 2023
48a86a2
👷🏻‍♂️ Add size to price conditions
JaredBorders Dec 19, 2023
af0d04b
✅ Update tests
JaredBorders Dec 19, 2023
4d8ca68
👷🏻‍♂️ CEI change
JaredBorders Dec 19, 2023
59a2bd5
📸 Update gas-snapshot/lcov
JaredBorders Dec 19, 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
201 changes: 95 additions & 106 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,110 +1,99 @@
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: 25010)
AccountOwner:test_isAccountOwner_false() (gas: 229790)
AccountOwner:test_isAccountOwner_true() (gas: 229780)
CanExecute:test_canExecute_false_insufficent_account_credit() (gas: 414871)
CanExecute:test_canExecute_false_invalid_signature() (gas: 448904)
CanExecute:test_canExecute_false_invalid_signer() (gas: 442063)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 397562)
CanExecute:test_canExecute_false_nonce_used() (gas: 826365)
CanExecute:test_canExecute_false_trusted_executor() (gas: 438807)
CanExecute:test_canExecute_true() (gas: 438401)
CommitOrder:test_commitOrder() (gas: 382994)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 441236)
CommitOrder:test_commitOrder_invalid_market() (gas: 38373)
Conditions:test_isMarketOpen() (gas: 26619)
Conditions:test_isOrderFeeBelow() (gas: 179759)
Conditions:test_isPositionSizeAbove() (gas: 18823)
Conditions:test_isPositionSizeBelow() (gas: 18762)
Conditions:test_isPriceAbove() (gas: 19098)
Conditions:test_isPriceBelow() (gas: 19092)
Conditions:test_isTimestampAfter() (gas: 7711)
Conditions:test_isTimestampBefore() (gas: 7579)
DeploymentTest:test_deploy() (gas: 4890031)
DeploymentTest:test_deploy_oracle_zero_address() (gas: 1903033)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 1902949)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 1903016)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 1903029)
DeploymentTest:test_deploy_trusted_forwarder_zero_address() (gas: 37562)
Deposit:test_depositEth() (gas: 55255)
Deposit:test_depositEth_Account_Doesnt_Exist() (gas: 34271)
Deposit:test_depositEth_event() (gas: 56815)
Deposit:test_depositEth_fuzz(uint256,uint128) (runs: 256, μ: 36765, ~: 34889)
Deposit:test_depositEth_via_trustedForwarder() (gas: 85374)
Deposit:test_depositEth_via_trustedForwarder_value_mismatch() (gas: 87469)
Deposit:test_depositEth_via_trustedForwarder_value_mismatch_require_success() (gas: 86713)
DepositCollateral:test_depositCollateral() (gas: 258530)
DepositCollateral:test_depositCollateral_availableMargin() (gas: 266098)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 259106)
DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 56046)
DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 263482)
EIP7412Test:test_fulfillOracleQuery(bytes) (runs: 256, μ: 149614, ~: 149516)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 330951)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 96827)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 361524)
Execute:test_execute_event() (gas: 433933)
Execute:test_execute_order_committed() (gas: 430425)
ExecuteBatch:test_executeBatch() (gas: 95256)
ExecuteBatch:test_executeBatch_invalid_signature() (gas: 48173)
Fee:test_fee_exceeds_account_credit() (gas: 67907)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 67486)
Fee:test_fee_imposed() (gas: 468614)
MathLibTest:test_abs128() (gas: 448)
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: 446810)
CanExecute:test_canExecute_false_invalid_signer() (gas: 442163)
CanExecute:test_canExecute_false_maxExecutorFee_exceeded() (gas: 397594)
CanExecute:test_canExecute_false_nonce_used() (gas: 825780)
CanExecute:test_canExecute_false_require_verify_condition_not_met() (gas: 532786)
CanExecute:test_canExecute_false_trusted_executor() (gas: 439360)
CanExecute:test_canExecute_true() (gas: 438999)
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, μ: 103044, ~: 112702)
Credit:test_credit_AccountDoesNotExist() (gas: 28011)
Credit:test_credit_event() (gas: 97230)
Debit:test_debit(uint256) (runs: 256, μ: 132589, ~: 142379)
Debit:test_debit_InsufficientBalance() (gas: 119995)
Debit:test_debit_Unauthorized() (gas: 120025)
Debit:test_debit_event() (gas: 102161)
DeploymentTest:test_deploy() (gas: 3195810)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 42676)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 42743)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 42734)
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)
Execute:test_execute_CannotExecuteOrder_invalid_acceptablePrice() (gas: 330290)
Execute:test_execute_CannotExecuteOrder_invalid_settlementStrategyId() (gas: 96211)
Execute:test_execute_CannotExecuteOrder_too_leveraged() (gas: 360885)
Execute:test_execute_event() (gas: 433339)
Execute:test_execute_order_committed() (gas: 429786)
Fee:test_fee_exceeds_account_credit() (gas: 133066)
Fee:test_fee_exceeds_maxExecutorFee() (gas: 132599)
Fee:test_fee_imposed() (gas: 519317)
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)
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, μ: 52770, ~: 52770)
NonceBitmapTest:test_hasUnorderedNonceBeenUsed() (gas: 54126)
NonceBitmapTest:test_invalidateUnorderedNonces() (gas: 76509)
NonceBitmapTest:test_invalidateUnorderedNonces_Only_Owner_Delegate() (gas: 190324)
NonceBitmapTest:test_invalidateUnorderedNonces_event() (gas: 53464)
ReduceOnly:test_reduce_only() (gas: 432125)
ReduceOnly:test_reduce_only_same_sign() (gas: 72481)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 432232)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 408894)
ReduceOnly:test_reduce_only_zero_size() (gas: 162976)
TrustedMulticallForwarderTest:testAggregate3() (gas: 24779)
TrustedMulticallForwarderTest:testAggregate3Unsuccessful() (gas: 21395)
TrustedMulticallForwarderTest:testAggregate3Value() (gas: 49261)
TrustedMulticallForwarderTest:testAggregate3ValueUnsuccessful() (gas: 87877)
TrustedMulticallForwarderTest:testAggregation() (gas: 15186)
TrustedMulticallForwarderTest:testBlockAndAggregateUnsuccessful() (gas: 21080)
TrustedMulticallForwarderTest:testGetBasefee() (gas: 5486)
TrustedMulticallForwarderTest:testGetBlockHash(uint256) (runs: 256, μ: 5674, ~: 5674)
TrustedMulticallForwarderTest:testGetBlockNumber() (gas: 5487)
TrustedMulticallForwarderTest:testGetChainId() (gas: 5486)
TrustedMulticallForwarderTest:testGetCurrentBlockCoinbase() (gas: 5579)
TrustedMulticallForwarderTest:testGetCurrentBlockGasLimit() (gas: 5463)
TrustedMulticallForwarderTest:testGetCurrentBlockTimestamp() (gas: 5433)
TrustedMulticallForwarderTest:testGetEthBalance(address) (runs: 256, μ: 8421, ~: 8451)
TrustedMulticallForwarderTest:testGetLastBlockHash() (gas: 5670)
TrustedMulticallForwarderTest:testTryAggregate() (gas: 19577)
TrustedMulticallForwarderTest:testTryAggregateUnsuccessful() (gas: 21084)
TrustedMulticallForwarderTest:testTryBlockAndAggregate() (gas: 19879)
TrustedMulticallForwarderTest:testTryBlockAndAggregateUnsuccessful() (gas: 21185)
TrustedMulticallForwarderTest:testUnsuccessfulAggregation() (gas: 20818)
VerifyConditions:test_max_condition_size_exceeded() (gas: 45101)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14132)
VerifyConditions:test_verify_conditions_not_verified() (gas: 29707)
VerifyConditions:test_verify_conditions_verified() (gas: 135835)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 24402, ~: 24402)
VerifySignature:test_verifySignature_false_private_key() (gas: 27079)
VerifySigner:test_verifySigner() (gas: 25862)
VerifySigner:test_verifySigner_false() (gas: 28614)
Withdraw:test_withdrawEth() (gas: 52547)
Withdraw:test_withdrawEth_EthTransferFailed() (gas: 93091)
Withdraw:test_withdrawEth_InsufficientEthBalance() (gas: 59781)
Withdraw:test_withdrawEth_Unauthorized() (gas: 59420)
Withdraw:test_withdrawEth_event() (gas: 51791)
Withdraw:test_withdrawEth_fuzz(uint256) (runs: 256, μ: 70862, ~: 71511)
WithdrawCollateral:test_withdrawCollateral() (gas: 353254)
WithdrawCollateral:test_withdrawCollateral_availableMargin() (gas: 354755)
WithdrawCollateral:test_withdrawCollateral_collateralAmount() (gas: 353747)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 274242)
WithdrawCollateral:test_withdrawCollateral_totalCollateralValue() (gas: 354253)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 266200)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall(bytes) (runs: 256, μ: 29315, ~: 29258)
MulticallFulfillOracleQuery:test_fulfillOracleQuery_multicall_double_spend(bytes) (runs: 256, μ: 41932, ~: 41822)
MulticallablePayableTest:testMulticallableBenchmark() (gas: 29229)
MulticallablePayableTest:testMulticallableOriginalBenchmark() (gas: 38407)
MulticallablePayableTest:testMulticallablePreservesMsgSender() (gas: 11065)
MulticallablePayableTest:testMulticallableReturnDataIsProperlyEncoded() (gas: 11548)
MulticallablePayableTest:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 9837, ~: 11626)
MulticallablePayableTest:testMulticallableReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 11694, ~: 11694)
MulticallablePayableTest:testMulticallableRevertWithCustomError() (gas: 11767)
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: 77151)
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: 431521)
ReduceOnly:test_reduce_only_same_sign() (gas: 72722)
ReduceOnly:test_reduce_only_truncate_size_down() (gas: 431607)
ReduceOnly:test_reduce_only_truncate_size_up() (gas: 408356)
ReduceOnly:test_reduce_only_when_position_doesnt_exist() (gas: 163109)
ReduceOnly:test_reduce_only_zero_size_delta() (gas: 163166)
VerifyConditions:test_max_condition_size_exceeded() (gas: 45057)
VerifyConditions:test_verifyConditions_InvalidConditionSelector() (gas: 14089)
VerifyConditions:test_verify_conditions_not_verified() (gas: 129563)
VerifyConditions:test_verify_conditions_verified() (gas: 184166)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 25033, ~: 25033)
VerifySignature:test_verifySignature_false_private_key() (gas: 25009)
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)
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ src/
├── Engine.sol
├── interfaces
│ ├── IEngine.sol
│ ├── oracles
│ │ └── IPyth.sol
│ ├── synthetix
│ │ ├── IERC7412.sol
│ │ ├── IPerpsMarketProxy.sol
Expand All @@ -39,7 +37,7 @@ src/
└── utils
├── EIP712.sol
├── EIP7412.sol
└── TrustedMulticallForwarder.sol
└── Multicallable.sol
```

## Tests
Expand Down Expand Up @@ -81,7 +79,7 @@ npm run decode-custom-error -- <error hash 0x...>
> project must be compiled first (see step 2)

```
npx hardhat test
npm run test:hh
```

## Deployment Addresses
Expand Down
9 changes: 3 additions & 6 deletions deployments/Base.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"Synthetix": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
},
"Andromeda": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
},
"Kwenta": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
}
}
9 changes: 3 additions & 6 deletions deployments/BaseGoerli.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"Synthetix": {
"Engine": "0x500A139459fA3628C416A6b19BFADd83B20e5D0b",
"TrustedMulticallForwarder": "0x14aE2D8fA531A9e77aE434d2d700218C2845Bc83"
"Engine": ""
},
"Andromeda": {
"Engine": "0x3617154844291712cBD2148D912b61d6641229a4",
"TrustedMulticallForwarder": "0xb5dCFb08a2CB07399b75B650B980732340c5Ed90"
"Engine": ""
},
"Kwenta": {
"Engine": "0x0b5456EB6eE169C533a931aD2a420237ADf3Da49",
"TrustedMulticallForwarder": "0xe68Faa95D54bf335E67128c4528A551eaB3AF9fE"
"Engine": ""
}
}
9 changes: 3 additions & 6 deletions deployments/Optimism.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"Synthetix": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
},
"Andromeda": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
},
"Kwenta": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
}
}
9 changes: 3 additions & 6 deletions deployments/OptimismGoerli.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"Synthetix": {
"Engine": "0x06198fCE58194C0cB7AB420D6da791789cE01F9d",
"TrustedMulticallForwarder": "0x9Fb8Fa76d34ad7b03A945f8335D3Ab24637091d6"
"Engine": ""
},
"Andromeda": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
},
"Kwenta": {
"Engine": "",
"TrustedMulticallForwarder": ""
"Engine": ""
}
}
Loading
Loading