mirror of
https://github.com/vacp2p/staking-reward-streamer.git
synced 2026-01-10 07:48:06 -05:00
As described in #206 it's theoretically possible to cause overflows when either Karma is issued via `mint()` or `setReward()` because both functions don't take the supply of the other "domain" into account. This commit fixes this by performing an arithmetic operation on `super.totalSupply()`, `totalDistributorAllocation` and the newly issued `amount`. If there's an overflow, the code will cause an overflow and reverts. This ensure overflows can't happen *after* rewards have been issued. Closes #206