Submitted by carrotsmuggler
Users can lock their liquidity in the TOLP contract and mint OTAP tokens in the TOB contract. The TOB contract has a special mechanism called twAML to balance out how much rewards they emit over time.
Basically, if a user commits OTAP tokens worth more than a minimum amount of shares, they are eligible to sway the votes:
This allows them to influence the magnitude, divergence as well as the twAML value of this asset id.
These values determine how large of a discount the users can get when exercising their options.
Similarly, when users decide to exit their position, or if their lock has expired, either they themselves or other users can kick them out of the TOB system and reset the twAML values to the values it was before.
So the twAML change a single user can cause is limited to their lock duration. However, users also have another option: they can directly burn their OTAP token after participating. This is because the OTAP contract has an open burn function.
Now, these users contributions to the twAML calculations cannot be wiped out after their lock expires. This is because the exitPosition function calls otap.burn which will fail since the user has already burnt their tokens.
So users can affect the twAML calculations for an infinite amount of time by burning tokens. This scenario is specifically prevented in the TOLP contract which has a max lock duration enforced with MAX_LOCK_DURATION.
Since users can permanently affect the twAML calculations, this is a medium severity issue.
Users can directly burn tokens due to OTAPs open burn function as evident from the linked code. This prevents exitPosition being called in the TOB contract and thus, never resets the twAML values.
Disable the open burn function in the OTAP contract. Only allows selected contracts such as the TOB contract to call it.
Math
0xRektora (Tapioca) confirmed
