Add details about overdrafts to the documentation#601
Add details about overdrafts to the documentation#601bram-vdberg wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds an Overdrafts section to the accounting reference documenting that penalties and negative slippage are deducted from weekly COW rewards, overdrafts are tracked on-chain via the overdrafts manager, and outlines checking balances and repaying overdrafts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)
111-115: Tighten the wording and add one concrete example call.Use
whoseinstead ofwho'sin both paragraphs, and consider adding a minimalcast/ethersexample forsolverOverdraftBalanceandpayOverdraftso the invocation is unambiguous. Based on learnings, docs under the docs directory should include explicit examples to avoid ambiguity.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/cow-protocol/reference/core/auctions/accounting.md` around lines 111 - 115, Update the two paragraphs to use "whose" instead of "who's" for the solver address references and add one concrete invocation example for each method to remove ambiguity: show a minimal cast or ethers call for solverOverdraftBalance (passing the solver address and noting the return is in wei) and for payOverdraft (passing the solver address and amount in ETH), referencing the overdrafts manager contract and the methods solverOverdraftBalance and payOverdraft so readers can copy the exact invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 109-113: The subsection heading "Paying outstanding overdrafts" is
at the wrong level relative to "Checking outstanding overdrafts"; change the
heading text "### Paying outstanding overdrafts" to "#### Paying outstanding
overdrafts" so it matches the same level as "#### Checking outstanding
overdrafts" and preserves the hierarchy under the "### Overdrafts" section.
- Line 115: The text incorrectly states payOverdraft accepts an amount "in ETH";
update the documentation to say payOverdraft(address solver) has no amount
parameter and the payment is sent via msg.value (denominated in wei) to the
overdrafts manager contract; specifically replace the sentence about passing an
amount in ETH with a note that the transaction's msg.value (wei) is used to pay
the solver's overdraft and mention the function signature payOverdraft(address
solver) to clarify there is no explicit amount parameter.
---
Nitpick comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 111-115: Update the two paragraphs to use "whose" instead of
"who's" for the solver address references and add one concrete invocation
example for each method to remove ambiguity: show a minimal cast or ethers call
for solverOverdraftBalance (passing the solver address and noting the return is
in wei) and for payOverdraft (passing the solver address and amount in ETH),
referencing the overdrafts manager contract and the methods
solverOverdraftBalance and payOverdraft so readers can copy the exact
invocation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1a7c2831-0710-4f06-a332-19eeb4241edf
⛔ Files ignored due to path filters (1)
docs/cow-protocol/reference/core/auctions/checking_overdraft.pngis excluded by!**/*.png
📒 Files selected for processing (1)
docs/cow-protocol/reference/core/auctions/accounting.md
8a7970c to
ad6b700
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)
115-115:⚠️ Potential issue | 🔴 CriticalCorrect the function signature and denomination (duplicate issue).
Line 115 contains two critical errors that were already flagged in a previous review:
No amount parameter exists:
payOverdraft(address solver)takes only the solver address. There is no separate amount parameter to pass.Payment is in wei, not ETH: The payment amount is sent via the transaction's
msg.valuefield, which is always denominated in wei (not ETH).The verified contract source shows:
function payOverdraft(address solver) external payable;Update the documentation to clarify that the payment value is sent as
msg.valuein wei when calling the function.📝 Suggested correction
-In order to pay a solver's outstanding overdraft balance you can call the `payOverdraft` method on the overdrafts manager contract using the address of the solver who's outstanding overdraft you would like to pay, together with the amount that you would like to pay. Note, this amount is in ETH and not in wei. +To pay a solver's outstanding overdraft balance, call the `payOverdraft(address solver)` method on the overdrafts manager contract with the solver's address. Send the payment amount as the transaction value (`msg.value`), denominated in wei.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/cow-protocol/reference/core/auctions/accounting.md` at line 115, Update the docs to reflect the actual function signature and denomination: change the description of payOverdraft to reference the contract function signature function payOverdraft(address solver) external payable and explain that there is no separate amount parameter — the payment is supplied via the transaction's msg.value field and must be denominated in wei (not ETH); mention the overdrafts manager contract and the solver address parameter (payOverdraft) so readers know to send value in msg.value when calling it.
🧹 Nitpick comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)
109-111: LGTM! Accurate description of checking overdrafts.The documentation correctly describes the
solverOverdraftBalancemethod and its return value in wei.Optional style note: "In order to check" could be simplified to "To check" for more concise writing.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/cow-protocol/reference/core/auctions/accounting.md` around lines 109 - 111, The sentence "In order to check your outstanding overdrafts" is wordy; update the docs text in the auctions accounting page to use the more concise phrasing "To check your outstanding overdrafts" while leaving the rest of the description (mentioning solverOverdraftBalance on the overdrafts manager contract and the return in wei) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Line 115: Update the docs to reflect the actual function signature and
denomination: change the description of payOverdraft to reference the contract
function signature function payOverdraft(address solver) external payable and
explain that there is no separate amount parameter — the payment is supplied via
the transaction's msg.value field and must be denominated in wei (not ETH);
mention the overdrafts manager contract and the solver address parameter
(payOverdraft) so readers know to send value in msg.value when calling it.
---
Nitpick comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 109-111: The sentence "In order to check your outstanding
overdrafts" is wordy; update the docs text in the auctions accounting page to
use the more concise phrasing "To check your outstanding overdrafts" while
leaving the rest of the description (mentioning solverOverdraftBalance on the
overdrafts manager contract and the return in wei) unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3df0ab58-3328-4e04-baf2-b066ec0dd84c
⛔ Files ignored due to path filters (1)
docs/cow-protocol/reference/core/auctions/checking_overdraft.pngis excluded by!**/*.png
📒 Files selected for processing (1)
docs/cow-protocol/reference/core/auctions/accounting.md
|
There is a small subsection towards the end that is called My suggestion would be to just add the content of this PR as an extension of that subsection, and not as a separate section above, as you do now |
Description
This PR adds details about the overdrafts and overdraft management contract to the documentation.
Changes
Summary by CodeRabbit