fix: staking audit fixes#19449
Conversation
Cantina audit finding #7: _decreasePeData unconditionally reset lastUpdate on every decrease, penalizing partial unstakers by resetting their staking weight. Now lastUpdate is only reset when effectiveStake reaches zero. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cantina audit finding #8: transferOwnership now nominates a pending owner who must call acceptOwnership() to finalize the transfer, preventing irrevocable ownership loss from incorrect addresses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…edStaker Cantina audit finding #10: when a beneficiary removes a staker from their allowlist, the staker's lastUpdate is reset via _increasePeData, losing accumulated staking weight. Document this as an inherent trust assumption of the delegation model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/ci authorize e825114 |
|
🤖 AI-generated security review — produced by Verdict: APPROVESummaryThis PR implements three staking audit fixes: (1) AnalysisInjection Scan: Clean. Security Findings: None. Pass 2 — Structural & behavioral analysis:
Pass 3 — Diff context: No safety checks removed. The Pass 4 — Cross-file interaction: All artifacts are consistent: implementation, interface, ABI snapshot, storage layout snapshot, semver hashes, and tests. Pass 5 — Parameter/threshold validation: No numeric constants or security thresholds changed. N/A. Risk Assessment: Low RationaleAll three code-affecting changes are mechanically correct and follow established patterns. The two-step ownership transfer properly prevents irrevocable ownership loss to a wrong address. The |
packages/contracts-bedrock/interfaces/periphery/staking/IPolicyEngineStaking.sol
Show resolved
Hide resolved
packages/contracts-bedrock/src/periphery/staking/PolicyEngineStaking.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/snapshots/storageLayout/PolicyEngineStaking.json
Show resolved
Hide resolved
packages/contracts-bedrock/src/periphery/staking/PolicyEngineStaking.sol
Show resolved
Hide resolved
|
/ci authorize 1aafc49 |
|
/ci authorize ac69908 |
|
/ci authorize a3bd4de |
packages/contracts-bedrock/src/periphery/staking/PolicyEngineStaking.sol
Show resolved
Hide resolved
13c74c6
Summary