Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staking withdraw fixes #250

Merged
merged 31 commits into from
Jun 8, 2021
Merged

Staking withdraw fixes #250

merged 31 commits into from
Jun 8, 2021

Conversation

jameshowlett977
Copy link
Contributor

@jameshowlett977 jameshowlett977 commented May 27, 2021

Fixes for the following issues:

  1. It wasn't possible to withdraw stake/extend stake/delegate voting power:
    delegate checkpoint wasn't updating for the second and next stakes for the same date if the first stake was withdrawn completely and the second stake was delegating to the staker (no delegation to another address).
  2. Vesting contract can't withdraw stakes if it has stakes between locking dates for the first stake: Vesting contract iterates stakes using 4 weeks.
  3. Multisig should be able to invoke governanceWithdrawVesting. It impacts only team vesting contracts.

@jameshowlett977 jameshowlett977 changed the title Staking withdraw fix Staking withdraw fixes May 27, 2021
@jameshowlett977 jameshowlett977 marked this pull request as draft May 27, 2021 11:39
@jjmr007
Copy link
Contributor

jjmr007 commented Jun 2, 2021

User reports related to extending stakes and withdraw fron Stakes contract:


Ticket N°105:

I'm trying to extend staking but those transactions fail on the rsk explorer.
Then I tried withdrawing, but those transactions also fail.
I tried different computers and different browsers (Chrome, Edge and Brave).
Even made a new virtual machine to install clean browsers and Liquality plugin. I don't know what to do next.

For example:
https://explorer.rsk.co/tx/0xfa4ca495de3ba605d415e01b4d297d4cdd2bead1599ba7f17f28c82de6cb9180
https://explorer.rsk.co/tx/0x95bd2cbedf755fec124e9dadca8292e5330015e573f18f6898c1ae22c8daada3
https://explorer.rsk.co/tx/0xd146573f000d174f9ce8e5dd72d06dcee3427846c58a0a4e7108015d35ee74ce
https://explorer.rsk.co/tx/0x2829efa350689d81c6c695ba5feb4accc606ae442da1209140014d7d1ce4a5d3
https://explorer.rsk.co/tx/0x273eae366286804d155da192ec6bc6dcfc26711d3627fb36c835248804fa9ab0
I'm using Liquality 0.29.0.


Ticket N°239

I can't unstake the 100 SOVS or extending the contract, always saying failed transaction.
txid https://explorer.rsk.co/tx/0x5a4bc108b18c8d998ff2f2c5b49b7a39a829965de2d5356d705bb3cb22cb1e57
my rsk wallet
0x3E07df76bCDa0f20514cAE0350E123812438A998


Ticket N°244:

You can see my address (0x3BF76665B8f364B285B391Bb9fCf17dd10d2F427). All the transactions fails.

My answer to this user:

Regarding this transaction with the Staking contract:

https://explorer.rsk.co/tx/0x9efc1a000afd0598e0fbfd692d657ed8f1080215c0d0a369193b1820aa8dfc33

There is a very serious bug we are tying to solve ASAP. ETA is around 2 weeks. Your funds are safe, but stuk for now.

Regarding transactions like these:

https://explorer.rsk.co/tx/0x1fa15f2d5f8b47458e19debea02cee11ecce78107d760b2fbb06183bdf2d2481
https://explorer.rsk.co/tx/0xe282fbdb4b4b43bd8014cb1cd8479b0360c98b824f43cbd691c5fabf4b5f1cd2
and so on...

All has the same error:

Error Message:
The provided amount should be identical to msg.value

It is most likely a UI bug which I've just reported: DistributedCollective/Sovryn-frontend#1125

Sorry for the inconveniences

Regards


That's all so far... If I found more reports I'll edit this comment. Thanks you all.

Copy link

@eMarchenko eMarchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider saving vesting address and only triggering hack logic when called by it

contracts/governance/Staking/WeightedStaking.sol Outdated Show resolved Hide resolved
contracts/governance/Staking/Staking.sol Outdated Show resolved Hide resolved
contracts/governance/Staking/Staking.sol Outdated Show resolved Hide resolved
contracts/governance/Staking/Staking.sol Outdated Show resolved Hide resolved
contracts/governance/Staking/Staking.sol Outdated Show resolved Hide resolved
contracts/governance/Staking/Staking.sol Outdated Show resolved Hide resolved
@jameshowlett977
Copy link
Contributor Author

@eMarchenko Thank you for the review.
I've applied part of the comments and explained why we can't fix others.
Please take a look.

@jjmr007
Copy link
Contributor

jjmr007 commented Jun 7, 2021

I found a couple of cases of Origin-Vesting-Logics with unlock date of 1622802495 (june-4) which are unable to withdraw tokens:

"dates1":["1622802495"],
"stakes1":["68895000000000000000"],
"user_Origin1":"0x23e9fd8572e5ad4651c0a0a5436d872810dfaf02",
"Vesting_Origin1":"0x3330C1dE5ED7ec70aBB2A1Dd519A53F93B14037A"

"dates2":["1622802495"],
"stakes2":["531810000000000000000"],
"user_Origin2":"0xb92067c703d30b75ae3fef020dd6f62869e26355",
"Vesting_Origin2":"0xB943F2194977ADa97Ef85c9784821b4C38a6d65B"

# Conflicts:
#	scripts/sip/sip_interaction.py
@jameshowlett977 jameshowlett977 marked this pull request as ready for review June 8, 2021 14:56
@jameshowlett977 jameshowlett977 merged commit a95c2ff into development Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants