dss icon indicating copy to clipboard operation
dss copied to clipboard

Check bid still exists before calling tick

Open nanexcool opened this issue 5 years ago • 4 comments

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.

nanexcool avatar Nov 22 '19 06:11 nanexcool

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.

kmbarry1 avatar Nov 22 '19 06:11 kmbarry1

Good point.

nanexcool avatar Nov 22 '19 06:11 nanexcool

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

iamchrissmith avatar Nov 22 '19 15:11 iamchrissmith

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.

kmbarry1 avatar Mar 18 '20 20:03 kmbarry1