snapshot-labs / sx-monorepo

Snapshot X monorepo
https://docs.snapshotx.xyz
MIT License
11 stars 10 forks source link

feat: add erc20votes related workarounds #457

Closed Sekhmet closed 2 days ago

Sekhmet commented 2 days ago

Summary

This PR adds three changes related to handling ERC20Votes strategies

Closes: https://github.com/snapshot-labs/sx-monorepo/issues/413

How to test

  1. Run yarn dev:full.
  2. Create space with erc20votes strategy.
  3. Create proposal, it will start in pending state, VP is shown properly.
  4. Check timeline.
  5. Once proposal becomes active VP is shown properly as well.
  6. You can vote.
bonustrack commented 2 days ago

I created this proposal and it got accepted at ~3:14 on a space with a 10mn voting delay: http://localhost:8080/#/sn-sep:0x003014ce1db98b66a83e6e01cf79d157d0cc49d139612156bc95bc2ff1a01e2e/proposal/3 Does this looks correct to you?

image

Created is ~5mn behind, this is confusing, start is 10mn away from created which makes sense for an user in term of delay but then I don't see the extra 10mn added because using ERC20 Votes strategy. Shouldn't we show instead a created at 3:14 and starting at 3:24?

Sekhmet commented 2 days ago

@bonustrack it adds 10 minutes to block time, not real time when discovered.

This proposal was created in this transaction. Block in which it was included was created at 3:08 so we have to wait til next block (so 3:18). If we use real time references then it will have to wait to 3:24, but this will actually end up being 16 minutes of wait time.

So in current approach proposal is pending for 4 minutes, after that you can vote and see VP. If we added 10m to current time it would end up being pending for whole 10 minutes.