-
Notifications
You must be signed in to change notification settings - Fork 23
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
Miners with substantial power can prematurely seizure loans #1
Comments
Great catch, using timestamp space over block time-space was an active decision I made after looking around a bit. The context being that for a fixed-term loan product where it is important for a borrower to know exactly when their loan expires, using a timestamp is more accurate than working with variable block times. My understanding is that Perhaps the easy solution is to keep the block timestamp, but add a constant 15-minute (900 second) buffer window to all loans, where interest is not accrued, at the expense of the lender. This would scale poorly for very short-dated, high-interest loans, but I doubt such short-termed loans will be common via PawNFT. |
Yeah, this is a tough one. On one hand block.timestamp is tough to manipulate. You have to find a solution that is elegant but also solves the security issue, in this case not utilizing |
Right, makes sense. Will leave this issue open for anyone who wants to adapt the contracts for their own use. |
Description of the Bug
The PawnBank contract seizeNFT function requires that the the loanCompletionTime be less than the block's timestamp:
Unfortunately, the code is using
block.timestamp
to determine the current block timestamp. This can be manipulated by a major block miner who if has enough ming power can insert their own transaction that manipulates theblock.timestamp
value in such a way that they can seize a NFT loan before it expires.Solution
Do not use
block.timestamp
to determine if a loan is expired. Unfortunately I do not have a strong suggestion for a fix. I would be interested in what ideas you do have to fix this.Anything Else We Should Know
The text was updated successfully, but these errors were encountered: