Submitted by Ruhum, also found by 0xRobocop, bin2chen, KIntern_NA, carrotsmuggler, c7e7eff, 0xnev, glcanvas, marcKn, and dirk_y
https://github.com/Tapioca-DAO/tap-token-audit/blob/59749be5bc2286f0bdbf59d7ddc258ddafd49a9f/contracts/options/TapiocaOptionBroker.sol#L426 
https://github.com/Tapioca-DAO/tap-token-audit/blob/59749be5bc2286f0bdbf59d7ddc258ddafd49a9f/contracts/tokens/TapOFT.sol#L201
An attacker can prevent rewards from being issued to gauges for a given epoch
TapOFT.emitForWeek() is callable by anyone. The function will only return a value > 0 the first time its called in any given week:
In TapiocaOptionBroker.newEpoch() the return value of emitForWeek() is used to determine the amount of tokens to distribute to the gauges. If the return value is 0, it will assign 0 reward tokens to each gauge:
An attacker who frontruns the call to newEpoch() with a call to emitForWeek() will prevent any rewards from being distributed for a given epoch.
The reward tokens arent lost. TapOFT will roll the missed epochs rewards into the next one. Meaning, the gauge rewards will be delayed. The length depends on the number of times the attacker is able to frontrun the call to newEpoch().
But, it will cause the distribution to be screwed. If Alice is eligible for gauge rewards until epoch x + 1 (her lock runs out), and the attacker manages to keep the attack running until x + 2, she wont be able to claim her reward tokens. They will be distributed in epoch x + 3 to all the users who have an active lock at that time.
Heres a PoC:
Test output:
emitForWeek() should return the current weeks emitted amount if it was already called:
0xRektora (Tapioca) confirmed via duplicate issue 192
LSDan (Judge) increase severity to High
