Closed odyslam closed 1 year ago
Wouldn't it be more efficient to just track lastPurchaseTime, updating that only during purchase(), and during flagging check that trigger time is after lastPurchaseTime? Fewer storage writes and probably easier to understand.
Great suggestion. Will should do that.
On top of this, we need to check that the response has happened after last auction, as an orb can change hands not only through a purchase
but also through foreclose -> auction
Description
A holder can flag the response to the question of a previous holder.
purchases
the Orb from Alice on the following day, day 1. He can callflagResponse
, and give thetriggerId
of Alice's invocation.This is because all the following checks will pass:
if (block.timestamp - responses[triggerId].timestamp > RESPONSE_FLAGGING_PERIOD) { revert FlaggingPeriodExpired( triggerId, block.timestamp - responses[triggerId].timestamp, RESPONSE_FLAGGING_PERIOD ); }
if (responseFlagged[triggerId] == true) { revert ResponseAlreadyFlagged(triggerId); }