Qa test sync#494
Open
Luisfc68 wants to merge 52 commits into
Open
Conversation
Qa test -> master
chore: add mainnet deployment info
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Feature/FLY-2295 - Validate pegout refund address
Feature/FLY-2300 - Allow pegout refunds for non-penalization cases
Fix/FLY-2299 - Limit provider data
fix: allow only providers with min collateral in depositPegout and getProviders
refactor: update transparent proxy usage
… slash (F-57455) (#464) * feat(collateral): clear resignation flag on zero withdraw after slash After resignation delay, LPs with zero combined collateral can clear _resignationBlockNum without revert so they can re-register. Adds behavioral regression tests; no public ABI change. * style(test): format Resign and FlyoverDiscovery tests with Prettier * test(integration): assert provider id is reused on re-register after slash Lock in FlyoverDiscovery id stability when an LP re-registers after resign, slash to zero, and zero withdraw on the F-57455 path.
…467) * fix: block collateral management in validate pegin quote * 2.0.1 chore: update pegin contract version refactor: remove test contracts * chore: rollback version number
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
refactor: add foundry upgrades
feat: remove penalization on late refund call for pegout
feat: validate btc prefix in hashPegInQuote
Version 2.5.1 -> master
251 deployment info
Dependency ReviewThe following issues were found:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR syncs QA-Test with release 2.0.1 by tightening collateral/validation rules in core contracts, aligning FlyoverDiscovery listing behavior with minimum collateral, and updating deployment tooling/tests (including new BTC-address datasets and fuzz coverage).
Changes:
- Enforce “minimum collateral sufficiency” (not just non-zero collateral) for peg-out deposits and public provider listing; add min-collateral lower-bound validation in CollateralManagement.
- Harden quote/tx validation (e.g., PegOut
rskRefundAddress != 0, PegIn BTC address prefix checks; preventcallForUsertargeting sensitive contracts). - Migrate deployment scripts/tests toward OZ transparent proxy admin expectations + add proxy/admin introspection scripts and test fixtures/datasets.
Reviewed changes
Copilot reviewed 75 out of 104 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/pegout/LpRefund.t.sol | Updates peg-out refund/validation tests for resigned LP behavior and new penalty collateral rules. |
| test/pegout/Hashing.t.sol | Adds hashing revert coverage for zero rskRefundAddress. |
| test/pegout/Deposit.t.sol | Adds deposit revert coverage when LP collateral is below minimum and when refund address is zero. |
| test/pegin/RegisterPegIn.t.sol | Adjusts tests for mainnet prefix validation + uses shared BTC test constants. |
| test/pegin/PegInTestBase.sol | Adds deployPegInContract(bool mainnet) and refactors dependency deployment/caching. |
| test/pegin/Hashing.t.sol | Uses shared BTC test constant for refund/provider BTC addresses. |
| test/pegin/DerivationAddress.t.sol | Splits mainnet/testnet fixtures and updates expected derived addresses. |
| test/pegin/CallForUser.t.sol | Uses shared BTC test constant; adds regression test for callForUser slasher-role weaponization. |
| test/integration/FlyoverDiscovery.t.sol | Adds integration test for re-registration after resign/slash/withdraw. |
| test/helpers/FlyoverTestBase.sol | Updates proxy deployments to OZ v5-style admin ownership handling (no explicit ProxyAdmin deployment). |
| test/helpers/BtcAddressDataset.sol | New helper to load BTC address fixtures from JSON datasets for fuzz tests. |
| test/fuzz/pegin/PegInHashPegInQuote.fuzz.t.sol | New fuzz suite validating BTC address script-type acceptance/rejection via datasets. |
| test/fuzz/pegin/PegInFuzzTestBase.sol | Uses shared BTC test constant for refund/provider BTC addresses. |
| test/fuzz/collateral/CollateralFuzzTestBase.sol | Uses shared BTC test constant for BTC address bytes in fuzz quote builders. |
| test/discovery/Update.t.sol | Updates error expectations and adds max-length validation tests for provider metadata. |
| test/discovery/Registration.t.sol | Updates error expectations and adds max-length validation tests for provider metadata. |
| test/discovery/ListingFilter.t.sol | Adds test ensuring listing excludes providers below raised minimum collateral. |
| test/discovery/DiscoveryTestBase.sol | Adds helper utilities/constants for provider metadata length boundary tests. |
| test/deployment/DeployPegOut.t.sol | Updates deployment tests to assert proxy admin ownership + upgradeability via ProxyReader. |
| test/deployment/DeployPegIn.t.sol | Updates deployment tests to assert proxy admin ownership + upgradeability via ProxyReader. |
| test/deployment/DeployFlyoverDiscovery.t.sol | Updates deployment tests to assert proxy admin ownership + upgradeability via ProxyReader. |
| test/deployment/DeployFlyover.t.sol | Updates full-system deployment tests for per-proxy admin ownership + upgradeability checks. |
| test/deployment/DeployCollateralManagement.t.sol | Updates deployment tests to assert proxy admin ownership + upgradeability via ProxyReader. |
| test/datasets/p2wsh.json | New BTC address fixture dataset (P2WSH). |
| test/datasets/p2wpkh.json | New BTC address fixture dataset (P2WPKH). |
| test/datasets/p2tr.json | New BTC address fixture dataset (P2TR). |
| test/datasets/p2sh.json | New BTC address fixture dataset (P2SH). |
| test/datasets/p2pkh.json | New BTC address fixture dataset (P2PKH). |
| test/constants/btc.sol | New shared BTC bytes constant for testnet P2PKH “zero” address. |
| test/collateral/Slashing.t.sol | Updates BTC address bytes in test quote builders. |
| test/collateral/Resign.t.sol | Updates behavior expectations: withdraw clears resignation when collateral is already zero. |
| test/collateral/Configuration.t.sol | Adds min-collateral boundary tests (initialize + setter). |
| src/PegOutContract.sol | Enforces collateral sufficiency for deposits; adds refund penalty collateral requirement; validates non-zero rskRefundAddress; adjusts penalization logic; allows resigned LP for validate/refund. |
| src/PegInContract.sol | Adds BTC prefix checks + expands restricted contractAddress targets to prevent abuse. |
| src/interfaces/IPegOut.sol | Adds InsufficientCollateral error for penalized refund path. |
| src/interfaces/IFlyoverDiscovery.sol | Replaces provider-data error with ProviderDataLengthOutOfBounds carrying lengths and maxes. |
| src/interfaces/ICollateralManagement.sol | Adds MinCollateralTooLow error surfaced by implementation. |
| src/FlyoverDiscovery.sol | Enforces provider metadata length bounds; listing now depends on collateral sufficiency. |
| src/CollateralManagement.sol | Enforces minCollateral >= 1; withdraw clears resignation when balance is zero; adds sufficiency checks tied to min collateral. |
| script/tasks/QueryProxyAdmin.s.sol | New script to read proxy admin from ERC-1967 slot. |
| script/tasks/QueryFlyoverRoles.s.sol | New script to query Flyover roles for a scan set of addresses. |
| script/tasks/GetVersions.sh | Updates network-key handling + addresses.json key names. |
| script/helpers/ProxyReader.sol | New helper to read proxy admin/implementation slots via cheatcodes. |
| script/helpers/AddressResolver.sol | Aligns address resolution key with CollateralManagementContract. |
| script/HelperConfig.s.sol | Adds OZ upgrades Options helper; adjusts local bridge handling for regtest chain id. |
| script/deployment/DeployPegOut.s.sol | Migrates deployment to OZ Foundry Upgrades deployTransparentProxy. |
| script/deployment/DeployPegIn.s.sol | Migrates deployment to OZ Foundry Upgrades deployTransparentProxy. |
| script/deployment/DeployPauseRegistry.s.sol | Migrates deployment to OZ Foundry Upgrades deployTransparentProxy. |
| script/deployment/DeployLibraries.s.sol | New script to deploy linked libraries required by PegIn/PegOut. |
| script/deployment/DeployFlyoverDiscovery.s.sol | Migrates deployment to OZ Foundry Upgrades deployTransparentProxy. |
| script/deployment/DeployFlyover.s.sol | Migrates full stack deployment to OZ Foundry Upgrades and logs per-proxy admin addresses. |
| script/deployment/DeployCollateralManagement.s.sol | Migrates deployment to OZ Foundry Upgrades deployTransparentProxy. |
| README.md | Updates Makefile network key examples (e.g., rskTestnet). |
| package.json | Bumps version to 2.0.1; updates upgrade scripts’ NETWORK keys; adds OZ upgrades-core. |
| foundry.toml | Enables storage layout outputs (upgrades support) and updates OZ remappings. |
| foundry.lock | Adds OZ upgrades-related submodules/versions. |
| eslint.config.mjs | Ignores lib/*. |
| docs/FOUNDRY_MAKEFILE_GUIDE.md | Updates network keys and examples to new naming. |
| broadcast/DeployLibraries.s.sol/31/dry-run/run-latest.json | Adds dry-run deployment artifact for chain 31. |
| broadcast/DeployLibraries.s.sol/30/dry-run/run-latest.json | Adds dry-run deployment artifact for chain 30. |
| addresses.json | Updates stored addresses for multiple networks to new deployment outputs/keys. |
| .gitmodules | Adds OpenZeppelin upgrades-related submodules. |
| .gitignore | Starts tracking broadcast artifacts for chains 30 and 31. |
Comment on lines
75
to
87
| "rskMainnet": { | ||
| "SignatureValidator": { | ||
| "address": "0xb107cc96A5CfC4Be502e9BBB1208dE4792044ba7", | ||
| "address": "0xB0824559dF4a0872A61B228466bAd12E733F7DEC", | ||
| "deployed": true | ||
| }, | ||
| "Quotes": { | ||
| "address": "0xecfF1feFa8814c980330ca1000B067BBC9D2ee25", | ||
| "address": "0xaAFf2c6D3185Ccd03d9781E689005c314b936ac1", | ||
| "deployed": true | ||
| }, | ||
| "BtcUtils": { | ||
| "address": "0x0FCf6ed9DBA0AE3AD3f6908a9499285720a6d43d", | ||
| "address": "0xd8D956312222D8AcaBb58569Cc960A93B1AA2F7A", | ||
| "deployed": true | ||
| }, |
Comment on lines
+6
to
+11
| import {ProxyReader} from "../helpers/ProxyReader.sol"; | ||
| import {PegOutContract} from "../../src/PegOutContract.sol"; | ||
| import {PauseRegistry} from "../../src/PauseRegistry.sol"; | ||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
| import {Options} from "openzeppelin-foundry-upgrades/Options.sol"; | ||
| import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; |
Comment on lines
+6
to
+11
| import {ProxyReader} from "../helpers/ProxyReader.sol"; | ||
| import {PegInContract} from "../../src/PegInContract.sol"; | ||
| import {PauseRegistry} from "../../src/PauseRegistry.sol"; | ||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
| import {Options} from "openzeppelin-foundry-upgrades/Options.sol"; | ||
| import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; |
Comment on lines
5
to
+10
| import {HelperConfig} from "../HelperConfig.s.sol"; | ||
| import {ProxyReader} from "../helpers/ProxyReader.sol"; | ||
| import {PauseRegistry} from "../../src/PauseRegistry.sol"; | ||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
| import {Options} from "openzeppelin-foundry-upgrades/Options.sol"; | ||
| import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; |
Comment on lines
5
to
+11
| import {HelperConfig} from "../HelperConfig.s.sol"; | ||
| import {ProxyReader} from "../helpers/ProxyReader.sol"; | ||
| import {FlyoverDiscovery} from "../../src/FlyoverDiscovery.sol"; | ||
| import {PauseRegistry} from "../../src/PauseRegistry.sol"; | ||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
| import {Options} from "openzeppelin-foundry-upgrades/Options.sol"; | ||
| import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; |
Comment on lines
5
to
+11
| import {HelperConfig} from "../HelperConfig.s.sol"; | ||
| import {ProxyReader} from "../helpers/ProxyReader.sol"; | ||
| import {CollateralManagementContract} from "../../src/CollateralManagement.sol"; | ||
| import {PauseRegistry} from "../../src/PauseRegistry.sol"; | ||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
| import {Options} from "openzeppelin-foundry-upgrades/Options.sol"; | ||
| import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; |
Comment on lines
12
to
19
| @@ -12,28 +16,37 @@ import {PegInContract} from "../../src/PegInContract.sol"; | |||
| import {PegOutContract} from "../../src/PegOutContract.sol"; | |||
|
|
|||
| import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | |||
| import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | |||
|
|
|||
AndresQuijano
approved these changes
Jun 29, 2026
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
Merge changes of the latest version (2.0.1) to QA-Test