Comments (3)
I just looked through sourcegraph and I'm not seeing a ton of usage of this function in solidity contracts. Mostly it's just used in tests. Here's an example that looks for a false hasVoted
to determine if an account can vote or not. Returning false when partial votes have been cast would sort of break this, i.e. the user could still vote again with partial weight. But in context this is fine, since projects like this one vote with full weight anyway.
I still need to look for usage in JS/frontend code
from flexible-voting.
Alright, here's a sourcegraph query for frontend usage. Some notes:
- nearly a third of all matches (56 of 157) are in tests
- no really big/popular Web3 projects are using this (there are some popular-ish web2 projects, but the
hasVoted
they are using isn't the governance function we care about) - the biggest web3 project that seems to use it is Unlock, but even they only use it in a one-off utility script which could be easily updated
So it really feels like we can kind of do what we want here. There's not much usage of this function either in existing contracts or in existing frontends.
Additionally, the approach we are currently taking (returning true if any amount of votes have been cast by the user on the proposal) should be backwards compatible with most uses of hasVoted
, since presumably those contexts would also be using the nominal castVote
function, which votes with full weight. If your protocol always votes with full weight, then a hasVoted
implementation that returns true when any weight is cast will still behave the way you expect.
from flexible-voting.
We should create a getter function to expose the currently private _proposalVotersWeightCast[proposalId][user]
mapping. This way users who do care about partial votes can identify when a partial voter has used all of his/her weight
from flexible-voting.
Related Issues (20)
- Add Invariant Testing HOT 2
- Investigate fuzzing in fork tests
- Decide on structure for Flex Voting aToken
- Review licenses
- Revisit GovernorCountingFractional's COUTING_MODE
- Allow ATokenFlexVoting holders to delegate voting power
- Prepare for audit
- Get CometFlexVoting under the size limit HOT 1
- Make FlexVotingClient governor mutable
- Followup work on CometFlexVoting
- Partial voting signature replay issue with castVoteWithReasonAndParamsBySig + GovernorCountingFractional
- perf: verify then mark assembly blocks as memory safe
- fix: update ERC-165
- Extract Voting Clients Into Separate Repo
- Update FlexVotingClient so its interface is (more) aligned with the Governor
- Add Tests For FlexVotingClient
- Create a release for the last 4.x version of the OpenZeppelin contracts
- Create a release compatible with OpenZeppelin 5.x
- Ship an NPM package for Flexible Voting contracts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexible-voting.