Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #119

Open
howlbot-integration bot opened this issue Sep 20, 2024 · 6 comments
Open

QA Report #119

howlbot-integration bot opened this issue Sep 20, 2024 · 6 comments
Labels
1st place bug Something isn't working grade-a Q-03 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax selected for report This submission will be included/highlighted in the audit report sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sufficient quality report This report is of sufficient quality

Comments

@howlbot-integration
Copy link

howlbot-integration bot commented Sep 20, 2024

See the markdown file with the details of this report here.

@howlbot-integration howlbot-integration bot added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sufficient quality report This report is of sufficient quality labels Sep 20, 2024
howlbot-integration bot added a commit that referenced this issue Sep 20, 2024
howlbot-integration bot added a commit that referenced this issue Sep 20, 2024
@laurenceday
Copy link

laurenceday commented Sep 21, 2024

Thank you for the effort involved in putting together this report. There's only one change we'll make here, a docs update based on number 6. The rest is either expected behaviour or things we aren't interested in fixing.

  1. This is expected behaviour: we don't envisage anyone ever actually creating a market with a 100% reserve ratio, but at the same time it's similarly unlikely that anyone would create one with 90%, so the boundary is somewhat illusory. If someone did do the former, they'd be expected to immediately transfer some assets in upon first deposit to account for protocol fees anyway (indeed, they'd be required to): perhaps if a borrower wanted a vanity wrapped token at 0% APR, for example.

  2. We're not too fussed about this taking place (it's extremely unlikely that feeRecipient would get blocked by stablecoin issuers/WETH/cbBTC), and if someone created a market for a memecoin that blocked the address, that's just too bad for Wildcat really. One would anticipate that the market wouldn't react well to a token that made a decision like that in any event, so it's not as if the protocol would likely stand to lose much by way of revenue. We want to keep feeRecipient immutable, and a pull pattern would need a whitelisted set of addresses anyway that we don't want to have update power for.

  3. Rebasing tokens are explicitly mentioned in the audit repo and whitepaper for V1 as breaking the underlying interest model, and should not be used as underlying assets (Wildcat is likely to blacklist a few of the most popular ones just to hammer the point home).

  4. Pardon? That's not how this works - approving someone for 100 market tokens isn't going to let someone transfer 101 market tokens down the line, the approval mapping stays static. The 'scaling being done' that you observe is literally just tracking how much of the underlying asset is now held, in exactly the same way as balanceOf works for standard ERC-20s.

  5. The impact on frequent updating is not nearly as severe as you might imagine - we are well aware of this, however: it is a design choice.

image

  1. We'll update the docs in time, cheers.

  2. It is extremely unlikely that an external protocol would want to integrate the result of a sanctioned escrow account being activated, but fair observation.

  3. Expected behaviour that we don't wish to fix: the point here is to allow sentinels or borrowers to execute things to keep the withdrawal queue clear. We can't reasonably account for things like wallet upgrades. We can see a lender getting confused and angry that their funds aren't in their wallet because they forgot to execute a queued withdrawal themselves, and it'll just be easier for someone else to sweep things to them.

  4. Not a concern.

  5. Not a concern.

  6. Burning a claim on credit is a mad thing to do (read: we don't expect this to happen, and if it does, good luck to the lender). Adding this check would add unreasonable gas bloat to every single transfer.

  7. ERC-20s used as underlyings are expected to be well-formed/'standard'. Esoteric tokens such as this aren't a concern of ours.

  8. We want this in place: it's our observed experience that capped vaults don't have people trying to push right up to the wei, and if they're interested in doing so they should just be using depositUpTo instead of deposit. Our UI handles this.

  9. Incorrect. Sanctions are checked in the _getAccount(msg.sender) function.

  10. Not expecting this to happen: if it does, the borrower can transfer in from another address using repay as needed. More generally, the potential to update the borrower address would be a significant attack vector, and as such we made the early decision to not enable this.

  11. Market controller factories are deprecated in V2. Even if they weren't, the archcontroller owners would quite simply not be deploying MCFs that were owned by someone else except in the case of a mistake, and any borrower that tried to use them would find that they weren't registered with that new archcontroller address so couldn't deploy anyway.

  12. This may be precisely what is desired in the event that a borrower is targeted by a hostile Chainalysis oracle, and it's not as if we can distinguish between a 'real' and a 'fake' sanction. Besides, a borrower wouldn't have any market tokens to send into a sentinel escrow contract anyway: they aren't using withdrawals as lenders do.

  13. Sir, if (state.isClosed) revert_AprChangeOnClosedMarket(); is literally the second line of the function.

  14. Not a concern: fees are read directly into the UI from a lens contract, and even if this happened, a borrower that disagreed would be free to terminate their market as soon as they noticed for minimal 'damage'.

  15. Expected behaviour - each market is its' own token contract as well, and allowing the 'resetting' of these would be extremely dangerous.

  16. No response needed.

  17. No response needed: compilation speed is not a concern of ours for this.

  18. Dawg, that's eighty years from now. I think we'll be fine. My grandchildren will not be inheriting a Wildcat market.

  19. Expired credentials are still credentials, and this is used for withdrawal permissions. Unset credentials (i.e. explicitly rescinded) are set to 0. This is expected behaviour.

  20. Not a concern.

  21. Not a concern: we'll deploy on chains once PUSH0 is supported.

@laurenceday laurenceday added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Sep 21, 2024
@c4-judge
Copy link
Contributor

3docSec marked the issue as grade-a

@3docSec
Copy link

3docSec commented Oct 16, 2024

Please exclude from report: QA-04, QA-14, QA-18
All others can be included without changes.

@c4-judge
Copy link
Contributor

3docSec marked the issue as selected for report

@c4-judge c4-judge added the selected for report This submission will be included/highlighted in the audit report label Oct 17, 2024
@liveactionllama
Copy link

For awarding purposes, C4 staff have marked as 1st place.

@C4-Staff C4-Staff added the Q-03 label Oct 17, 2024
@liveactionllama
Copy link

In the official report, C4 will be excluding the 3 items referenced in the judge's comment here above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1st place bug Something isn't working grade-a Q-03 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax selected for report This submission will be included/highlighted in the audit report sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sufficient quality report This report is of sufficient quality
Projects
None yet
Development

No branches or pull requests

5 participants