Repository navigation
Lending: the share-inflation attack needs a zero reserve factor - #280
Open
mikemaccana wants to merge 1 commit into
Open
mikemaccana wants to merge 1 commit into
mikemaccana wants to merge 1 commit into
Conversation
A reserve factor rounds its fee up and takes the attacker's one minor unit of interest, so the share price only rises in a reserve with no reserve factor. inflating_shares_through_own_borrow_does_not_pay now runs on such a reserve and checks that the share price rises (quicknode/solana-program-examples#212). Claude-Session: https://claude.ai/code/session_01GZHin6BQpAqf7j2ucSZWkx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge after quicknode/solana-program-examples#212. This PR describes the test as that PR changes it.
What changes
The Lending chapter's share-inflation bullet said a second of interest makes the attacker's one unit of shares "worth two". That is only true in a reserve with no reserve factor. The program rounds its fee up, so a nonzero reserve factor takes the whole one-unit interest and the share price does not move.
inflating_shares_through_own_borrow_does_not_payused the default 10% reserve factor, so it passed without the attack running. quicknode/solana-program-examples#212 changes it to:This PR changes three sentences in
building-financial-products-in-solana/lending.mdso the chapter says:Testing
npm run lintpasses.npm run build-pdf-digitalbuilds the book.Generated by Claude Code