Open code423n4 opened 3 years ago
There seems to be an optimization related to the roll function call in brrrr() but this is not it. The nature of the optimization is that should the conditions for roll were ever hit in the brrrr() function, the last moment will not be the same, therefore we can directly pass the number 0 as the "last moment" into our roll function. This will have the effect of writing into the next roller slot.
Handle
0x0x0x
Vulnerability details
Concept
_roller.time
is cached, to use at roll function call. To save gas_roller.time
can be cached after roll function call and avoid caching to save gas.Tools Used
Manual