-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from aragon/feat/migration
added tests and moved some files to ifaces
- Loading branch information
Showing
7 changed files
with
651 additions
and
122 deletions.
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
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
Oops, something went wrong.