Audit CL8Y outflow policy exceptions and hardening #70
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#70
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
CL8Y flow audit report:
docs/onchain/cl8y-flow-audit.mdonmainat commit8eb3784.The audit applies the policy that CL8Y flowing into app contracts is generally low risk, while CL8Y flowing out of app contracts should be owner/admin executed, without a timelock, so it can receive manual review.
Findings
FeeSink.withdrawonEcosystemTreasury,CL8YProtocolTreasury, andDoubLPIncentivesmatches the manual-review model:WITHDRAWER_ROLE, no timelock.FeeRouter, publicFeeRouter.distributeFees, WarBow burns,RabbitTreasury.withdraw,RabbitTreasury.receiveFeeburn leg, and prize payouts throughTimeCurve.distributePrizes/PodiumPool.payPodiumPayout.TimeCurve.distributePrizesis public oncereservePodiumPayoutsEnabledis enabled, and the frontend exposes it as a public action. Owner/admin controls the enable flag but not the payout execution call.TimeCurveBuyRouter.buyViaKumbayarefunds the full router CL8Y balance to the current caller. Normal exact-output dust is expected, but accidental/pre-existing CL8Y can be swept by the next caller.rescue,sweep, or fallback CL8Y outflow path was found.Recommendations
TimeCurve.distributePrizesowner/admin-only or add an explicit operator role if payout execution must be manually reviewed.TimeCurveBuyRouterCL8Y refunds to only refund same-transaction surplus or revert on pre-existing CL8Y.FeeRouter.distributeFeesbehavior, and alert on direct/manual calls or unexpected router balances.WITHDRAWER_ROLE,GOVERNOR_ROLE,DEFAULT_ADMIN_ROLE, andTimeCurveowner: multisig/hardware-backed, explicitly not timelocked for final value movement.Withdrawn(token == CL8Y),SinksUpdated,ReservePodiumPayoutsEnabled,BuyFeeRoutingEnabled, andUpgradedevents.acceptedAssetorreserveAsset.mentioned in commit
12b433d3bbImplemented and merged the CL8Y outflow hardening work for issue #70 into
main.Merged/pushed commit:
2af5f562648895d643e81f0ff7dc149b7f5fe82b(Merge branch 'issue-70-cl8y-outflow-hardening'). The temporary local issue branch/worktree was removed after merge;originnow only hasmain.Verification checklist
TimeCurve.distributePrizesisonlyOwner, so prize execution now requires the TimeCurve owner wallet, not just the payout enable flag.TimeCurve.owner()and disables the prize distribution action for non-owner wallets.PodiumPoolsupports one-timesetPrizePusher(TimeCurve)wiring; once set,payPodiumPayoutonly accepts the canonical pusher instead of anyDISTRIBUTOR_ROLEholder.DeployDevwiresPodiumPool.setPrizePusher(address(tc)).TimeCurveBuyRouternow requires a non-zerocl8yProtocolTreasuryconstructor arg and sends post-buyForCL8Y surplus there instead of refunding/sweeping to the buyer.withdraw/receiveFeeCL8Y policy alignment remains explicitly deferred with TODO NatSpec and audit docs.gitleaksand frontendtsc -b.forge test --out out-agent --cache-path cache-agent --match-path 'test/{FeeSinks,TimeCurve,TimeCurveBuyRouter,TimeCurveWarBowCl8yBurns}.t.sol'→ 90 passed, 0 failed.Note: the first Forge run using the default
contracts/outfailed before tests because that directory is root-owned in the local checkout. Re-ran with writableout-agent/cache-agent, then removed those generated dirs before pushing.mentioned in issue #116
mentioned in issue #117
mentioned in issue #207
mentioned in issue #217