-
Notifications
You must be signed in to change notification settings - Fork 250
test: vaults fuzzing #918
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
Closed
Closed
test: vaults fuzzing #918
Changes from 20 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
483b442
feat: initial deploy to local devnet
eddort e5aa190
feat: speed up scratch deployment for local-devnet
eddort ee55926
refactor: add deployed-local-devnet.json to gitignore
eddort ce8c268
chore: add default pk for local devnet
tamtamchik 2983d01
feat: decrease voting time for devnet
eddort e879318
fix: consensusVersion in VEBO defaults
eddort ce1e448
feat: update default params for devnet
eddort e622b3b
feat: custom SLOTS_PER_EPOCH support
eddort 6c8bab8
fix: change the module type on curated-onchain-v1 for SimpleDVT in th…
Amuhar cf98121
fix: vebo access control and deploy tests
Amuhar 517076e
feat: vebo gas, submitReportData, happyPath tests
Amuhar 8fa4443
fix: submitReportData method tests
Amuhar afc5fa1
feat: test shareRate with fuzzing
sergeyWh1te e772d2a
Merge branch 'feat/vaults' into feat/vaults-fuzzing-share-rate
tamtamchik 0b6fc5c
feat: test shareRate with fuzzing
sergeyWh1te 6317957
feat: test shareRate with fuzzing
sergeyWh1te c289fb8
chore: some refactoring
tamtamchik d79df96
feat: test shareRate with fuzzing
sergeyWh1te 3ac9843
Merge remote-tracking branch 'origin/develop' into feat/val-1556-move…
Amuhar 167c387
feat: fuzz oracleReport
sergeyWh1te 2386b48
chore: add oracle report related contracts
tamtamchik 79ecbbb
fix: accounting initialization
tamtamchik 7fc5b7f
feat: added _sharesRequestedToBurn to fuzzing
sergeyWh1te c9f78d0
feat: added _sharesRequestedToBurn to fuzzing
sergeyWh1te 166ef4b
feat: refactor fuzz.ProtocolDeployment
sergeyWh1te c39aeea
feat: fix incorrect timestamp for Report
sergeyWh1te 7d05ee2
chore: add todos
tamtamchik 2571fe1
build(deps): bump undici from 5.28.4 to 5.28.5
dependabot[bot] 1203e29
feat: wip fuzz handleOracleReport
sergeyWh1te ec51299
Merge pull request #928 from lidofinance/dependabot/npm_and_yarn/undi…
tamtamchik 6ae1888
feat: fuzz clValidators after report
sergeyWh1te ea08979
feat: try to get elRewards
sergeyWh1te f7870a8
feat: invariant_handleOracleReport
sergeyWh1te 2c5f189
Merge commit '2d11786ebc1f06165c501fa8e9fecef053e12ab9' into feat/loc…
mkurayan 02ac654
feat: invariant_handleOracleReport
sergeyWh1te 490652e
feat: check invariant lido.transfer
sergeyWh1te 8b88a72
feat: check invariant_vaultsDonAffectSharesRate
sergeyWh1te 2488ef7
feat: add block explorer verify params to hh config
eddort be1e2d8
Merge branch 'feat/local-devnet' of github.com:lidofinance/core into …
eddort e309222
test: fix new operators discrepancy
tamtamchik d4bcbf3
feat: move common tests setup to provision part
tamtamchik eef9523
feat: simplify provisioning
tamtamchik 46e4593
fix: tests
tamtamchik f492007
feat: add mainnet integration tests to schedule
tamtamchik 7dd0aa4
chore: update CODEOWNERS
tamtamchik 7f6f404
Merge remote-tracking branch 'origin/feat/vaults' into feat/vaults-fu…
tamtamchik e9a302d
feat: stabilize tests
tamtamchik 9e4e49e
Merge pull request #941 from lidofinance/feat/fix-mainnet-integration
tamtamchik 667791a
fix: negative rebase
tamtamchik 106c9c2
Merge pull request #943 from lidofinance/fix/develop
tamtamchik 9a5a20a
Merge pull request #942 from lidofinance/develop
tamtamchik a4bd6b8
feat: hardhat based logs
tamtamchik 3155741
chore: cleanup logs
tamtamchik d4a71e2
chore: refactor
tamtamchik 986cfde
chore: migrate foundry to stable
tamtamchik b0c3352
Merge pull request #946 from lidofinance/fix/foundry
tamtamchik 2f28a18
Merge pull request #944 from lidofinance/feat/auto-trace
tamtamchik a8734c3
Merge branch 'develop' into feat/val-1556-move-vebo-legacy-tests
tamtamchik 087b03e
fix(test): vebo gas test
tamtamchik 014df01
test: speed up gas validation test
tamtamchik 1ef6b88
Merge pull request #917 from lidofinance/feat/val-1556-move-vebo-lega…
tamtamchik 8ffcf2b
fix: hardhat config types
eddort 72a4628
Revert "feat: speed up scratch deployment for local-devnet"
eddort 965cd4c
Merge branch 'develop' of github.com:lidofinance/core into feat/local…
eddort 6e7c60e
fix: integration tests
eddort d1fc7ec
fix: IDepositContract format
eddort f22a7a9
refactor: reset defaults
eddort f4d128f
refactor: env vars
eddort 9492d8f
refactor: env example
eddort 5e7e304
fix: initialize WithdrawalVault
eddort b403164
fix: hh etherscan config
eddort 6089070
fix: wv initialize
eddort 25b4eda
Merge pull request #896 from lidofinance/feat/local-devnet
tamtamchik bec2685
feat: merge develop into fuzzShareRate
sergeyWh1te 144188f
feat: merge develop into fuzzShareRate
sergeyWh1te 9177a9e
feat: merge develop into fuzzShareRate
sergeyWh1te File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // SPDX-License-Identifier: UNLICENSED | ||
| // for testing purposes only | ||
|
|
||
| pragma solidity 0.8.9; | ||
|
|
||
| contract SecondOpinionOracle__Mock { | ||
tamtamchik marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| bool private success; | ||
| uint256 private clBalanceGwei; | ||
| uint256 private withdrawalVaultBalanceWei; | ||
| uint256 private totalDepositedValidators; | ||
| uint256 private totalExitedValidators; | ||
|
|
||
| function getReport(uint256 refSlot) external view returns (bool, uint256, uint256, uint256, uint256) { | ||
| return (success, clBalanceGwei, withdrawalVaultBalanceWei, totalDepositedValidators, totalExitedValidators); | ||
| } | ||
|
|
||
| function mock__setReportValues( | ||
| bool _success, | ||
| uint256 _clBalanceGwei, | ||
| uint256 _withdrawalVaultBalanceWei, | ||
| uint256 _totalDepositedValidators, | ||
| uint256 _totalExitedValidators | ||
| ) external { | ||
| success = _success; | ||
| clBalanceGwei = _clBalanceGwei; | ||
| withdrawalVaultBalanceWei = _withdrawalVaultBalanceWei; | ||
| totalDepositedValidators = _totalDepositedValidators; | ||
| totalExitedValidators = _totalExitedValidators; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,11 @@ | |
|
|
||
| pragma solidity 0.8.9; | ||
|
|
||
| import {StakingRouter} from "contracts/0.8.9/StakingRouter.sol"; | ||
|
|
||
| contract StakingRouter__MockForLidoAccounting { | ||
tamtamchik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| event Mock__MintedRewardsReported(); | ||
| event Mock__MintedTotalShares(uint256 indexed _totalShares); | ||
|
|
||
| address[] private recipients__mocked; | ||
| uint256[] private stakingModuleIds__mocked; | ||
|
|
@@ -32,6 +35,13 @@ contract StakingRouter__MockForLidoAccounting { | |
|
|
||
| function reportRewardsMinted(uint256[] calldata _stakingModuleIds, uint256[] calldata _totalShares) external { | ||
| emit Mock__MintedRewardsReported(); | ||
|
|
||
| uint256 totalShares = 0; | ||
| for (uint256 i = 0; i < _totalShares.length; i++) { | ||
| totalShares += _totalShares[i]; | ||
| } | ||
|
|
||
| emit Mock__MintedTotalShares(totalShares); | ||
| } | ||
|
|
||
| function mock__getStakingRewardsDistribution( | ||
|
|
@@ -47,4 +57,75 @@ contract StakingRouter__MockForLidoAccounting { | |
| totalFee__mocked = _totalFee; | ||
| precisionPoint__mocked = _precisionPoints; | ||
| } | ||
|
|
||
| function getStakingModuleIds() public view returns (uint256[] memory) { | ||
| return stakingModuleIds__mocked; | ||
| } | ||
|
|
||
| function getRecipients() public view returns (address[] memory) { | ||
| return recipients__mocked; | ||
| } | ||
|
|
||
| function getStakingModule(uint256 _stakingModuleId) public view returns (StakingRouter.StakingModule memory) { | ||
| if (_stakingModuleId >= 4) { | ||
| revert("Staking module does not exist"); | ||
| } | ||
|
|
||
| if (_stakingModuleId == 1) { | ||
|
||
| return | ||
| StakingRouter.StakingModule({ | ||
| id: 1, | ||
| stakingModuleAddress: 0x55032650b14df07b85bF18A3a3eC8E0Af2e028d5, | ||
| stakingModuleFee: 500, | ||
| treasuryFee: 500, | ||
| stakeShareLimit: 10000, | ||
| status: 0, | ||
| name: "curated-onchain-v1", | ||
| lastDepositAt: 1732694279, | ||
| lastDepositBlock: 21277744, | ||
| exitedValidatorsCount: 88207, | ||
| priorityExitShareThreshold: 10000, | ||
| maxDepositsPerBlock: 150, | ||
| minDepositBlockDistance: 25 | ||
| }); | ||
| } | ||
|
|
||
| if (_stakingModuleId == 2) { | ||
| return | ||
| StakingRouter.StakingModule({ | ||
| id: 2, | ||
| stakingModuleAddress: 0xaE7B191A31f627b4eB1d4DaC64eaB9976995b433, | ||
| stakingModuleFee: 800, | ||
| treasuryFee: 200, | ||
| stakeShareLimit: 400, | ||
| status: 0, | ||
| name: "SimpleDVT", | ||
| lastDepositAt: 1735217831, | ||
| lastDepositBlock: 21486781, | ||
| exitedValidatorsCount: 5, | ||
| priorityExitShareThreshold: 444, | ||
| maxDepositsPerBlock: 150, | ||
| minDepositBlockDistance: 25 | ||
| }); | ||
| } | ||
|
|
||
| if (_stakingModuleId == 3) { | ||
| return | ||
| StakingRouter.StakingModule({ | ||
| id: 3, | ||
| stakingModuleAddress: 0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F, | ||
| stakingModuleFee: 600, | ||
| treasuryFee: 400, | ||
| stakeShareLimit: 100, | ||
| status: 0, | ||
| name: "Community Staking", | ||
| lastDepositAt: 1735217387, | ||
| lastDepositBlock: 21486745, | ||
| exitedValidatorsCount: 104, | ||
| priorityExitShareThreshold: 125, | ||
| maxDepositsPerBlock: 30, | ||
| minDepositBlockDistance: 25 | ||
| }); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.