Repository navigation
Dev - #10
Open
FabienCoutant wants to merge 26 commits into
Open
Dev#10FabienCoutant wants to merge 26 commits into
FabienCoutant wants to merge 26 commits into
Conversation
Refactor docs
Add deployment configurations for mainnet, polygon, base, and sonic chains. Add Foundry scripts for setting access manager roles on deployed contracts. Update AURA_POOL_PID to 258 and add base/sonic network support.
feat: mainnet deployment configs and role-setting scripts
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)
Feat/sprl2v2
Replaces the Hardhat v2 + hardhat-deploy v0.14 (ethers v5) deploy toolchain with Hardhat v3 + hardhat-deploy v2 built on rocketh (viem), matching the parallel-parallelizer setup. Foundation: - package.json: "type": "module"; swap hardhat-deploy@0.14 -> hardhat-deploy@^2, hardhat@^3, rocketh + @rocketh/* (0.19.x), viem, @nomicfoundation/hardhat-viem; drop hardhat-foundry/contract-sizer; scripts: verify -> "rocketh-verify etherscan", add "size". - tsconfig.json: ESM (esnext/bundler), @rocketh and @generated aliases. - hardhat.config.ts: v3 plugins array, networks with type:"http", PRIVATE_KEY accounts, solc 0.8.25/cancun. Hardhat sources pinned to contracts/ with tests redirected so Foundry tests under test/ are not compiled by Hardhat. remappings.txt gains contracts/=contracts/. - rocketh.ts: typed config + deploy/read-execute/proxy/viem extensions, setupDeployScripts, re-exports generated artifacts. - commitlint.config.js -> .cjs (CommonJS under ESM). Deploy scripts (sPRL1/sPRL2/sPRL2V2, MainFeeDistributor, SideChainFeeCollector, RewardMerkleDistributor): - rewritten to the deployScript(env) API: env.deploy({account, artifact, args}); network name via env.name; uint args as BigInt. - deploy/utils switched from ethers v5 to viem (isAddress/zeroAddress); removed the obsolete sPRL2V2 recover script and utils/getVerifyConfig. Verification now uses @rocketh/verifier (ETHERSCAN_API_KEY env); .env.example updated. Validated: tsc --noEmit clean, forge build + hardhat compile generate generated/ artifacts, and an end-to-end deploy dry-run of sPRL1 on an in-memory network succeeds.
chore(deploy): migrate to Hardhat v3 + hardhat-deploy v2 (rocketh)
Explicitly add "types": ["node"] so editors resolve Node globals (console, process) in the deploy scripts. tsc already resolved them via auto-included @types/node, but some TS language servers do not.
chore(deploy): include node types in tsconfig
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.
No description provided.