Use IRaindexV6.TokenSelfTrade from raindex-interface 0.1.3#2796
Use IRaindexV6.TokenSelfTrade from raindex-interface 0.1.3#2796thedavidmeister wants to merge 4 commits into
Conversation
Bump raindex-interface 0.1.1 -> 0.1.3 and drop the local file-scope TokenSelfTrade declaration; the three revert sites now bind to the error declared on IRaindexV6, and tests reference it via the interface. Creation bytecode is byte-identical to main (bytecode_hash=none), so no redeploy is implied. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR bumps the ChangesRaindex interface dependency bump
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/concrete/raindex/RaindexV6.takeOrder.freshMutation.t.sol (1)
331-332: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
IRaindexV6.TokenSelfTrade.selectorinstead of a hardcoded hash.Other self-trade tests in this PR were updated to reference
IRaindexV6.TokenSelfTrade.selectordirectly (per PR objectives), but this one still manually recomputes the selector viakeccak256("TokenSelfTrade()"). Functionally equivalent today, but it's inconsistent with the rest of the cohort and won't automatically track future signature changes to the interface error.♻️ Proposed fix
- // selector for TokenSelfTrade() as declared on IRaindexV6. - vm.expectRevert(bytes4(keccak256("TokenSelfTrade()"))); + vm.expectRevert(IRaindexV6.TokenSelfTrade.selector);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/concrete/raindex/RaindexV6.takeOrder.freshMutation.t.sol` around lines 331 - 332, In RaindexV6.takeOrder.freshMutation.t.sol, the TokenSelfTrade revert expectation is still computed manually with keccak256 instead of using the interface-defined selector. Update the self-trade assertion in the relevant test to reference IRaindexV6.TokenSelfTrade.selector directly so it stays consistent with the other tests and automatically follows any future error signature changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/concrete/raindex/RaindexV6.takeOrder.freshMutation.t.sol`:
- Around line 331-332: In RaindexV6.takeOrder.freshMutation.t.sol, the
TokenSelfTrade revert expectation is still computed manually with keccak256
instead of using the interface-defined selector. Update the self-trade assertion
in the relevant test to reference IRaindexV6.TokenSelfTrade.selector directly so
it stays consistent with the other tests and automatically follows any future
error signature changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a4729e7c-45a5-4450-8066-3442429a096e
⛔ Files ignored due to path filters (1)
soldeer.lockis excluded by!**/*.lock
📒 Files selected for processing (141)
foundry.tomlremappings.txtsrc/abstract/RaindexV6ArbCommon.solsrc/abstract/RaindexV6ArbOrderTaker.solsrc/abstract/RaindexV6ArbTaskGated.solsrc/abstract/RaindexV6FlashBorrower.solsrc/abstract/RaindexV6FlashLender.solsrc/concrete/raindex/RaindexV6.solsrc/lib/LibOrder.solsrc/lib/LibRaindex.solsrc/lib/LibRaindexArb.soltest/abstract/RaindexV6ArbOrderTaker.badRaindex.t.soltest/abstract/RaindexV6ArbOrderTaker.beforeArbOrder.t.soltest/abstract/RaindexV6ArbOrderTaker.context.t.soltest/abstract/RaindexV6ArbOrderTaker.finalizeDecimals.t.soltest/abstract/RaindexV6ArbOrderTaker.finalizeTaskArg.t.soltest/abstract/RaindexV6ArbOrderTaker.ierc165.t.soltest/abstract/RaindexV6ArbOrderTaker.ioIndexSelection.t.soltest/abstract/RaindexV6ArbOrderTaker.noOrders.t.soltest/abstract/RaindexV6ArbOrderTaker.onTakeOrders2.t.soltest/abstract/RaindexV6ArbOrderTaker.onTakeOrders2Base.t.soltest/abstract/RaindexV6ArbOrderTaker.onTakeOrders2Direct.t.soltest/abstract/RaindexV6ArbOrderTaker.reentrancy.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashPassMatch.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashPassZero.t.soltest/abstract/RaindexV6ArbTaskGated.checkTaskHashWrongTask.t.soltest/abstract/RaindexV6ArbTaskGated.construct.t.soltest/abstract/RaindexV6ArbTaskGated.iTaskHashBoundary.t.soltest/abstract/RaindexV6ArbTaskGated.iTaskHashNonzero.t.soltest/abstract/RaindexV6ArbTaskGated.iTaskHashZero.t.soltest/abstract/RaindexV6FlashBorrower.badLenderApproval.t.soltest/abstract/RaindexV6FlashBorrower.beforeArbOrder.t.soltest/abstract/RaindexV6FlashBorrower.finalizeDecimals.t.soltest/abstract/RaindexV6FlashBorrower.flashLoanAmountLossless.t.soltest/abstract/RaindexV6FlashBorrower.flashLoanAmountValue.t.soltest/abstract/RaindexV6FlashBorrower.flashLoanFailed.t.soltest/abstract/RaindexV6FlashBorrower.inputIoIndexSelection.t.soltest/abstract/RaindexV6FlashBorrower.ioIsInput.t.soltest/abstract/RaindexV6FlashBorrower.mixedDecimals.t.soltest/abstract/RaindexV6FlashBorrower.noOrders.t.soltest/abstract/RaindexV6FlashBorrower.orders0Selection.t.soltest/abstract/RaindexV6FlashBorrower.realTokenTransfers.t.soltest/abstract/RaindexV6FlashBorrower.reentrancy.t.soltest/abstract/RaindexV6FlashLender.griefRecipient.t.soltest/abstract/RaindexV6FlashLender.mockSuccess.t.soltest/abstract/RaindexV6FlashLender.reentrant.t.soltest/abstract/RaindexV6FlashLender.transfers.t.soltest/concrete/arb/GenericPoolRaindexV6ArbOrderTaker.sender.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.exchangeTokenSelection.t.soltest/concrete/arb/GenericPoolRaindexV6FlashBorrower.sender.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.lossyRounding.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.noEthForward.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.nonStandardDecimals.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2Direct.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.onTakeOrders2Fuzz.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.sender.t.soltest/concrete/arb/RouteProcessorRaindexV6ArbOrderTaker.tofuDecimals.t.soltest/concrete/raindex/RaindexV6.addOrder.entask.t.soltest/concrete/raindex/RaindexV6.addOrder.mock.t.soltest/concrete/raindex/RaindexV6.addOrder.nonce.t.soltest/concrete/raindex/RaindexV6.addOrder.owner.t.soltest/concrete/raindex/RaindexV6.addOrder.t.soltest/concrete/raindex/RaindexV6.calculateOrderIOHarness.t.soltest/concrete/raindex/RaindexV6.clear.badStack.t.soltest/concrete/raindex/RaindexV6.clear.calculateStateChange.t.soltest/concrete/raindex/RaindexV6.clear.context.t.soltest/concrete/raindex/RaindexV6.clear.deadOrder.t.soltest/concrete/raindex/RaindexV6.clear.freshDriver.t.soltest/concrete/raindex/RaindexV6.clear.handleIO.revert.t.soltest/concrete/raindex/RaindexV6.clear.mock.t.soltest/concrete/raindex/RaindexV6.clear.sameOwner.t.soltest/concrete/raindex/RaindexV6.clear.sameToken.t.soltest/concrete/raindex/RaindexV6.clear.zeroAmount.t.soltest/concrete/raindex/RaindexV6.deposit.entask.t.soltest/concrete/raindex/RaindexV6.deposit.t.soltest/concrete/raindex/RaindexV6.depositWithdrawHarness.t.soltest/concrete/raindex/RaindexV6.doPost.fresh.t.soltest/concrete/raindex/RaindexV6.entask.t.soltest/concrete/raindex/RaindexV6.multicall.t.soltest/concrete/raindex/RaindexV6.orderMgmt.fresh.t.soltest/concrete/raindex/RaindexV6.quote.sameToken.t.soltest/concrete/raindex/RaindexV6.quote.t.soltest/concrete/raindex/RaindexV6.removeOrder.entask.t.soltest/concrete/raindex/RaindexV6.removeOrder.mock.t.soltest/concrete/raindex/RaindexV6.removeOrder.owner.t.soltest/concrete/raindex/RaindexV6.takeOrder.badStack.t.soltest/concrete/raindex/RaindexV6.takeOrder.batchEvalConsistency.t.soltest/concrete/raindex/RaindexV6.takeOrder.batchStateAdversarial.t.soltest/concrete/raindex/RaindexV6.takeOrder.batchStateBypass.t.soltest/concrete/raindex/RaindexV6.takeOrder.calculationsContext.t.soltest/concrete/raindex/RaindexV6.takeOrder.exceedsMaxRatio.t.soltest/concrete/raindex/RaindexV6.takeOrder.freshMutation.t.soltest/concrete/raindex/RaindexV6.takeOrder.freshVaultZero.t.soltest/concrete/raindex/RaindexV6.takeOrder.handleIO.revert.t.soltest/concrete/raindex/RaindexV6.takeOrder.maximumInput.t.soltest/concrete/raindex/RaindexV6.takeOrder.maximumOutput.t.soltest/concrete/raindex/RaindexV6.takeOrder.minimumIO.t.soltest/concrete/raindex/RaindexV6.takeOrder.minimumIOOutput.t.soltest/concrete/raindex/RaindexV6.takeOrder.noop.t.soltest/concrete/raindex/RaindexV6.takeOrder.precision.t.soltest/concrete/raindex/RaindexV6.takeOrder.sameToken.t.soltest/concrete/raindex/RaindexV6.takeOrder.takenFlag.t.soltest/concrete/raindex/RaindexV6.takeOrder.tokenMismatch.t.soltest/concrete/raindex/RaindexV6.takeOrder.vaultZeroInput.t.soltest/concrete/raindex/RaindexV6.takeOrder.zeroAmount.t.soltest/concrete/raindex/RaindexV6.takeOrder.zeroMaxOOBIndex.t.soltest/concrete/raindex/RaindexV6.vaultBalance.t.soltest/concrete/raindex/RaindexV6.vaultBalanceVault0.t.soltest/concrete/raindex/RaindexV6.withdraw.entask.t.soltest/concrete/raindex/RaindexV6.withdraw.t.soltest/lib/LibOrder.t.soltest/lib/LibRaindex.doPost.t.soltest/lib/LibRaindexArb.finalizeArbTaskContext.t.soltest/util/abstract/IRaindexV6Stub.soltest/util/abstract/MockRaindexBase.soltest/util/abstract/RaindexV6ExternalMockTest.soltest/util/abstract/RaindexV6ExternalRealTest.soltest/util/concrete/Alice.soltest/util/concrete/ChildGatedRaindexV6ArbOrderTaker.soltest/util/concrete/ChildGatedRaindexV6FlashBorrower.soltest/util/concrete/ChildRaindexV6ArbTaskGated.soltest/util/concrete/FlashLendingMockRaindex.soltest/util/concrete/LeftoverFlashLendingMockRaindex.soltest/util/concrete/LibRaindexArbFinalizeHarness.soltest/util/concrete/LibRaindexDoPostHarness.soltest/util/concrete/MaliciousRaindex.soltest/util/concrete/RaindexV6CalculateOrderIOHarness.soltest/util/concrete/RaindexV6ClearStateChangeHarness.soltest/util/concrete/RealisticFlashLendingMockRaindex.soltest/util/concrete/RealisticOrderTakerMockRaindex.soltest/util/concrete/RecordingFlashLendingMockRaindex.soltest/util/concrete/RecordingOrderTaker.soltest/util/concrete/RecordingTaker.soltest/util/concrete/Reenteroor.soltest/util/concrete/ReentrantExchange.soltest/util/concrete/ReentrantMockRaindex.soltest/util/lib/LibTestAddOrder.soltest/util/lib/LibTestArb.soltest/util/lib/LibTestFlashBorrowerArb.soltest/util/lib/LibTestTakeOrder.sol
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🤖 ai:vetter |
|
🤖 ai:vetter |
|
🤖 ai:producer |
|
🤖 ai:producer |
Summary
Companion to rainlanguage/raindex.interface#64 (which declared
TokenSelfTradeonIRaindexV6): an interface declaration is only meaningful if the implementation uses it, so this PR makes raindex consume the interface's declaration instead of keeping a duplicate.raindex-interface0.1.1 → 0.1.3 (foundry.toml + remappings + soldeer.lock + all import paths).error TokenSelfTrade();inRaindexV6.sol— the three revert sites (checkTokenSelfTradeused byquote2/takeOrders4, and the inlineclear3guard) now bind to the inheritedIRaindexV6.TokenSelfTrade.IRaindexV6.TokenSelfTrade.selector; one deadTokenSelfTradeimport removed fromRaindexV6.quote.t.sol.This matches the existing convention: the other 9 interface-declared errors (
NoOrders,ZeroVaultId, …) are already used from the interface without local duplicates.Verification
35d21e65…before and after;bytecode_hash = "none",cbor_metadata = false) — same error signature ⇒ same selector ⇒ no redeploy implied, prod pins unaffected.quote/clear/takeOrdersameToken, calculateOrderIOHarness, freshDriver, freshMutation, deadOrder).script/build.shregenerated; any artifact diffs are staged in the commit.Refs #2671 (item 6).
🤖 Generated with Claude Code
Summary by CodeRabbit