Intercoin / CommunityCoinContract

Contracts to let people stake various tokens and use the trust that was built up in Intercoin's factory code.
GNU Affero General Public License v3.0
12 stars 2 forks source link

incorrect calculation in user tokens by instance #53

Closed artman325 closed 2 years ago

artman325 commented 2 years ago

Data:

tariffUnstake =10%

Steps to reproduce:

user#1 buy 100ITR for 100ETH and stake it obtain 100ITRc wait locked time unstake 100ITRc. obtain 90ITR user#2 transfer some(i.e.50ITRc) to user#1 user#1 can unstake 10 ITRc(minus unstake Tarif) immediately although he haven't staked tokens (and haven't redeem role)

Actual:

user can be able to unstake additional tokens as was consuming by tarifUnstake

Expected:

user can not be able do that

Additional:

seems this happens when decreasing amount from users[account].unstakeable and do it by amount with taxes need to decrease full amount(without taxes) from user, but from instances should be with taxes. it will leads to fact that instance will be contain more and more funds. and further users does not to need choose several instances when try to redeem