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

Remove hardcode values related to voting governance #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JohnyVasamsetti
Copy link

Context

The GovernorSettings contract previously used hardcoded values for the following governance parameters:

  • votingDelay: Delay before voting on a proposal starts (default: 1 block).
  • votingPeriod: Duration for which voting remains open (default: 1 week).
  • proposalThreshold: Minimum number of votes required to create a proposal (default: 0).

These values were directly embedded in the Governor contract and were also used in the GovernorTest contract for testing purposes. It's a bit confusion since we introduced the magic numbers. Removing magic numbers might help us to understand it in a better way.

Changes Introduced

This PR refactors the Governor contract to remove hardcoded governance parameter values and instead allows them to be passed as arguments during deployment.

The constructor has been updated to:
constructor( IVotes _token, TimelockController _timelock, uint48 _initialVotingDelay, uint32 _votingPeriod, uint256 _votingThreshold, uint256 _quorumPercentage )

Benifits

  • Deployers can customize governance settings to suit their specific requirements without modifying the contract code.
  • The updated design enables testing with different parameter values, improving the robustness of the contract.

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

Successfully merging this pull request may close these issues.

1 participant