Comment on page
COMPLETED & RESOLVED) Bugs found for previous V2 Farm and Pools (V1 not affected)
*Note* the Original V1 farms are unaffected by these issues.
Some users have unfortunately encountered problems when making withdrawals and deposits of tokens due to bugs found in our smart contract.
No one should use the Emergency Withdrawal function to release funds because using it will result in a loss of funds!
The reason: It subtracts the amount from the user before sending their tokens.
Not every user were affected by this error but we have stopped the Masterchef rewards until we confirm that the proposed solution is adequate. We have however resumed emission rewards in order to allows users to unstake their funds.
A mathematical overflow does not allow any users to release their funds, and this happens because:
amount*accSlimePerShare.div(1e12) is greater than user.rewardDebtThis causes the contract calls to fail.
pending = user.amount.mul(pool.accslimePerShare).div(1e12).sub(user.rewardDebt) ;
To allow these funds to be released, no new deposits by the user should be made and it is necessary to increase the slimePerShare by one pool.
We are confident that this solution will work but to ensure the highest level of certainty, we are working with other developers in the space and with our most recent auditor Solidity Finance. We expect an audit report this Wednesday.
If this solution works as expected, a new SmartChefv2 will be deployed and all these problems should be solved, without deposit fees and hopefully with a new audit. We will be making new announcements to keep everyone up to date and increase emissions to make up for the lost time. 🔜✔️
For those who previously had ZERO issues with unstaking, withdraw your stake as the harvest will be disabled, yield will be burned, emissions will be continued and send you the equivalent amount of harvest after the burn takes place, if you're not able to unstake please wait for our auditor to audit our to-be implemented solution or for further instruction. During unstaking: UNSTAKE the MAX amount, otherwise a timelock might be activated. This timelock duration is different for each user. Further details are explained in the next section. ⚠️PLEASE! DO NOT USE THE EMERGENCY WITHDRAWAL feature, OR ALL YOUR FUNDS WILL BE LOST!⚠️
Solution for Emergency withdrawal
We have added a parameter before "update user amount", now the users will be able to obtain all their funds using the Emergency Withdrawal feature (Guide to be added for V2)
A bug on our withdraw function was found. This bug happened to specific users staking in few of the Pool/Farms that did a withdraw from their total staked amount. On the first attempt that a user withdraws funds, they are sent correctly, but the next withdraw timeframe will be bugged for a duration, and this duration is not the same for each user.
Users that withdraw a bigger amount vs the total will need wait more time to unstake the second time
Withdraw Function bug
Solution to the Withdraw Function bug
When the bug is resolved, you will be able to remove all your tokens, and you MUST unstake ALL your amount staked, otherwise you will need wait again to unstake the remainder. The next time you are able to unstake may take a few hours, it depends of block/rate parameter, the amount a user left staked vs total, and pool.accslimePerShare, this parameters increase with each pool update, until this parameter is bigger than user.rewardDebt parameter, you cant unstake funds.
When you attempt to unstake and high fees amount is showed on your transaction, that means this will fail due to the bug.
To accelerate this process, we plan to increase the emission of SlimeV2/Block by a lot, and set deflation near 100% for all slimeV2 sent by the Master Chef contract. Thus all the harvested balance and slimeV2 withdrawals for slimeV2 Pool will be burned. For the second case, affected users will be reimbursed with 100% of their rightful tokens that were burned.
The new MasterChef (SmartChefv2) will check a user's previous deposit information and if the same user stakes in the same Pools that have been affected, ZERO fees will be applied This whitelist method will work for a specific duration which we will announce. After the announced duration is over, the normal Deposit Fees for the Farms and Pools will be applied on all new deposits.