vacp2p / staking-reward-streamer

MIT License
0 stars 0 forks source link

Implement `maxMP` in favor of `potentialMP` #44

Closed 0x-r4bbit closed 1 month ago

0x-r4bbit commented 1 month ago

Right now, the contract keeps track of a user's and a global potentialMP

potentialMP is the MP left to mint globally and for individual users until they reach their max amount. Therefore, when userMP and totalMP is increase, potentialMP and user.potentialMP will decrease accordingly (unless stake() is called in which case potentialMP can increase again).

While this works, it turns out to be rather tricky to formally verify that an accountMPLessEqualMaxMP because we don't have any way to easily check what the maxMP is (again potentialMP is not representative because it decreases with time).

So we decided to move away from potentialMP and simply have maxMP which can only increase and be queried at any time.