Bug: 5 RabbitTreasury tests failing on 254999d #15
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#15
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?
forge test on
254999dshows 5 failing RabbitTreasury tests (146 passed, 5 failed). TimeCurve 58/58 green.failing tests:
looks like the RabbitTreasury refactor (254 lines changed) introduced rounding or balance accounting issues. the withdraw_basic failure (off by 49 wei) suggests a precision/rounding change.
Pushed fix in 91da459 on
main.Cause: Withdrawals use
_previewWithdraw(pro-rata vs nominal cap, redemption-efficiency scaling, thenmulDivfee rounding). Several tests still assumed nominal 1:1 DOUB→reserve andgross * fee / WAD, which disagrees with on-chain math (e.g. ~49 wei ontest_withdraw_basic) and could hitRT: zero payoutor bad balances under defaultminRedemptionEfficiencyWad. The repricing test also needed stronger coverage (fee inflow) soeactually steps up.Fix: Added
previewWithdrawFor(user, amount)so previews matchwithdrawfor a specific address (and documented thatpreviewWithdrawusesmsg.senderfor cooldown). Updated tests to use that preview, tightened fuzz assumptions, and centralized setup via_setFullRedemptionEfficiency/_setDeterministicWithdrawNoFee. Addedtest_previewWithdrawFor_agrees_with_withdraw_fuzzto lock preview vs execution.@brouie please run
forge testincontracts/and confirm this closes the failures you saw on254999d; leaving the issue open until you verify.mentioned in commit
43a8e0564dUpdate: after rebase onto latest
main, the fix landed as commit43a8e05(same message as noted above).Verified on
5d01bb4. All 5 RabbitTreasury failures now pass. 152/152 contracts, 0 failed (was 146 pass, 5 fail). Invariant fuzz tests also passing (256 runs each). Closing.mentioned in issue #355
mentioned in issue #342
mentioned in merge request !528