-
Notifications
You must be signed in to change notification settings - Fork 3
feat: mRe7ETH on Optimism #199
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
Merged
Merged
Changes from all commits
Commits
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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
contracts/products/mRe7ETH/MRe7EthCustomAggregatorFeed.sol
This file contains hidden or 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,28 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| import "../../feeds/CustomAggregatorV3CompatibleFeed.sol"; | ||
| import "./MRe7EthMidasAccessControlRoles.sol"; | ||
|
|
||
| /** | ||
| * @title MRe7EthCustomAggregatorFeed | ||
| * @notice AggregatorV3 compatible feed for mRe7ETH, | ||
| * where price is submitted manually by feed admins | ||
| * @author RedDuck Software | ||
| */ | ||
| contract MRe7EthCustomAggregatorFeed is | ||
| CustomAggregatorV3CompatibleFeed, | ||
| MRe7EthMidasAccessControlRoles | ||
| { | ||
| /** | ||
| * @dev leaving a storage gap for futures updates | ||
| */ | ||
| uint256[50] private __gap; | ||
|
|
||
| /** | ||
| * @inheritdoc CustomAggregatorV3CompatibleFeed | ||
| */ | ||
| function feedAdminRole() public pure override returns (bytes32) { | ||
| return M_RE7ETH_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE; | ||
| } | ||
| } |
This file contains hidden or 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,24 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| import "../../feeds/DataFeed.sol"; | ||
| import "./MRe7EthMidasAccessControlRoles.sol"; | ||
|
|
||
| /** | ||
| * @title MRe7EthDataFeed | ||
| * @notice DataFeed for mRe7ETH product | ||
| * @author RedDuck Software | ||
| */ | ||
| contract MRe7EthDataFeed is DataFeed, MRe7EthMidasAccessControlRoles { | ||
| /** | ||
| * @dev leaving a storage gap for futures updates | ||
| */ | ||
| uint256[50] private __gap; | ||
|
|
||
| /** | ||
| * @inheritdoc DataFeed | ||
| */ | ||
| function feedAdminRole() public pure override returns (bytes32) { | ||
| return M_RE7ETH_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE; | ||
| } | ||
| } |
This file contains hidden or 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,24 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| import "../../DepositVault.sol"; | ||
| import "./MRe7EthMidasAccessControlRoles.sol"; | ||
|
|
||
| /** | ||
| * @title MRe7EthDepositVault | ||
| * @notice Smart contract that handles mRe7ETH minting | ||
| * @author RedDuck Software | ||
| */ | ||
| contract MRe7EthDepositVault is DepositVault, MRe7EthMidasAccessControlRoles { | ||
| /** | ||
| * @dev leaving a storage gap for futures updates | ||
| */ | ||
| uint256[50] private __gap; | ||
|
|
||
| /** | ||
| * @inheritdoc ManageableVault | ||
| */ | ||
| function vaultRole() public pure override returns (bytes32) { | ||
| return M_RE7ETH_DEPOSIT_VAULT_ADMIN_ROLE; | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
contracts/products/mRe7ETH/MRe7EthMidasAccessControlRoles.sol
This file contains hidden or 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,27 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| /** | ||
| * @title MRe7EthMidasAccessControlRoles | ||
| * @notice Base contract that stores all roles descriptors for mRe7ETH contracts | ||
| * @author RedDuck Software | ||
| */ | ||
| abstract contract MRe7EthMidasAccessControlRoles { | ||
| /** | ||
| * @notice actor that can manage MRe7EthDepositVault | ||
| */ | ||
| bytes32 public constant M_RE7ETH_DEPOSIT_VAULT_ADMIN_ROLE = | ||
| keccak256("M_RE7ETH_DEPOSIT_VAULT_ADMIN_ROLE"); | ||
|
|
||
| /** | ||
| * @notice actor that can manage MRe7EthRedemptionVault | ||
| */ | ||
| bytes32 public constant M_RE7ETH_REDEMPTION_VAULT_ADMIN_ROLE = | ||
| keccak256("M_RE7ETH_REDEMPTION_VAULT_ADMIN_ROLE"); | ||
|
|
||
| /** | ||
| * @notice actor that can manage MRe7EthCustomAggregatorFeed and MRe7EthDataFeed | ||
| */ | ||
| bytes32 public constant M_RE7ETH_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE = | ||
| keccak256("M_RE7ETH_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE"); | ||
| } |
27 changes: 27 additions & 0 deletions
27
contracts/products/mRe7ETH/MRe7EthRedemptionVaultWithSwapper.sol
This file contains hidden or 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,27 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| import "../../RedemptionVaultWithSwapper.sol"; | ||
| import "./MRe7EthMidasAccessControlRoles.sol"; | ||
|
|
||
| /** | ||
| * @title MRe7EthRedemptionVaultWithSwapper | ||
| * @notice Smart contract that handles mRe7ETH redemptions | ||
| * @author RedDuck Software | ||
| */ | ||
| contract MRe7EthRedemptionVaultWithSwapper is | ||
| RedemptionVaultWithSwapper, | ||
| MRe7EthMidasAccessControlRoles | ||
| { | ||
| /** | ||
| * @dev leaving a storage gap for futures updates | ||
| */ | ||
| uint256[50] private __gap; | ||
|
|
||
| /** | ||
| * @inheritdoc ManageableVault | ||
| */ | ||
| function vaultRole() public pure override returns (bytes32) { | ||
| return M_RE7ETH_REDEMPTION_VAULT_ADMIN_ROLE; | ||
| } | ||
| } |
This file contains hidden or 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,67 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.9; | ||
|
|
||
| import "../../mToken.sol"; | ||
|
|
||
| /** | ||
| * @title mRe7ETH | ||
| * @author RedDuck Software | ||
| */ | ||
| //solhint-disable contract-name-camelcase | ||
| contract mRe7ETH is mToken { | ||
| /** | ||
| * @notice actor that can mint mRe7ETH | ||
| */ | ||
| bytes32 public constant M_RE7ETH_MINT_OPERATOR_ROLE = | ||
| keccak256("M_RE7ETH_MINT_OPERATOR_ROLE"); | ||
|
|
||
| /** | ||
| * @notice actor that can burn mRe7ETH | ||
| */ | ||
| bytes32 public constant M_RE7ETH_BURN_OPERATOR_ROLE = | ||
| keccak256("M_RE7ETH_BURN_OPERATOR_ROLE"); | ||
|
|
||
| /** | ||
| * @notice actor that can pause mRe7ETH | ||
| */ | ||
| bytes32 public constant M_RE7ETH_PAUSE_OPERATOR_ROLE = | ||
| keccak256("M_RE7ETH_PAUSE_OPERATOR_ROLE"); | ||
|
|
||
| /** | ||
| * @dev leaving a storage gap for futures updates | ||
| */ | ||
| uint256[50] private __gap; | ||
|
|
||
| /** | ||
| * @inheritdoc mToken | ||
| */ | ||
| function _getNameSymbol() | ||
| internal | ||
| pure | ||
| override | ||
| returns (string memory, string memory) | ||
| { | ||
| return ("Midas Re7 Ethereum", "mRe7ETH"); | ||
| } | ||
|
|
||
| /** | ||
| * @dev AC role, owner of which can mint mRe7ETH token | ||
| */ | ||
| function _minterRole() internal pure override returns (bytes32) { | ||
| return M_RE7ETH_MINT_OPERATOR_ROLE; | ||
| } | ||
|
|
||
| /** | ||
| * @dev AC role, owner of which can burn mRe7ETH token | ||
| */ | ||
| function _burnerRole() internal pure override returns (bytes32) { | ||
| return M_RE7ETH_BURN_OPERATOR_ROLE; | ||
| } | ||
|
|
||
| /** | ||
| * @dev AC role, owner of which can pause mRe7ETH token | ||
| */ | ||
| function _pauserRole() internal pure override returns (bytes32) { | ||
| return M_RE7ETH_PAUSE_OPERATOR_ROLE; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
This file is missing a final newline. Please add one to adhere to standard file formatting conventions.