kalidao / kali-ui

Here lies the UI for KALI
https://app.kali.gg/
23 stars 23 forks source link

vote via `voteBySig` #248

Closed audsssy closed 1 year ago

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ui ✅ Ready (Inspect) Visit Preview Aug 12, 2022 at 3:05AM (UTC)
audsssy commented 2 years ago

See loom on how things work now.

Idea is to have all vote buttons sign proposals instead of vote on them. And when it's time to processProposal, we then multicall all vote signatures via voteBySig with processProposal so that all members may enjoy gasless voting. All vote signatures live on IPFS instead of testnet. However, because of this, we will need to update voting UI to grab vote progress from IPFS instead of subgraph.

z0r0z commented 2 years ago

excellence @audsssy This will be huge unlock for token voting

Something to make sure of -- we want to multicall() before voting period ends so that votes don't get lost

audsssy commented 2 years ago

Good point. Feels like a 2-step process~

audsssy commented 2 years ago

The flow is there but still got an elusive bug to fix. Almost there~

audsssy commented 2 years ago

I'm getting InvalidSignature() when invoking voteBySig (trying to get this through first before processing via multicall). Signing typed data works as expected and so is retrieving corresponding r, s, v, but perhaps data is not configured properly for signing (?), or something else. Super keen to get this going but I feel like I'm missing something ahhhhhh. Will come back to this with fresh eyes.

audsssy commented 2 years ago

I started testing with a stripped down version of KaliDAO.sol and it confirms that signatures do not match up.

audsssy commented 2 years ago

voteBySig now works!!!

Apparently the issue is that we needed to feed dynamic data to sign typed data with, like below.

Screen Shot 2022-08-09 at 2 19 33 PM

Anyhow, voteBySig now works alone and also in conjunction with multicall, next step is to update front end with appropriate buttons to reflect gasless voting. Woot~

audsssy commented 2 years ago

Might take some time to update front end logic to retrieve vote status for display and toggling of relevant buttons now that we're using signed voting data vs onchain data because we will need to grab voting data from IPFS rather than from subgraph.

nerderlyne commented 2 years ago

Might take some time to update front end logic to retrieve vote status for display and toggling of relevant buttons now that we're using signed voting data vs onchain data because we will need to grab voting data from IPFS rather than from subgraph.

We can use ceramic(just so it's a single file) for storing all the votes before they are processed and then it's business as usual because Vote event will be emitted.

audsssy commented 1 year ago

Closing this out in favor of KaliDAORelayer and a newly developed bot for processing proposals.