snapshot-labs / sx-starknet

Core smart contracts of Snapshot X for Starknet
https://docs.snapshotx.xyz
MIT License
112 stars 69 forks source link

fix: H-02 Votes Can Be Blocked #593

Closed Orland0x closed 9 months ago

Orland0x commented 9 months ago

Replaces the _commits (commit -> address) mapping with a double mapping (commit, address -> bool).

This allows the same commit to be made by 2 different addresses, which wasn't possible before.

This closes #555 as now its impossible for a user to block another by making a valid commit for their action before they do.

Orland0x commented 9 months ago

utACK, any reason you chose double mapping instead of adding the l1 message sender address?

I had a think about the other approach but not sure its really feasible as it would mean computing the hash on-chain in order to include msg.sender. We use posiodon which isnt really possible to do on L1. Could switch to keccak but then it would be expensive to verify on Starknet