-
Notifications
You must be signed in to change notification settings - Fork 0
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
Audit 2/scope #41
Open
jordaniza
wants to merge
19
commits into
develop
Choose a base branch
from
audit-2/scope
base: develop
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.
Open
Audit 2/scope #41
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a0a13b3
Add ERC721 metadata
xavikh ee6e24c
Add BaseURISet event
xavikh b03321b
Check baseTokenURI
xavikh e9a8d16
Test supportsInterface
xavikh 2e9db89
Allow resets outside voting period
xavikh 997c9e7
Fix comment
xavikh 61cbba8
Cleanup comment
xavikh 7cf3d68
feat: migration functionality
jordaniza 585d9b8
update curve coeff and storage gap
jordaniza dd017da
Fix inheritance order
xavikh b095eb0
Reduce Lock gap
xavikh f5cbe5b
Merge pull request #40 from aragon/feat/migration
jordaniza dbdda9f
Merge pull request #39 from aragon/feature/rd-985-enable-withdrawals-…
jordaniza e8ab43d
Merge pull request #38 from aragon/feature/rd-984-add-metadata-to-the…
jordaniza a2993e5
readme
jordaniza 82e722b
added tests and moved some files to ifaces
jordaniza c8a02f9
Merge pull request #42 from aragon/feat/migration
jordaniza 8693c46
Add some tests to resetVotes
xavikh 0d22c32
Merge branch 'feature/rd-985-enable-withdrawals-outside-of-voting-per…
xavikh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Notes for the auditors for the second audit | ||
|
||
The changes in the second audit are a relatively small set of contract changes. Overall there are 2 things we are looking to address: | ||
|
||
1. Faciliate the migration from old to new staking contract, to reset the state. | ||
|
||
For DAOs wishing to start new governance 'seasons', there is a requirement for voting power to be reset. The changes to the Voting Escrow contract are intended to reflect this: | ||
|
||
- A new set of contracts will be deployed | ||
- Direct migration will be enabled between the old and new contracts | ||
- Existing stakers should be able to migrate in a single transaction, skipping the exit queue mechanics | ||
- Existing stakers can migrate even if the destination staking contract is locked for new stakers, this gives existing stakers a window to migrate and gain voting power ahead of new entrants. | ||
|
||
2. Add small improvements, these are detailed in the following contracts | ||
|
||
- a: lock, add NFT metadata URI | ||
- b: voting contract: permit resets outside of voting windows so users can unstake more easily | ||
- c: move from a quadratic -> linear voting curve |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX License Identifier: AGPL-3.0 or later | ||
|
||
pragma solidity ^0.8.17; | ||
|
||
interface IMigrateableFrom { | ||
function migrator() external view returns (address); | ||
function enableMigration(address _migrator) external; | ||
function migrateFrom(uint256 _tokenId) external returns (uint256 newTokenId); | ||
} | ||
|
||
interface IMigrateableTo { | ||
function migrateTo(uint256 _value, address _for) external returns (uint256 newTokenId); | ||
} | ||
|
||
interface IMigrateableEventsAndErrors { | ||
/// @notice Emitted when the migrator is added, activating the migration | ||
event MigrationEnabled(address migrator); | ||
|
||
/// @notice Emitted when the user migrates to the new destination contract | ||
/// @param owner The owner of the veNFT at the time of the migration | ||
/// @param oldTokenId TokenId burned in the old staking contract | ||
/// @param newTokenId TokenId minted in the new staking contract | ||
/// @param amount The locked amount migrated between contracts | ||
event Migrated( | ||
address indexed owner, | ||
uint256 indexed oldTokenId, | ||
uint256 indexed newTokenId, | ||
uint256 amount | ||
); | ||
error MigrationAlreadySet(); | ||
error MigrationNotActive(); | ||
} | ||
|
||
interface IMigrateable is IMigrateableFrom, IMigrateableTo, IMigrateableEventsAndErrors {} |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we prevent deposits, how should we handle existing withdrawals