dss
dss copied to clipboard
Check bid still exists before calling tick
If an auction has been dealt and tick is called after but in the same block, there's some residue left in storage (end in Flipper and Flapper, end and lot in Flopper ).
Adding a require(bids[id].guy != address(0), "Fl*pper/auction-not-active"); to the top of tick fixes this.
Not an issue now, but we want to be good citizens and not bloat state.
I might use "Fl*pper/auction-not-active" as opposed to "Fl*pper/guy-not-set" as that's more likely to be meaningful to someone debugging a failed transaction.
Good point.
just FYI this was raised by both TOB and Peckshield and we decided that this was not an issue we needed to fix for launch as ticking an inactive/non-initialized auction had no negative effects
Thinking about this more, we should consider just wrapping the tick logic in if (bids[id].guy != 0) { ... } for backwards compatibility. But maybe that doesn't matter.