Feature/GBI-2806 - Discovery & Collateral Management#340
Merged
Conversation
Comment on lines
+112
to
+128
| function withdrawCollateral() external nonReentrant { | ||
| address providerAddress = msg.sender; | ||
| uint resignationBlock = _resignationBlockNum[providerAddress]; | ||
| if (resignationBlock <= 0) revert NotResigned(providerAddress); | ||
| if (block.number - resignationBlock < _resignDelayInBlocks) { | ||
| revert ResignationDelayNotMet(providerAddress, resignationBlock, _resignDelayInBlocks); | ||
| } | ||
|
|
||
| uint amount = _pegOutCollateral[providerAddress] + _pegInCollateral[providerAddress]; | ||
| _pegOutCollateral[providerAddress] = 0; | ||
| _pegInCollateral[providerAddress] = 0; | ||
| _resignationBlockNum[providerAddress] = 0; | ||
|
|
||
| emit WithdrawCollateral(providerAddress, amount); | ||
| (bool success,) = providerAddress.call{value: amount}(""); | ||
| if (!success) revert WithdrawalFailed(providerAddress, amount); | ||
| } |
Check warning
Code scanning / Slither
Low-level calls Warning
| } | ||
|
|
||
| function withdrawCollateral() external nonReentrant { | ||
| address providerAddress = msg.sender; |
Check notice
Code scanning / Slither
Missing zero address validation Low
Dependency ReviewThe following issues were found:
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates core dependencies and compiler settings, introduces a split between discovery and collateral management contracts (along with benchmarks and gas reports), and adapts tests to the new APIs.
- Bump Solidity compiler to 0.8.25, Hardhat to 2.25.0, and OpenZeppelin contracts to v5.3.0; remove some legacy getters.
- Add split implementations (
FlyoverDiscoveryFull,FlyoverDiscoveryContract,CollateralManagementContract) and related interfaces. - Introduce a benchmark test with gas reporting and update existing tests to use new contract methods.
Reviewed Changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/fixtures.ts | Switched from getBridgeAddress() to auto-generated .bridge() |
| test/pegin.test.ts | Updated hardcoded addresses for pegin test cases |
| test/discovery.test.ts | Replaced getProviderIds() with the new .providerId() getter |
| test/benchmark.test.ts | Added a comprehensive benchmark suite with console logging |
| package.json | Bumped devDependencies and dependencies versions |
| hardhat.config.ts | Updated Solidity version and added gasReporter configuration |
| e2e/multisig-migration.test.ts | Switched to upgradeAndCall in upgrade tests |
| docs/discovery-report.md | New gas usage report for different LP counts |
| contracts/split/interfaces.sol | New shared types and errors for split contracts |
| contracts/split/FlyoverDiscoveryFull.sol | Full discovery+collateral contract |
| contracts/split/FlyoverDiscovery.sol | Discovery-only contract |
| contracts/split/CollateralManagement.sol | Collateral management contract |
| contracts/**/*.sol | Updated pragma to 0.8.25 across all Solidity files |
| .solhint.json | Updated compiler-version rule to 0.8.25 |
Comments suppressed due to low confidence (2)
test/benchmark.test.ts:181
- This benchmark logs the output but has no assertions against expected values; consider adding checks to validate behavior rather than relying solely on console output.
const discoveryProviders = await discovery.getProviders();
test/discovery.test.ts:27
- [nitpick] Using a method named
providerId()may be unclear—consider renaming the underlying state variable or providing a more descriptive getter likelastProviderId()for consistency.
const lastProviderId = await lbc.providerId();
MaximStanciu8
approved these changes
Jul 11, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
0.8.252.25.05.3.0LiquidityBridgeContractV2to be able to fit the max size with the new version of the OZ contractsDiscoveryand one contract forCollateralManagement)DiscoveryandCollateralManagementinteractregisterisOperationalgetProvidersWhat is NOT in this PR and will be added later
The purpose of this PR is only to gather information to decide if we go with 3 or 4 contracts
Task
https://rsklabs.atlassian.net/browse/GBI-2806