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

WIP Sonic Staking #2335

Draft
wants to merge 320 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
9ce05e1
Generated latest contract diagram
naddison36 May 13, 2024
8c052d8
fix codecov upload
naddison36 May 13, 2024
3687fbe
Fix OETH process diagram for native staking
naddison36 May 13, 2024
6df4f5f
add a withdrawal event when withdrawing WETH to vault (#2059)
sparrowDom May 13, 2024
614b11e
Regenerated latest native staking diagram
naddison36 May 13, 2024
21d5569
Merge remote-tracking branch 'origin/master' into sparrowDom/nativeSt…
naddison36 May 13, 2024
8be6f90
Changed vault mint to call to Dripper.collect
naddison36 May 15, 2024
c8288b7
Added more vault mint fork tests
naddison36 May 16, 2024
63a11f7
first implementation of the withdrawal queue
naddison36 May 16, 2024
abe0e9c
Fix Slither
naddison36 May 16, 2024
cfe6a81
add a util contract that is able to recalculate a valid deposit data …
sparrowDom May 16, 2024
3a35b55
Slither fixes
naddison36 May 17, 2024
28ae453
Fix linter
naddison36 May 17, 2024
ad492cc
Updated contract diagram
naddison36 May 17, 2024
4872259
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 May 20, 2024
c491131
Merge remote-tracking branch 'origin/master' into sparrowDom/nativeSt…
naddison36 May 22, 2024
e8c15b5
Prettier native staking test
naddison36 May 22, 2024
acad4b9
Renamed native staking deploy script
naddison36 May 22, 2024
638bf30
Fix event values (#2060)
sparrowDom May 22, 2024
b4e9c3f
Deploy latest Native Staking Strategy to Holesky (#2073)
naddison36 May 22, 2024
77d7b07
Deploy native staking Proxy via Relayer (#2066)
sparrowDom May 22, 2024
4c25093
Setup basic defender action (#2072)
sparrowDom May 22, 2024
c4456b9
Output more contract details in 097 deploy script
naddison36 May 23, 2024
c1922b6
Added claimWithdrawals to OETHVaultCore
naddison36 May 23, 2024
e5ebf29
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 May 23, 2024
0643034
prettier
naddison36 May 23, 2024
a50f2d2
Add getting WETH from Dripper on mints over rebaseThreshold
naddison36 May 23, 2024
82b4fd1
Restricted OETH's depositToStrategy to only deposit WETH
naddison36 May 23, 2024
10b95df
Fixed unit tests
naddison36 May 23, 2024
f27966b
Suppress Slither
naddison36 May 23, 2024
112dd37
Changed ssv util getClusterInfo to use the SSV API instead of the ssv…
naddison36 May 23, 2024
f3e9d35
Fix Native Staking fork tests
naddison36 May 24, 2024
4e9e24f
Fix Native Staking fork tests
naddison36 May 24, 2024
8cf9a25
Changed ssv util getClusterInfo to use the SSV API instead of the ssv…
naddison36 May 24, 2024
fc09bed
Prettier
naddison36 May 24, 2024
bb3b7e6
ValidatorRegistrator.stakeEth gas improvement when multiple validators
naddison36 May 24, 2024
e163cff
Corrected stakeEth call in OETH processes diagram
naddison36 May 24, 2024
cdb36ef
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 May 24, 2024
9d302ec
Fixes to withdrawal queue
naddison36 May 24, 2024
ef1c325
Add more withdrawal queue unit tests
naddison36 May 24, 2024
267d045
More withdrawal queue unit tests
naddison36 May 24, 2024
beb9170
Fixed adjusting the vault value for the withdrawal queue
naddison36 May 24, 2024
10259ce
Add more withdrawal queue tests
naddison36 May 24, 2024
dd7632d
Implemented withdrawAll in MockStrategy
naddison36 May 24, 2024
84d9a7f
Fixed bug in claimWithdrawals
naddison36 May 24, 2024
bb8577f
Complete code coverage of OETH Vault unit tests
naddison36 May 24, 2024
e853081
Added fork test for registering a validator twice
naddison36 May 27, 2024
12bba64
Stake funds with confirmations for front-running protection of Beacon…
sparrowDom May 28, 2024
5632653
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 May 28, 2024
0a0e9da
Updated Buyback value flow for OETH
naddison36 May 28, 2024
93b3cdf
Updated Native staking process diagram
naddison36 May 29, 2024
003fcdb
Updated OETH Vault diagrams
naddison36 May 29, 2024
9295fe7
Add process for pausing the Native Staking Strategy
naddison36 May 29, 2024
8748170
Merge remote-tracking branch 'origin/master' into sparrowDom/nativeSt…
naddison36 May 29, 2024
270a3f6
Removed the redundant condition in the fuse interval check (#2082)
naddison36 Jun 2, 2024
706da2e
OZ - Native Staking - M-01 All Addresses Are Registered Validators by…
naddison36 Jun 2, 2024
71adea7
OZ - Native Staking - N-07 Lack of Indexed Event Parameters (#2083)
naddison36 Jun 2, 2024
8f8118d
Deployed new Native Staking Strategy
naddison36 Jun 2, 2024
d398042
generated latest NativeStakingSSVStrategy docs
naddison36 Jun 2, 2024
b6c2219
P2P API changes (#2084)
naddison36 Jun 2, 2024
81b9359
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 Jun 2, 2024
49439ec
Hardhat tasks for Native Staking (#2085)
naddison36 Jun 3, 2024
8e75f24
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 Jun 3, 2024
2081919
bumped the deploy script number
naddison36 Jun 3, 2024
6ecf222
Cap the validators a Native Staking Strategy can hold (#2087)
naddison36 Jun 3, 2024
c807e8d
don't format Defender Action code in dist folder
naddison36 Jun 4, 2024
8ab4317
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 Jun 4, 2024
7f54c94
Deployed latest NativeStakingSSVStrategy contract to Holesky
naddison36 Jun 4, 2024
c4f2a30
Merge remote-tracking branch 'origin/sparrowDom/nativeStaking' into n…
naddison36 Jun 4, 2024
2c90f9f
Fix deployment file
shahthepro Jun 28, 2024
35c4848
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 3, 2024
7849b81
Merge remote-tracking branch 'origin/nicka/oeth-arm' into nicka/oeth-arm
naddison36 Jul 3, 2024
d8b0fea
updated deploy number for OETH withdrawal queue
naddison36 Jul 3, 2024
a2dada1
Fixed unit tests
naddison36 Jul 3, 2024
532e9b9
Remove stETH from Vault in OETH Withdrawal Queue deployment is not al…
naddison36 Jul 3, 2024
2075e66
Skipping OETH Vault collateral swaps
naddison36 Jul 3, 2024
4ecffac
Skipping OETH whale redeem in fork tests
naddison36 Jul 3, 2024
f2c278b
Fixed spelling in comments of VaultStorage
naddison36 Jul 3, 2024
8f46a2b
Fail CI if any mainnet fork tests fail
naddison36 Jul 3, 2024
2f90d78
Continue with fork tests if any fail but still fail the CI job
naddison36 Jul 3, 2024
bafeff1
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 3, 2024
faf9521
increment deploy script number
naddison36 Jul 3, 2024
8094ddd
restore Github Actions config
naddison36 Jul 3, 2024
e811fc7
Updated OETHVaultCore comments
naddison36 Jul 4, 2024
0cd7ac2
Upgraded OETH Vault on Holesky to include the withdrawal queue
naddison36 Jul 4, 2024
ba3c28c
Added Vault requestWithdrawal andclaimWithdrawal Hardhat tasks
naddison36 Jul 4, 2024
39d9a86
OETHVaultCore Natspec updates
naddison36 Jul 4, 2024
4e3a58d
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 5, 2024
99f17e5
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 10, 2024
f8d4974
Add 30 minute time delay between request and claim from the OETH With…
clement-ux Jul 12, 2024
b277f36
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 12, 2024
937a084
fix: test expectRevert with new error message
clement-ux Jul 12, 2024
ae24a1f
Merge remote-tracking branch 'origin/nicka/oeth-arm' into nicka/oeth-arm
naddison36 Jul 12, 2024
b07ce57
Fixed unit tests
naddison36 Jul 12, 2024
bdeb1de
Remove stETH and rETH asset from OETH Vault
naddison36 Jul 14, 2024
25f1b53
Skip legacy strategy tests
naddison36 Jul 14, 2024
3049eff
Skiped legacy Oracle prices
naddison36 Jul 14, 2024
3c9c9ec
Skipped Aura price tests
naddison36 Jul 14, 2024
14746bb
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 14, 2024
b7a6a10
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 14, 2024
dc58a1c
Remove rETH as an asset from the Vault
naddison36 Jul 15, 2024
5815778
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 15, 2024
c607bc7
Added call to cacheWETHAssetIndex after stETH is removed from the Vault
naddison36 Jul 15, 2024
33a5678
Updated vault storage diagrams
naddison36 Jul 15, 2024
cbd6764
Added second native staking strategy as the default for WETH
naddison36 Jul 15, 2024
f93f6ab
Add solvency check. (#2131)
clement-ux Jul 15, 2024
d3de400
Fixed claim Natspec now the delay is in place
naddison36 Jul 16, 2024
ecc2773
Changed console debug in assertUpgradeIsSafe to use logger
naddison36 Jul 16, 2024
74875cd
Updated Natspec
naddison36 Jul 16, 2024
5c2ab55
Assert totalValue in withdrawal queue unit tests
naddison36 Jul 16, 2024
cccc048
Merge remote-tracking branch 'origin/nicka/oeth-arm' into nicka/oeth-arm
naddison36 Jul 16, 2024
6ba210a
Fixed prettier
naddison36 Jul 16, 2024
52b2fe3
Asset vault checkBalance of WETH to OETH Vault unit tests
naddison36 Jul 16, 2024
f9e9fdd
_checkBalance and _totalValue on OETH Vault to protect against insolv…
naddison36 Jul 16, 2024
e85f4fb
Override _totalValueInVault in OETH Vault
naddison36 Jul 16, 2024
8c77769
Removed super._totalValue call
naddison36 Jul 16, 2024
6eda2ed
Fix AMO fork tests
naddison36 Jul 16, 2024
1ab9752
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 16, 2024
28e3ead
Generated latest OETH Vault diagrams
naddison36 Jul 16, 2024
e86fa11
Don't account for WETH reserved for withdrawal during allocation (#2138)
shahthepro Jul 16, 2024
0f383e0
WIP more unit tests
naddison36 Jul 16, 2024
e66dc12
Added more unit tests
naddison36 Jul 16, 2024
d67d1bf
Merge remote-tracking branch 'origin/nicka/oeth-arm' into nicka/oeth-arm
naddison36 Jul 16, 2024
61ead28
Added more withdrawal unit tests
naddison36 Jul 16, 2024
b0cd078
Fix skipped test
shahthepro Jul 16, 2024
5ac4175
Add extra test to OETH ARM. (#2139)
clement-ux Jul 17, 2024
5b61c2b
fix: reduce delay period between request and claim to 10min. (#2140)
clement-ux Jul 17, 2024
975c3c6
Refactor OETH Vault's `_allocate()` (#2141)
naddison36 Jul 17, 2024
5422808
Add extra test for OETH Withdraw Queue (#2142)
clement-ux Jul 17, 2024
839bde2
Override allocate on OETH Vault so _addWithdrawalQueueLiquidity is no…
naddison36 Jul 18, 2024
5d29d45
Skip waiting for confirmation on Tenderly testnets
shahthepro Jul 18, 2024
bb5a82a
Fix unit tests
shahthepro Jul 18, 2024
8bd687b
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 22, 2024
9135275
Add snapVault hardhat task
naddison36 Jul 25, 2024
cc6f2f3
Updated insolvency unit tests
naddison36 Jul 26, 2024
133ddcb
Added more insolvency unit tests
naddison36 Jul 26, 2024
fb765e1
Fix _totalValue so it handles when vault value is less than the outst…
naddison36 Jul 26, 2024
f3053f2
Added SafeCast to unit128
naddison36 Jul 26, 2024
22b8b2b
Reject redeems and withdrawals if no available assets due to insolvency
naddison36 Jul 26, 2024
e59268f
Redeem to no longer try and get liquidity from the default strategy i…
naddison36 Jul 26, 2024
74afa41
Simplify _wethAvailable
naddison36 Jul 26, 2024
dc46164
refactor of _claimWithdrawal
naddison36 Jul 26, 2024
4f5a57d
Generated latest OETHVaultCore diagram
naddison36 Jul 26, 2024
193ad6d
Fix Slither
naddison36 Jul 26, 2024
f4de2e6
Updated the other _wethAvailable function
naddison36 Jul 26, 2024
b9d5e00
Set Vault buffer to 0.2%
naddison36 Jul 26, 2024
acf271d
Swapped order in deploy script
naddison36 Jul 26, 2024
5978d6d
Simplify _totalValue logic
naddison36 Jul 29, 2024
6b26be9
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 29, 2024
faa060a
Moved the burn of OETH lower in the request withdrawal
naddison36 Jul 29, 2024
d16970d
Added reentrant protection to addWithdrawalQueueLiquidity
naddison36 Jul 29, 2024
b6a2fbb
Refactor _addWithdrawalQueueLiquidity
naddison36 Jul 29, 2024
0ad9592
Added vault buffer to snapVault Hardhat task
naddison36 Jul 29, 2024
eca6ffa
Merge remote-tracking branch 'origin/master' into nicka/oeth-arm
naddison36 Jul 29, 2024
f9a2c80
M-01 _checkBalance Returns an Incorrect Value During Insolvency (#2166)
naddison36 Aug 6, 2024
f82a54d
Fix vault storage slots (#2167)
naddison36 Aug 6, 2024
b2d3e9c
L-03 Missing Docstrings (#2169)
naddison36 Aug 6, 2024
ecd480f
Fixed Natspec on requestWithdrawal (#2170)
naddison36 Aug 6, 2024
4c746ae
Changed _requestIds param in claimWithdrawals be of type calldata (#2…
naddison36 Aug 6, 2024
7bdbfd8
Remove unnecessary address cast (#2172)
naddison36 Aug 6, 2024
3b66f03
Updated Natpsec of _checkBalance and _checkBalance (#2173)
naddison36 Aug 6, 2024
afb03d8
made constant CLAIM_DELAY public (#2174)
naddison36 Aug 6, 2024
edaf36e
Removed unused MAX_UINT constant (#2175)
naddison36 Aug 6, 2024
3e6b68e
N-08 Variables Are Initialized to Their Default Values (#2176)
naddison36 Aug 6, 2024
49f15a5
Merge remote-tracking branch 'origin/master' into nicka/oz-audit-fixe…
naddison36 Aug 6, 2024
c59070f
Generated latest Vault contract diagrams
naddison36 Aug 6, 2024
b9a2d81
Merge remote-tracking branch 'origin/master' into nicka/oz-audit-fixe…
naddison36 Aug 6, 2024
f69efcb
Merge remote-tracking branch 'origin/master' into nicka/oz-audit-fixe…
naddison36 Aug 19, 2024
59df7d0
Merge remote-tracking branch 'origin/master' into nicka/oz-audit-fixe…
naddison36 Dec 16, 2024
770562a
Merge remote-tracking branch 'origin/master' into nicka/oz-audit-fixe…
naddison36 Dec 17, 2024
dd01806
initial commit
naddison36 Dec 17, 2024
b50f706
WIP Sonic Vault
naddison36 Dec 17, 2024
86a86bb
Changed Sonic Vault to use OETH Base Vault
naddison36 Dec 18, 2024
53b8972
Merge remote-tracking branch 'origin/nicka/oz-audit-fixes-oeth-withdr…
naddison36 Dec 18, 2024
25bdd79
WIP sonic
naddison36 Dec 18, 2024
c87f503
WIP sonic
naddison36 Dec 18, 2024
cde33f0
WIP sonic
naddison36 Dec 18, 2024
40185e4
Got unit tests working
naddison36 Dec 19, 2024
cf12708
Added sonic to node script
naddison36 Dec 19, 2024
908b8d4
WIP Sonic deploy script
naddison36 Dec 19, 2024
3e443f3
Added sonic to storageSlots
naddison36 Dec 20, 2024
ecd9132
Fix getHardhatNetworkProperties
naddison36 Dec 20, 2024
148b08b
Added sonic deployment files
naddison36 Dec 21, 2024
2f01734
Added WETH address on Sonic
naddison36 Dec 29, 2024
965e7f0
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Dec 29, 2024
d9c4b08
Fix Sonic deployment
naddison36 Dec 29, 2024
648d213
Upgraded Hardhat
naddison36 Dec 30, 2024
2653e2b
More Sonic deployment changes
naddison36 Dec 30, 2024
92a7dd6
More Sonic fixes
naddison36 Dec 30, 2024
cba9f6c
Sonic VaultAdmin override supportAsset as it doesn't have a price pro…
naddison36 Dec 30, 2024
61e9146
Solidity prettier
naddison36 Dec 30, 2024
c36ed17
Skipping reborn attack tests now self-destruct has been removed
naddison36 Dec 30, 2024
7cc647f
fix reborn tests
sparrowDom Dec 30, 2024
e18c53f
re-enable fixed reborn tests
sparrowDom Dec 30, 2024
665f4d0
Added SPC
naddison36 Dec 30, 2024
d199133
fix reborn tests
naddison36 Dec 30, 2024
35ec1dc
Fix Solidity compile
naddison36 Dec 30, 2024
4223599
WIP Sonic Staking Strategy
naddison36 Dec 31, 2024
23e7bad
Prettier
naddison36 Dec 31, 2024
0623f9b
Add supported validators to Sonic Staking Strategy
naddison36 Jan 2, 2025
e6d9102
Added Sonic Staking Strategy to deploy script
naddison36 Jan 2, 2025
a01fe3d
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Jan 6, 2025
9c9f499
checkBalance now gets stake and pending rewards
naddison36 Jan 7, 2025
44da67a
add basic fork tests for Sonic staking
sparrowDom Jan 7, 2025
d6bffbc
add correct validator ids
sparrowDom Jan 7, 2025
eebc293
Added Defender Relayer for Sonic
naddison36 Jan 8, 2025
6f563aa
Fixed Sonic unit tests
naddison36 Jan 8, 2025
b19829a
More admin unit tests
naddison36 Jan 8, 2025
78eb22a
More unit tests
naddison36 Jan 8, 2025
efd90f8
Update dependencies
naddison36 Jan 8, 2025
f4ed649
bumped solidity-coverage version
naddison36 Jan 8, 2025
086073f
Added Sonic tests to CI
naddison36 Jan 8, 2025
24fd32b
Fix deprecation notices
naddison36 Jan 8, 2025
a3904ce
Formatting of fork-test.sh script
naddison36 Jan 8, 2025
0b51ee9
Slither fixes
naddison36 Jan 8, 2025
e34d6ea
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Jan 8, 2025
73fc883
Removed unit tests to get gas numbers from CI
naddison36 Jan 8, 2025
a71777d
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Jan 8, 2025
d61013c
Removed redeem from OSonicVault
naddison36 Jan 8, 2025
ba61428
Removed unused code from SonicValidatorDelegator
naddison36 Jan 8, 2025
d40026f
clean up fork test structure
sparrowDom Jan 8, 2025
a6feef5
improve fork test checks
sparrowDom Jan 8, 2025
afa3285
Merge remote-tracking branch 'origin/master' into nicka/sonic
sparrowDom Jan 8, 2025
96d0cda
add basic withdrawal tests
sparrowDom Jan 8, 2025
6a1a8fd
prettier
naddison36 Jan 8, 2025
bf2c72b
Fix OSonic unit test deploy after merge with yield delegation
naddison36 Jan 8, 2025
98056a1
Added Fixed Rate Dripper for Sonic
naddison36 Jan 9, 2025
d820044
Fixed base unit tests after
naddison36 Jan 9, 2025
8a4bf9b
Added Sonic Zapper
naddison36 Jan 9, 2025
3b08742
Added Sonic contract dependency diagram
naddison36 Jan 9, 2025
4289fa0
Merge remote-tracking branch 'origin/master' into nicka/sonic
sparrowDom Jan 9, 2025
634b096
add withdrawal fork tests
sparrowDom Jan 9, 2025
13b189b
Merge remote-tracking branch 'refs/remotes/origin/nicka/sonic' into n…
sparrowDom Jan 9, 2025
648c99a
add restaking test
sparrowDom Jan 9, 2025
c920ca9
add withdrawal timestamp to the withdrawal struct
sparrowDom Jan 9, 2025
ad65a5a
Updated Sonic token metadata
naddison36 Jan 10, 2025
ce6d461
prettier
naddison36 Jan 10, 2025
c76556a
Update Natspec
naddison36 Jan 10, 2025
5cb03a9
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Jan 10, 2025
07b1a51
Added VaultValueChecker to Sonic deploy script
naddison36 Jan 10, 2025
3dcdcc0
Added phase 2 contracts to Sonic contract dependencies
naddison36 Jan 10, 2025
2d60303
Generated Sonic contract diagrams
naddison36 Jan 10, 2025
929ec25
Added Sonic fork tests for Zapper
naddison36 Jan 10, 2025
6030ffc
Merge remote-tracking branch 'origin/master' into nicka/sonic
naddison36 Jan 10, 2025
e4ea827
Reduced depositedWSAccountedFor when delegating or withdrawing from t…
naddison36 Jan 10, 2025
5e541b2
Generated latest SonicStakingStrategy
naddison36 Jan 10, 2025
fb3e84b
Added Sonic Vault config to deploy script
naddison36 Jan 10, 2025
f42824c
Added TODO in Sonic addresses
naddison36 Jan 10, 2025
5a07769
Added Sonic Vault fork tests
naddison36 Jan 10, 2025
0b5aea3
remove the depositedWSAccountedFor
sparrowDom Jan 10, 2025
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
98 changes: 73 additions & 25 deletions .github/workflows/defi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
- run: yarn prettier:check
working-directory: ./contracts

contracts-test:
name: "Contracts Unit Tests"
contracts-unit-coverage:
name: "Mainnet Unit Coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -58,15 +58,20 @@ jobs:
- run: yarn install --frozen-lockfile
working-directory: ./contracts

# this will run the unit tests and report the gas usage
- name: Run Unit Tests
env:
REPORT_GAS: true
run: yarn run test
- name: Run Mainnet Unit Coverage
run: yarn run test:coverage
working-directory: ./contracts

contracts-unit-coverage:
name: "Contracts Unit Coverage"
- uses: actions/upload-artifact@v4
with:
name: unit-test-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1

contracts-base-test:
name: "Base Unit Coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -81,20 +86,22 @@ jobs:
- run: yarn install --frozen-lockfile
working-directory: ./contracts

- name: Run Unit Coverage
run: yarn run test:coverage
- name: Run Base Unit Coverage
env:
UNIT_TESTS_NETWORK: base
run: yarn run test:coverage:base
working-directory: ./contracts

- uses: actions/upload-artifact@v4
with:
name: unit-test-coverage-${{ github.sha }}
name: base-unit-test-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1

contracts-base-test:
name: "Contracts Unit Tests (Base)"
contracts-sonic-test:
name: "Sonic Unit Coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -109,24 +116,22 @@ jobs:
- run: yarn install --frozen-lockfile
working-directory: ./contracts

# this will run the unit tests and report the gas usage
- name: Run Unit Tests
- name: Run Sonic Unit Coverage
env:
REPORT_GAS: true
UNIT_TESTS_NETWORK: base
run: yarn run test:coverage:base
UNIT_TESTS_NETWORK: sonic
run: yarn run test:coverage:sonic
working-directory: ./contracts

- uses: actions/upload-artifact@v4
with:
name: base-unit-test-coverage-${{ github.sha }}
name: sonic-unit-test-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1

contracts-forktest:
name: "Contracts Fork Tests ${{ matrix.chunk_id }}"
name: "Mainnet Fork Tests ${{ matrix.chunk_id }}"
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -268,7 +273,7 @@ jobs:
cache: "yarn"
cache-dependency-path: contracts/yarn.lock

- uses: actions/cache@v3
- uses: actions/cache@v4
id: hardhat-cache
with:
path: contracts/cache
Expand All @@ -282,23 +287,66 @@ jobs:
- run: yarn run test:coverage:base-fork
working-directory: ./contracts

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: fork-test-base-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1


contracts-sonic-forktest:
name: "Sonic Fork Tests"
runs-on: ubuntu-latest
continue-on-error: true
env:
HARDHAT_CACHE_DIR: ./cache
PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
SONIC_PROVIDER_URL: ${{ secrets.SONIC_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
cache-dependency-path: contracts/yarn.lock

- uses: actions/cache@v4
id: hardhat-cache
with:
path: contracts/cache
key: ${{ runner.os }}-hardhat-${{ hashFiles('contracts/cache/*.json') }}
restore-keys: |
${{ runner.os }}-hardhat-cache

- run: yarn install --frozen-lockfile
working-directory: ./contracts

- run: yarn run test:coverage:sonic-fork
working-directory: ./contracts

- uses: actions/upload-artifact@v4
with:
name: fork-test-sonic-coverage-${{ github.sha }}
path: |
./contracts/coverage.json
./contracts/coverage/**/*
retention-days: 1

coverage-uploader:
name: "Upload Coverage Reports"
runs-on: ubuntu-latest
needs:
- contracts-unit-coverage
- contracts-base-test
- contracts-sonic-test
- contracts-forktest
- contracts-arb-forktest
- contracts-hol-forktest
- contracts-base-test
- contracts-base-forktest
- contracts-sonic-forktest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
Expand Down
12 changes: 12 additions & 0 deletions contracts/contracts/interfaces/sonic/INodeDriver.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

interface INodeDriver {
/// Seal epoch. Called BEFORE epoch sealing made by the client itself.
function sealEpoch(
uint256[] calldata offlineTimes,
uint256[] calldata offlineBlocks,
uint256[] calldata uptimes,
uint256[] calldata originatedTxsFee
) external;
}
Loading