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

⚡️ Zap #38

Merged
merged 89 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a7a821f
forge install: Zap
JaredBorders Jan 2, 2024
5feb897
✨ Prettify
JaredBorders Jan 2, 2024
feae331
⚡️ Add Zap
JaredBorders Jan 2, 2024
fa18c8a
🚀 Update Script Params
JaredBorders Jan 3, 2024
fd7d891
👷🏻‍♂️ Add new constructor params
JaredBorders Jan 3, 2024
e161721
🚀 Update deploy/upgrade scripts
JaredBorders Jan 3, 2024
5118fdd
✅ Update exposed engine
JaredBorders Jan 3, 2024
31efe00
🚀 Update deploy/upgrade scripts
JaredBorders Jan 3, 2024
16f36e3
✅ Update mock & exposed engine
JaredBorders Jan 3, 2024
1f4bd96
✅ Update bootstrap
JaredBorders Jan 3, 2024
680cd6c
✅ Update tests for new deploy script
JaredBorders Jan 3, 2024
c68bf0c
⚙️ Update package scripts
JaredBorders Jan 3, 2024
ed54ddc
📚 Update README
JaredBorders Jan 3, 2024
59a9797
☂️ Update CI
JaredBorders Jan 3, 2024
7fa1b40
🗑️ Remove checks
JaredBorders Jan 3, 2024
b7dd88f
✅ Update tests for Base
JaredBorders Jan 3, 2024
3e5599a
✅ Add new constant
JaredBorders Jan 3, 2024
a51c299
✅ Fix setup issue with bootstrap
JaredBorders Jan 4, 2024
621dbd3
✅ Update constants and acceptable price in NonceBitmapTest
JaredBorders Jan 4, 2024
11fc969
✅ Update error
JaredBorders Jan 4, 2024
ec000eb
✅ Update interfaces and tests
JaredBorders Jan 4, 2024
cedfa8c
📸 Update gas-snapshot/lcov
JaredBorders Jan 4, 2024
52d08cd
👷🏻‍♂️ Add modifyCollateralZap()
JaredBorders Jan 5, 2024
4f4e5ff
✅ Fix test
JaredBorders Jan 5, 2024
80ffc64
⚡️ Update Zap lib
JaredBorders Jan 5, 2024
42b1c76
✅ Add tests
JaredBorders Jan 5, 2024
bc6faa7
✅ Add error
JaredBorders Jan 5, 2024
ab0d4ab
✅ Add new constant
JaredBorders Jan 5, 2024
e212a20
👷🏻‍♂️ Add decimals()
JaredBorders Jan 5, 2024
1a48c67
👷🏻‍♂️ Update modifyCollateralZap()
JaredBorders Jan 5, 2024
180875b
✅ Test modifyCollateralZap()
JaredBorders Jan 5, 2024
acf6721
📸 Update gas-snapshot/lcov
JaredBorders Jan 5, 2024
cdee820
🚀 Deploy Base Goerli
JaredBorders Jan 5, 2024
8978d6f
⚡️ Update Zap
JaredBorders Jan 5, 2024
52f4012
📚 Update docs
JaredBorders Jan 5, 2024
00dd35b
🧮 Add toInt256()
JaredBorders Jan 5, 2024
dfc2db7
✅ Test toInt256()
JaredBorders Jan 5, 2024
16b181c
✨ Prettify
JaredBorders Jan 5, 2024
c774f43
📸 Update gas-snapshot/lcov
JaredBorders Jan 5, 2024
8f7fc30
🚀 Deploy Base Goerli
JaredBorders Jan 5, 2024
ee77666
⚡️ Update Zap
JaredBorders Jan 6, 2024
4c2c0ee
👷🏻‍♂️ Add creditAccountZap() and debitAccountZap()
JaredBorders Jan 6, 2024
9b92dd2
🗑️ Remove test associated with removed error
JaredBorders Jan 6, 2024
f876d6c
🚀 Update Base Goerli Deployment
JaredBorders Jan 6, 2024
a77895d
📸 Update gas-snapshot/lcov
JaredBorders Jan 6, 2024
e038ecc
👷🏻‍♂️ Address warnings
JaredBorders Jan 7, 2024
91ca7c8
✅ Update tests
JaredBorders Jan 7, 2024
f6e7637
📸 Update lcov
JaredBorders Jan 7, 2024
9e0ecd9
🚀 Update Base Goerli USDC address
JaredBorders Jan 8, 2024
bb0d184
🚀 Update Base Goerli Deployment
JaredBorders Jan 8, 2024
ccd3910
🗑️ Remove "Zap"
JaredBorders Jan 9, 2024
7495b68
forge install: zap
JaredBorders Jan 9, 2024
5c2fbd3
👷🏻‍♂️ Update zap lib
JaredBorders Jan 9, 2024
d5c8e04
🗑️ Remove Zap.zap() related code
JaredBorders Jan 9, 2024
2f1a304
📸 Update gas-snapshot/lcov
JaredBorders Jan 9, 2024
3813067
⚙️ Update hh config
JaredBorders Jan 9, 2024
ab8fad4
✅ Fix hh test
JaredBorders Jan 9, 2024
78b14a1
🚀 Deploy WIP
JaredBorders Jan 10, 2024
c043e9c
👷🏻‍♂️ Add storage gap to support later upgrade flexibility
JaredBorders Jan 12, 2024
8b8a60f
✅ Test storage layout
JaredBorders Jan 12, 2024
c19ed4d
📸 Update gas-snapshot/lcov
JaredBorders Jan 12, 2024
35eb80c
♻️ Update zap
JaredBorders Jan 12, 2024
dd57fa2
🗑️ Remove referrrer from zap functions
JaredBorders Jan 12, 2024
c1658bf
📸 Update gas-snapshot/lcov
JaredBorders Jan 12, 2024
dfec846
✨ Prettify
JaredBorders Jan 12, 2024
ec08eaf
⛳️ Reduce bytecode
JaredBorders Jan 12, 2024
d58d1ff
🗑️ Remove import
JaredBorders Jan 12, 2024
a8ab453
👷🏻‍♂️ Adhere to CEI
JaredBorders Jan 12, 2024
aa2992c
📚 Fix typo
JaredBorders Jan 12, 2024
057709d
👷🏻‍♂️ Roll back change due to returned amount being needed
JaredBorders Jan 12, 2024
4c98608
📸 Update gas-snapshot/lcov
JaredBorders Jan 12, 2024
550c8cf
👷🏻‍♂️ Make non-view functions multicallable/payable
JaredBorders Jan 16, 2024
81f6ac7
👷🏻‍♂️ Add payable modifier to non-view functions
JaredBorders Jan 16, 2024
91b20eb
✅ Add new test case for Engine multicall
JaredBorders Jan 16, 2024
1a74397
📸 Update gas-snapshot/lcov
JaredBorders Jan 16, 2024
69a937b
🚀 Deploy SMv3 Testnet
JaredBorders Jan 16, 2024
afd0a5f
🚀 Deploy SMv3 Mainnet (Beta)
JaredBorders Jan 16, 2024
c449626
⚙️ Add BASE_SEPOLIA_RPC_URL
JaredBorders Jan 17, 2024
7476e02
🚀 Add base sepolia deploy script
JaredBorders Jan 17, 2024
a05270e
🚀 Add base sepolia script params
JaredBorders Jan 17, 2024
866479d
🚀 Add base sepolia deployment
JaredBorders Jan 17, 2024
8072c94
👷🏻‍♂️ Update variable name
JaredBorders Jan 17, 2024
2bc5147
📚 Update Interface Docs
JaredBorders Jan 17, 2024
802bdfa
👷🏻‍♂️ Catch insufficient credit error in debitAccountZap
JaredBorders Jan 18, 2024
7dcd087
✅ Add test for debit zap with insufficient balance
JaredBorders Jan 18, 2024
7fe5df7
🏅 Macro Audit Report
JaredBorders Jan 18, 2024
f72fa79
⚡️ Update zap
JaredBorders Jan 18, 2024
508c19f
📸 Update gas-snapshot/lcov
JaredBorders Jan 18, 2024
e781203
🚀 SMv3 Deployment
JaredBorders Jan 18, 2024
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
210 changes: 108 additions & 102 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,112 +1,118 @@
AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26492)
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)
AccountDelegate:test_isAccountDelegate_account_doesnt_exist() (gas: 26743)
AccountDelegate:test_isAccountDelegate_false() (gas: 397500)
AccountDelegate:test_isAccountDelegate_true() (gas: 395470)
AccountDelegate:test_isAccountDelegate_zero_address_caller() (gas: 27985)
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)
CommitOrder:test_commitOrder() (gas: 585293)
CommitOrder:test_commitOrder_Unauthorized() (gas: 37862)
CommitOrder:test_commitOrder_insufficient_collateral() (gas: 425887)
CommitOrder:test_commitOrder_invalid_market() (gas: 44546)
Conditions:test_isOrderFeeBelow() (gas: 154802)
Conditions:test_isPositionSizeAbove() (gas: 24623)
Conditions:test_isPositionSizeBelow() (gas: 24598)
Conditions:test_isPriceAbove() (gas: 175814)
Conditions:test_isPriceBelow() (gas: 175643)
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)
Conditions:test_isTimestampBefore() (gas: 13376)
Credit:test_credit(uint256) (runs: 256, μ: 94831, ~: 105108)
Credit:test_credit_event() (gas: 88151)
Credit:test_credit_zap() (gas: 677111)
Debit:test_debit(uint256) (runs: 256, μ: 136492, ~: 147260)
Debit:test_debit_InsufficientBalance() (gas: 122814)
Debit:test_debit_Unauthorized() (gas: 122831)
Debit:test_debit_event() (gas: 104489)
Debit:test_debit_zap() (gas: 985059)
Debit:test_debit_zap_Unauthorized() (gas: 122887)
DeploymentTest:test_deploy() (gas: 4525097)
DeploymentTest:test_deploy_perps_market_proxy_zero_address() (gas: 58589)
DeploymentTest:test_deploy_spot_market_proxy_zero_address() (gas: 55993)
DeploymentTest:test_deploy_susd_proxy_zero_address() (gas: 55980)
DepositCollateral:test_depositCollateral() (gas: 433723)
DepositCollateral:test_depositCollateral_availableMargin() (gas: 437890)
DepositCollateral:test_depositCollateral_collateralAmount() (gas: 433843)
DepositCollateral:test_depositCollateral_insufficient_balance() (gas: 61158)
DepositCollateral:test_depositCollateral_totalCollateralValue() (gas: 435519)
DepositCollateral:test_depositCollateral_zap() (gas: 940531)
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: 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)
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)
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, μ: 577, ~: 603)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 472, ~: 458)
MathLibTest:test_fuzz_abs256(int256) (runs: 256, μ: 449, ~: 436)
MathLibTest:test_fuzz_toInt256(uint256) (runs: 256, μ: 989, ~: 438)
MathLibTest:test_isSameSign() (gas: 999)
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)
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, μ: 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: 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)
MathLibTest:test_toInt256() (gas: 3347)
MathLibTest:test_toInt256_overflow() (gas: 3251)
MockUpgrade:test_upgrade() (gas: 4549257)
MockUpgrade:test_upgrade_credit_state(uint256) (runs: 256, μ: 4627754, ~: 4627754)
MockUpgrade:test_upgrade_nonce_state(uint256) (runs: 256, μ: 4583061, ~: 4583061)
MockUpgrade:test_upgrade_only_pDAO() (gas: 4534357)
Multicall:testMulticallableBenchmark() (gas: 29229)
Multicall:testMulticallableOriginalBenchmark() (gas: 38452)
Multicall:testMulticallablePreservesMsgSender() (gas: 11116)
Multicall:testMulticallableReturnDataIsProperlyEncoded() (gas: 11637)
Multicall:testMulticallableReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 9850, ~: 11395)
Multicall:testMulticallableReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 11695, ~: 11695)
Multicall:testMulticallableRevertWithCustomError() (gas: 11746)
Multicall:testMulticallableRevertWithMessage() (gas: 13451)
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_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: 4519678)
SignatureCheckerLibTest:test_isValidSignatureNowCalldata(address,bytes32,bytes) (runs: 256, μ: 3496, ~: 3474)
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_verify_conditions_not_verified() (gas: 127923)
VerifyConditions:test_verify_conditions_verified() (gas: 175747)
VerifySignature:test_verifySignature(uint256) (runs: 256, μ: 30169, ~: 30169)
VerifySignature:test_verifySignature_false_private_key() (gas: 32833)
VerifySigner:test_verifySigner() (gas: 30918)
VerifySigner:test_verifySigner_false() (gas: 33626)
WithdrawCollateral:test_withdrawCollateral() (gas: 539605)
WithdrawCollateral:test_withdrawCollateral_insufficient_account_collateral_balance() (gas: 445821)
WithdrawCollateral:test_withdrawCollateral_zap() (gas: 934846)
WithdrawCollateral:test_withdrawCollateral_zero() (gas: 441471)
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Report Coverage
run: |
forge coverage --fork-url ${{ secrets.OPTIMISM_GOERLI_RPC_URL }} --report lcov
forge coverage --fork-url ${{ secrets.BASE_RPC_URL }} --report lcov

- name: Upload Coverage Report
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Test Project
run: |
forge test --fork-url ${{ secrets.OPTIMISM_GOERLI_RPC_URL }} --etherscan-api-key ${{ secrets.ETHERSCAN_API_KEY }} -vvv
forge test --fork-url ${{ secrets.BASE_RPC_URL }} --etherscan-api-key ${{ secrets.BASESCAN_API_KEY }} -vvv
id: test

hardhat_test:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/zap"]
path = lib/zap
url = https://github.com/JaredBorders/zap
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ npm run test
```

5. Run specific forge test
> `OPTIMISM_GOERLI_RPC_URL` can be replaced with `OPTIMISM_RPC_URL` if a mainnet fork is desired

```
forge test --fork-url $(grep OPTIMISM_GOERLI_RPC_URL .env | cut -d '=' -f2) --match-test TEST_NAME -vvv
forge test --fork-url $(grep BASE_RPC_URL .env | cut -d '=' -f2) --match-test TEST_NAME -vvv
```

6. Decode a custom error defined by Synthetix v3
Expand Down
4 changes: 2 additions & 2 deletions deployments/Base.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"EngineProxy": ""
},
"Andromeda": {
"EngineImplementation": "",
"EngineProxy": ""
"EngineImplementation": "0x33B725a1B2dE9178121D423D2A1c062C5452f310",
"EngineProxy": "0xe5bB889B1f0B6B4B7384Bd19cbb37adBDDa941a6"
},
"Kwenta": {
"EngineImplementation": "",
Expand Down
4 changes: 2 additions & 2 deletions deployments/BaseGoerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"EngineProxy": ""
},
"Andromeda": {
"EngineImplementation": "0xF877315CfC91E69e7f4c308ec312cf91D66a095F",
"EngineProxy": "0xd5fE5beAa04270B32f81Bf161768c44DF9880D11"
"EngineImplementation": "0x85B466A1a6E2D2AcEf68Cb86BD3c6Efd7479E55d",
"EngineProxy": "0x03f6dC6e616AB3a367a1F2C26B8Bc146f632b451"
},
"Kwenta": {
"EngineImplementation": "",
Expand Down
4 changes: 2 additions & 2 deletions deployments/OptimismGoerli.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Synthetix": {
"EngineImplementation": "0xEeceA5D2504657BCe29ee68c0bA7Ea5F2A9bf6Ec",
"EngineProxy": "0xe11A40e72f5148c0460Bf39359e9d14aD7aE16B3"
"EngineImplementation": "",
"EngineProxy": ""
},
"Andromeda": {
"EngineImplementation": "",
Expand Down
66 changes: 37 additions & 29 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-preprocessor";
import fs from "fs";
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
import 'hardhat-preprocessor';
import fs from 'fs';

function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.filter(Boolean) // remove empty lines
.map((line) => line.trim().split("="));
return fs
.readFileSync('remappings.txt', 'utf8')
.split('\n')
.filter(Boolean) // remove empty lines
.map((line) => line.trim().split('='));
}

const config: HardhatUserConfig = {
solidity: "0.8.20",
preprocess: {
eachLine: (hre) => ({
transform: (line: string) => {
if (line.match(/^\s*import /i)) {
for (const [from, to] of getRemappings()) {
if (line.includes(from)) {
line = line.replace(from, to);
break;
}
}
}
return line;
},
}),
},
paths: {
sources: "./src",
cache: "./cache_hardhat",
},
solidity: {
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
preprocess: {
eachLine: (_) => ({
transform: (line: string) => {
if (line.match(/^\s*import /i)) {
for (const [from, to] of getRemappings()) {
if (line.includes(from)) {
line = line.replace(from, to);
break;
}
}
}
return line;
},
}),
},
paths: {
sources: './src',
cache: './cache_hardhat',
},
};

export default config;
Loading
Loading