snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
11 stars 10 forks source link

feat: use real storage value to compute VP for ozVotesStorageProof #308

Closed Sekhmet closed 3 months ago

Sekhmet commented 3 months ago

Summary

Previously we just called getVotes on the contract, but if strategy was misconfigured (wrong slot index was specified) this wouldn't get caught.

With this change current voting power is computed from storage directly.

As a note, this uses 224 trace instead of 208 from OZ, as this is the what contracts support: https://github.com/snapshot-labs/sx-starknet/blob/fe3c99f0e8e6210bfc1c2e423f9f0feb97a3a450/starknet/src/voting_strategies/oz_votes_storage_proof.cairo#L131-L134

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

How to test

  1. VP gets computed on proposals list (as long as correct storage is used by OZ token).