-
Notifications
You must be signed in to change notification settings - Fork 10
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
CompoundGovernor Upgrade #20
Draft
wildmolasses
wants to merge
39
commits into
compound-finance:main
Choose a base branch
from
ScopeLift:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Configured foundry/hardhat compatibility * Add empty placeholder governor and test contract to verify forge install is working * Added foundry.toml defaults for testing and formatting (original contracts not formatted) * Add forge install to test.yml * Updated hardhat plugin to latest to resolve coverage issue * Switched proposer address in fork tests to one with some voting power * prettier fix .. need for this triggered by previous commit ts file change
* forge install: openzeppelin-contracts-upgradeable v5.0.2 * Create initial basic governor * Line break fix * Inheritance order fix * Inheritdoc updates * Fix eslint issue in lib directory * Switch to using GovernorTimelockCompoundUpgradeable * Fixed _executor function
* Added test framework with minimal deploy script * forge fmt constant cleanup * Added TODO about constants
* Added GovernorSettableFixedQuorumUpgradeable * Changed foundry.toml optimizer_runs to 200 to shrink code size * Now using 'upperLookupRecent' for checkpointed quorum values * Use 'clock()' instead of 'block.timestamp' when setting checkpointed quorum * Also use clock() for setQuorum emit * Consistent use of uint256 for quorum publicly, uint208 internally * Removed superflous cast * Fixed test to use clock for quorum checkpoint * Apply suggestions from code review Notice and addition of "virtual" to functions where it was missing. Co-authored-by: Ed Mazurek <[email protected]> --------- Co-authored-by: Ed Mazurek <[email protected]>
* Removed previous OZ contracts library of 5.0.2 * forge install: openzeppelin-contracts-upgradeable v5.1.0-rc.0 * Update governor to use GovernorCountingFractional from OZ 5.1 (which requires EVM version 'cancun')
) * Added SetQuorum test via proposal test helper and refactored test files * Remove unneeded casts * Removed double-negative assert in test * License changed for IComp.sol * Changed ContructedProposal to Proposal * Opened up range of values for setQuorum tests * Added test testFuzz_RevertIf_CalledByNonTimelock * Refactored tests * Prevent proxy admin from invoking setQuorum in test
* Add whitelist accounts and whitelist guardian * Add `proposalGuardian` * Update natspec, function visibility, and test * Assume caller is not proxy admin in tests * Use `_checkGovernance` * Use `@notice` in natspec * Rename test and assume any caller * Assume _caller is not PROXY_ADMIN_ADDRESS * Move `PROPOSAL_GUARDIAN_EXPIRY` into test helper
* Accept `proxyAdmin` as constructor arg in deploy script * Make timelock `proxyAdminOwner` and rename vars * Remove proxyAdminOwner as an arg
* Add cancel logic and tests * Use `_getProposalId` instead of `hashProposal` to prep for upcoming change * Rename and cleanup test * Use helpers to set whitelist accounts and remove voting weight * Clean up test * Update natspec * docstring nit --------- Co-authored-by: Ed Mazurek <[email protected]>
* WIP - GovernorSequentialProposalIdUpgradeable.sol * Got tests working * Used only slightly modified GovernorUpgradeable from oz lib * Updated extension comment headers * Format change for hashProposal function * Additional format change
* WIP - GovernorBravo to CompoundGovernor upgrade script and tests * Delete commented-out code * Added tests for proper proposal operations after successful or failed upgrades * Changed failure test name to include _RevertIf_ * Refactored upgrade/proposal tests * Added TODO for upgrade proposal description * Changed BravoToCompoundUpgradeBeforeDeployTest to PreUpgradeTest * Move needed constants to central place in CompoundGovernorConstants * Moved token assignment to common location in test setup * New test helper orchestration Co-authored-by: Gary Ghayrat <[email protected]> * Rebase fixes Co-authored-by: Gary Ghayrat <[email protected]> * Changed to updated proxy admin address --------- Co-authored-by: wildmolasses <[email protected]> Co-authored-by: Gary Ghayrat <[email protected]>
* consolidate test files * remove owner, add some natspec * lint the js
* forge install: openzeppelin-contracts-upgradeable v5.1.0 * Updated extensions to match OZ 5.1
* Add upgrade proposal description * Remove TODO comment * Update script/ProposeUpgradeBravoToCompoundGovernor.s.sol --------- Co-authored-by: Ed Mazurek <[email protected]>
* Add natspec * Update contracts/extensions/GovernorSequentialProposalIdUpgradeable.sol --------- Co-authored-by: Ed Mazurek <[email protected]>
* Add some `propose` and `queue` tests * Add `execute` tests and refactor `cancel` tests * Apply suggestions from code review --------- Co-authored-by: Ed Mazurek <[email protected]>
* Added a lot of proposal related tests * Shortened invalid proposal ID tests * Added more invalid proposal ID tests * Switched to _getRandomProposer and unname parameter for proposal fuzz tests * Changed names of zeroReturnIf test functions * Fix typos * Enhanced proposal threshold test * Slight change to test names * Remove underscores from test names --------- Co-authored-by: garyghayrat <[email protected]>
* Fix inconsisten OZ version comment in IGovernor * Restore oz formatting --------- Co-authored-by: garyghayrat <[email protected]>
* Changed _quorumReached to not include abstentions and added test verification * Addressed code review comments
* Add in missing ERC7201 natspec tag * Addressed review comment * Corrected hash of GovernorSequentialProposalIdStorageLocation
* Fix to initialize next proposal ID to be GovernorBravo proposal count + 1 * Added explanatory comment to setNextProposalId
* Allow whitelisted accounts to propose even if they are below proposalThreshold * Move proposal threshold check logic into governor * Add line break * Add natspec and rename vars * Simplify propose logic * Update `propose` and `setWhitelistAccountExpiration` natspec * Update test names and add test * Update contracts/CompoundGovernor.sol --------- Co-authored-by: Ed Mazurek <[email protected]>
#88) * Revert if proposalGuardian role is expired * Instead of reverting, allow proposalGuaridan to cancel proposals below threshold like anyone else * Simplify cancel logic * Fix expiration check * Add additional tests
* single proposal per proposer * elapsedBlocks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
draft PR preparing for the CompoundGovernor upgrade
see: