Skip to content

Miners with substantial power can prematurely seizure loans #1

@mrthankyou

Description

@mrthankyou

Description of the Bug

The PawnBank contract seizeNFT function requires that the the loanCompletionTime be less than the block's timestamp:

require(loan.loanCompleteTime < block.timestamp, "Can't seize before expiry.");

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 the block.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions