Skip to content
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

Edge case for the first proposal #16

Open
0xpessimist opened this issue Jan 31, 2025 · 0 comments
Open

Edge case for the first proposal #16

0xpessimist opened this issue Jan 31, 2025 · 0 comments

Comments

@0xpessimist
Copy link

0xpessimist commented Jan 31, 2025

Summary

There is an edge case for the 0th (first) proposal for users who may want to fork and use AaveGovernanceV2.

When a project forks (deploys) and starts using AaveGovernanceV2, its first proposalId will be 0. The issue is that before any proposal is actually proposed, anyone can cancel the 0th proposal because it passes all necessary validating checks.

The following check prevents this situation for every proposal except the first proposal (0 = 0 so it passes but _proposalsCount = 0 means no proposal has been created yet):

require(_proposalsCount >= proposalId, 'INVALID_PROPOSAL_ID');

As a result, even if the 0th proposal is proposed later, it will remain marked as canceled.

Impact

This issue has no impact, and if it occurs, it can be completely bypassed by proposing an empty first proposal. At most, some projects might not notice it until they attempt to execute the proposal, which could lead to wasted time. It can also confuse developers by making them think they initialized governance incorrectly.

Recommendation

There are several ways to fix this, the most obvious being to disallow cancel() if _proposalsCount == 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant