-
Notifications
You must be signed in to change notification settings - Fork 12k
Bug: Governor state #2886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
https://github.com/compound-finance/compound-protocol/blob/a6251ecc30adb8dfa904e2231e9a9fdb4eea78be/contracts/Governance/Comp.sol#L190 Without this, there will be errors. |
Hello @zgfzgf In Openzeppelin governor, just like in Compound's governor, when an address casts a vote, the governor asks the (Comp) token what the votes of the address were at a given point in time. This avoids transferring tokens and voting twice. As you saw, this mechanism is part of the token contract, not the governor. Note also that for a user to be able to cast a vote, we must be in the
Consequently, when we query
We are certain that |
I see. but We don't guarantee others proposal.startBlock is in the past. |
see email:[email protected] |
for example: when startBlock=100000
A have 200 COMP
B no COMP
when block.number=10000
OpenZeepelin state is Active (is error)
Compound state is Pending (is OK)
A castVote. and transfer to B. B is also castVote. in block.number=10000
openzeppelin-contracts/contracts/governance/Governor.sol
Lines 111 to 130 in 1b27c13
https://github.com/compound-finance/compound-protocol/blob/a6251ecc30adb8dfa904e2231e9a9fdb4eea78be/contracts/Governance/GovernorAlpha.sol#L226-L246
The text was updated successfully, but these errors were encountered: