Skip to content

Qa test sync#494

Open
Luisfc68 wants to merge 52 commits into
QA-Testfrom
QA-Test-sync
Open

Qa test sync#494
Luisfc68 wants to merge 52 commits into
QA-Testfrom
QA-Test-sync

Conversation

@Luisfc68

Copy link
Copy Markdown
Collaborator

What

Merge changes of the latest version (2.0.1) to QA-Test

Luisfc68 and others added 30 commits April 28, 2026 23:38
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
Copilot AI review requested due to automatic review settings June 24, 2026 14:04
@Luisfc68 Luisfc68 requested a review from a team as a code owner June 24, 2026 14:04
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Dependency Review

The following issues were found:

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
  • ⚠️ 11 packages with OpenSSF Scorecard issues.

View full job summary

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; prevent callForUser targeting 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 thread addresses.json
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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants