Skip to content

Feat/sprl2v2 - #12

Merged
FabienCoutant merged 12 commits into
devfrom
feat/sprl2v2
Jun 16, 2026
Merged

FabienCoutant merged 12 commits into
devfrom
feat/sprl2v2

Conversation

@FabienCoutant

@FabienCoutant FabienCoutant commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Aura's sunset on the 20WETH-80PRL pool means sPRL2 can no longer rely on its gauge/rewards. This PR introduces a leaner replacement that just holds the Balancer V3 BPT directly.

  • sPRL2V2 — new vault that deposits PRL+WETH into the Balancer V3 pool and holds the BPT itself (no gauge, no reward forwarding). Same time-lock and penalty mechanics as sPRL2.
  • sPRL2Migrator — one-click migration: pulls sPRL2, calls emergencyWithdraw (sPRL2 must be paused), and deposits the BPT into sPRL2V2.
  • Deployment script + config types for sPRL2V2.
  • Full integration and fork test coverage for both contracts.

Test plan

  • forge test (integration) passes
  • forge test --match-path "test/forks/**" passes against mainnet fork

A new staking vault that holds the 20WETH-80PRL Balancer V3 BPT directly,
with the same time-lock and penalty mechanics as sPRL2.
Use block 24_905_586 where Aura pool PID 258 exists and set real contract addresses.
One-click migration via emergencyWithdraw (paused sPRL2) and depositBPT into sPRL2V2.
During the migration window both sPRL2 and sPRL2V2 are live and
shared the same "sPRL2" symbol. Any downstream consumer keying on
the token symbol (explorers, the reward-merkle distributor's
off-chain eligibility input, dashboards) could conflate the two
tokens, excluding or double-counting balances.

Renames the SYMBOL constant to "sPRL2V2" so the new token is
unambiguously distinguishable on-chain. NAME already differed from
the legacy "...Aura Deposit Vault" so it is left untouched.

The constructor integration test asserts the new symbol.
… requests

requestWithdraw could be called with amount = 0, minting an empty
WithdrawalRequest that occupies a request ID and can even be
cancelled. It serves no purpose in normal operation and only adds
tail risk / a precondition for other invalid states.

Reverts with NullAmount() when the unlocking amount is zero. The
guard lives in the shared base so sPRL1/sPRL2/sPRL2V2 all inherit it.

Adds an integration test asserting the revert.
… zero address

Premature exits transfer the BPT slash to feeReceiver inside the
withdrawal flow. If feeReceiver were address(0), every early
withdrawPRLAndWeth / withdrawBPT would revert on the slash transfer,
DoS-ing all premature withdrawals until governance fixes the address.

Adds a zero-address check both in the base constructor and in
updateFeeReceiver so the fee receiver can never be set to address(0)
at deploy time or via governance. Reverts with FeeReceiverZeroAddress().

Adds constructor and updateFeeReceiver revert tests.
…le tokens

The BPT backing sPRL2V2 sits idle in the contract, so reward tokens
claimed on the contract's behalf (e.g. MERKL distributions routed
onBehalf to the holder) would otherwise be permanently locked with
no way to retrieve them.

Adds a restricted recoverERC20(token) that forwards the full balance
of an arbitrary token to feeReceiver. The guard reverts with
CannotRecoverUnderlying() when token == underlying, so the share-
backing asset (BPT for sPRL2V2, PRL for sPRL1) can never be drained.
Placed in the shared base keyed on `underlying` rather than a
contract-specific BPT check, so every derived staking token benefits.

Adds integration tests in the timeLockPenaltyERC20 suite (matching the
base contract): successful recovery to feeReceiver, revert on the
underlying token, and revert for an unauthorized caller.
…-sPRL2v2

audit(sPRL2V2): Bailsec June 2026 remediation (Bailsec-02/03/05/06)
@FabienCoutant
FabienCoutant merged commit b89c28f into dev Jun 16, 2026
3 checks passed
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.

1 participant