Use A's staked token balance can be used to mint option token as reward for User B if the payout token equals to the stake token
User's staked token balance can be used to mint option token as reward if the payout token equals to the stake token, can cause user to loss fund\\nIn OTLM, user can stake stakeToken in exchange for the option token minted from the payment token\\nwhen staking, we transfer the stakedToken in the OTLM token\\n```\\n// Increase the user's stake balance and the total balance\\nstakeBalance[msg.sender] = userBalance + amount_;\\ntotalBalance += amount_;\\n\\n// Transfer the staked tokens from the user to this contract\\nstakedToken.safeTransferFrom(msg.sender, address(this), amount_);\\n```\\n\\nbefore the stake or unstake or when we are calling claimReward\\nwe are calling _claimRewards -> _claimEpochRewards -> we use payout token to mint and create option token as reward\\n```\\n payoutToken.approve(address(optionTeller), rewards);\\n optionTeller.create(optionToken, rewards);\\n\\n // Transfer rewards to sender\\n ERC20(address(optionToken)).safeTransfer(msg.sender, rewards);\\n```\\n\\nthe problem is, if the stake token and the payout token are the same token, the protocol does not distingush the balance of the stake token and the balance of payout token\\nsuppose both stake token and payout token are USDC\\nsuppose user A stake 100 USDC\\nsuppose user B stake 100 USDC\\ntime passed, user B accure 10 token unit reward\\nnow user B can claimRewards,\\nthe protocol user 10 USDC to mint option token for B\\nthe OTLM has 190 USDC\\nif user A and user B both call emergencyUnstakeAll, whoeve call this function later will suffer a revert and he is not able to even give up the reward and claim their staked balance back\\nbecause a part of the his staked token balance is treated as the payout token to mint option token reward for other user
Seperate the accounting of the staked user and the payout token or check that staked token is not payout token when creating the OTLM.sol
If there are insufficient payout token in the OTLM, the expected behavior is that the transaction revert when claim the reward and when the code use payout token to mint option token\\nand in the worst case, user can call emergencyUnstakeAll to get their original staked balane back and give up their reward\\nhowever, if the staked token is the same as the payout token,\\na part of the user staked token can be mistakenly and constantly mint as option token reward for his own or for other user and eventually when user call emergencyUnstakeAll, there will be insufficient token balance and transaction revert\\nso user will not able to get their staked token back
```\\n// Increase the user's stake balance and the total balance\\nstakeBalance[msg.sender] = userBalance + amount_;\\ntotalBalance += amount_;\\n\\n// Transfer the staked tokens from the user to this contract\\nstakedToken.safeTransferFrom(msg.sender, address(this), amount_);\\n```\\n