harmony-one / stake-heist

0 stars 0 forks source link

[~2,000 USD] Add a multi-delegate feature on staking dashboard #6

Open gizemcakil opened 4 years ago

gizemcakil commented 4 years ago

image

About The Bounty

Please carefully review the competition terms and submission process before starting. https://github.com/harmony-one/harmony-open/blob/master/README.md

Description

Proposal: Build a multi-delegation feature on Harmony Staking Dashboard that allows the users to delegate to multiple validators with a single click.

This project requires a good understanding of staking dashboard codebase.

Pain point:

An average delegator is expected to diversify his stake as a general rule of thumb in investing. Especially, when a delegator is not very informed about validator profiles (or don’t wanna understand in general), the natural user behavior is to spread your stake across as many validators as possible

Currently, delegating to a single validator takes: 9 clicks to complete, 1 entry (amount),1 password entry (Chrome ext.)

Nudging users to delegate to as many validators as possible from our own staking explorer UX is the most direct and immediate way to promote decentralization

Suggested user flow:

  1. Click ‘Select validators’ in the validator list page
  2. Select all validators you’d like to delegate to from the list
  3. Click ‘Continue’ to prompt staking tx pop-up window
  4. Enter amount to be delegated (for simplicity, we can start with equal distribution to all validators 5. selected)
  5. Confirm list of validators and amount to be delegated to each
  6. Send tx to chrome extension to be signed as a single tx

image

Useful readings:

Prizes

This bounty is eligible for Tier 2 prize. The final prize will be decided by the Harmony engineering team. The judging criteria for the prizes are:

image

IMPORTANT NOTE: The prizes will be paid in native ONE tokens, the fiat value of prizes will change with token prices.

Explore All Bounties

https://gitcoin.co/profile/harmony-one

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.001 ETH (0.17 USD @ $170.32/ETH) attached to it as part of the harmony-one fund.

JB273 commented 4 years ago

Hello @vikramide! The repo is here https://github.com/harmony-one/staking-dashboard and you can find available api information here https://apitest.harmony.one/?version=latest Some is still wip, but most should work already. Please let us know if you have any questions.

mattlockyer commented 4 years ago

Hello Hacker!

We are aware there is no way to send multiple delegations at once using the JS SDK right now, so this bounty should be viewed as a "frontend only" update.

Make the necessary changes to UI / UX so the user can create a queue of delegations.

When it comes to sending the transactions to the chrome extension, the user will need to confirm each transaction separately (with a new nonce per tx) in order for them to succeed.

For more information about the JS SDK, see here: https://github.com/harmony-one/sdk

Please comment here if you have any further questions.

vikramIde commented 4 years ago

@mattlockyer Thanks. Thats what I was wondering . Like usually we can make a list of transactions and sign the whole packet and submit to network. I could not find that functionality.

So perhaps as you suggested. I can create a list of delegation and then figure out a way to sign each of them in the browser SDK.

Maybe a watcher can come handy here. Once my list of signed tx is ready I could submit it to the network as multiple transactions

vikramIde commented 4 years ago

@mattlockyer Just leaving here my latest update on the UI design .

https://www.loom.com/share/92de51fc0cef4a6886ff0e365b21572f

Code changes

Store DelegationQue.js Select Component . ValidatorSelect.vue Modal MultiDeligationModal.vue

Apart from this added MultiDeligationModal in the PageValidator.vue component.

Let me know if this what you guys wnated. Or I need to make any other changes

mindstyle85 commented 4 years ago

@mattlockyer Just leaving here my latest update on the UI design .

https://www.loom.com/share/92de51fc0cef4a6886ff0e365b21572f

Code changes

Store DelegationQue.js Select Component. ValidatorSelect.vue Modal MultiDeligationModal.vue

Apart from this added MultiDeligationModal in the PageValidator.vue component.

Let me know if this what you guys wnated. Or I need to make any other changes

this looks really nice!

potvik commented 4 years ago

Hey guys I have created special extension version with multi-delegate support

You need to extend harmony-sdk/MsgDelegate event with 2 params to send multi-delegate

3

Then you will see all your delegations in extension

2

After password entering - they will be sign and sent

1

daywednes commented 4 years ago

As Yuriy request, i built an new extension just for testing this extension_gitcoin_test.zip

vikramIde commented 4 years ago

Guys latest update .

Based on audience demand from Open Staking Pangea group

I added the toggle either to assign or divide

Next I am gonna hook the sign functionality of the browser wallet and Boom its ready

https://www.loom.com/share/3e7356d70e8d4fd58ef5a2349f8c5251

@daywednes @potvik , Once I am done with the functionality which is asked in this hackathon.

Ill fix the code to submit Multiple Tx at once.

vikramIde commented 4 years ago

@mattlockyer @gizemcakil

So here is a video of complete feature based on the current scope .

https://www.loom.com/share/b936829cd89749019180004990df82e7

If it looks fine for you guys . I can go ahead and do a submission which I need to figure out .

Perhaps some help would be appreciated .

gizemcakil commented 4 years ago

Thanks @vikramIde this already looks great.

Just one comment: I believe we can batch the transactions and enter the password only once in the chrome extension. This would significantly improve the user flow.

@mikedoan @potvik Is it possible to batch tx more than what @vikramIde demonstrated above?

vikramIde commented 4 years ago

@gizemcakil waiting 💭

mikedoan commented 4 years ago

@vikramIde I think the flow should be like following

image

Yuriy has written a PR https://github.com/harmony-one/wallet-extension/pull/40/files

and i generated the chrome extension based on that PR - can you use the attached extension above.

vikramIde commented 4 years ago

@mikedoan Thanks for the link but

The PR you pointed takes me to 404.

So If i have to change my design to previous design . Then literally will need to change lot of files almost doubling the work. That is why I was asking here if I am on the right track.

But what I can do is figure out the batch transaction functionality once I get the working version of the extension . And add a one click sign all feature.

Also the transaction fee will be added in the end Like how we have FeeTotal and SUbTotal

daywednes commented 4 years ago

why are you using the link? you need to grab the extension I built for you.

The extension is the main work but we already helped you with that.

vikramIde commented 4 years ago

@daywednes Thank you its clear now.

Aye! Aye! captain consider it done.

Will share a video with the batch TX. Post to acceptance will put a PR

vikramIde commented 4 years ago

@daywednes So in our modal we have function called

setMaxAmount() {
      this.amount = Math.min(
        atoms(this.balance),
        ones(this.validator.remainder)
      )
    },

Now this function works for single validator, In our case we have multiple validator

What do you think the logic of the setmax() button should be ?

Should I set maximum amount left in delegator's account ?

vikramIde commented 4 years ago

@daywednes @gizemcakil PR added kindly review

https://github.com/harmony-one/staking-dashboard/pull/404

fragmnt commented 4 years ago

Is there work here already done? Or may I submit my solution as well?

gizemcakil commented 4 years ago

We will review all submissions together and then decide on the winners. Please submit your work as well!

gizemcakil commented 4 years ago

hey @fragmnt we started reviewing the submissions. Will you make a submission for this bounty?

fragmnt commented 4 years ago

hey @fragmnt we started reviewing the submissions. Will you make a submission for this bounty?

hi @gizemcakil, i won’t be submitting for this bounty. the submissions already awesome enough and similar to what i was going to implement 😁 best of luck everyone !!

p.s. i worked on the alert mechanism bounty instead 👍

vikramIde commented 4 years ago

@gizemcakil would be great if you could please get the PR reviewed this week.

Regards