Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,680 changes: 3,879 additions & 801 deletions .openzeppelin/mainnet.json

Large diffs are not rendered by default.

958 changes: 958 additions & 0 deletions .openzeppelin/sepolia.json

Large diffs are not rendered by default.

3,102 changes: 3,102 additions & 0 deletions .openzeppelin/unknown-999.json

Large diffs are not rendered by default.

47 changes: 46 additions & 1 deletion ROLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All the roles for the Midas protocol smart contracts are listed below.
| ***blacklisted*** | `0x548c7f0307ab2a7ea894e5c7e8c5353cc750bb9385ee2e945f189a9a83daa8ed` |
| ***blacklistedOperator*** | `0x2fdc6683bc8d03effec5b41d3834f28bd219e06ca0a6a26fc737e44b1c7889ff` |


## Token Roles

### mTBILL Roles
Expand Down Expand Up @@ -138,6 +139,28 @@ All the roles for the Midas protocol smart contracts are listed below.
| ***depositVaultAdmin*** | `0xc36e0ff97dfe3349dafe1988294b64f3512b08a634f42b52895a3c3559879a23` |
| ***redemptionVaultAdmin*** | `0xe48f52da9588e92d268adb569f098fc35caa5a1913185feefe9c4e62554590bd` |

### mHYPER Roles

| Role Name | Role |
| --- | --- |
| ***minter*** | `0xe6046a6e8c55ddf579e30dbcefd2018a368c8b9d4836e839e4858921fb6305d7` |
| ***burner*** | `0xc01eb6e1b4773016d504457dce3f5e83f90f9aad6448a1cac83788ac51b02b68` |
| ***pauser*** | `0x81b54f25b57244cec3082584e702e3d8145a58ff31a5f48fd4a8768cb875788b` |
| ***customFeedAdmin*** | `0xf579edbdfe71eecb0735bb2656b6d53f5b7ee74072467c73e651c84bd4f94e1b` |
| ***depositVaultAdmin*** | `0x5375b38f2ad9c8c8833b90d06ab20e4199feca9d6a6c8f2369d8f717325f4732` |
| ***redemptionVaultAdmin*** | `0xa6095bf1d1689844730f85ea9c1edf7d9e1566838e1baa0327271b6c8c31dd8a` |

### mAPOLLO Roles

| Role Name | Role |
| --- | --- |
| ***minter*** | `0x59407f5c6daac4079fa24b515198321ffd28cbdf6f85639037afa72b911a29cf` |
| ***burner*** | `0xa200dd77df4b34ae6c19cb3e3dc83d679195101d9cd5cb8bd0ad2def1b96390b` |
| ***pauser*** | `0xe2244752dbb382338a8c397a21467f95453df086aaf28e473476e12eca96891b` |
| ***customFeedAdmin*** | `0xcdd2c3a00a01651579d9e60180508ef1b0735d9ea12d2ccc6a5a17304c3865e0` |
| ***depositVaultAdmin*** | `0x257642c7a907c8e097f048c5aec3671d93280c2ea79e740dbf3db850fbbfe87c` |
| ***redemptionVaultAdmin*** | `0xba606c08c0542611892ee357c770c7db19d0a4746e65e6ed76098fab6f5a1f74` |

### mLIQUIDITY Roles

| Role Name | Role |
Expand Down Expand Up @@ -226,6 +249,28 @@ All the roles for the Midas protocol smart contracts are listed below.
| ***depositVaultAdmin*** | `0x47a846aa32c59e889fc832ab1f36a3ddfdb2811bf9584199312c2e9f9e2e65d2` |
| ***redemptionVaultAdmin*** | `0xa584655a424c1847696a6f0b8baf98ccf0779d1ce1aa17ee76d36d10eb092153` |

### lstHYPE Roles

| Role Name | Role |
| --- | --- |
| ***minter*** | `0xd9d613875b1cf92181a9917c3b79b390efe1794a42a2c8c4d66369e1eac56bc7` |
| ***burner*** | `0xfd43ba2dfbb1539f854cd0323df890e1ad67033654710e83d8525d8d43a18786` |
| ***pauser*** | `0x12235f80c8dd32fe7d29618c4b2e821779346d2e6a7aba195ca4f97b77dabd67` |
| ***customFeedAdmin*** | `0x745baa764d110b42b6dabca1d82c565ed4cbc8cd27bf9f332de5f0ddab2bcb56` |
| ***depositVaultAdmin*** | `0x35f1adb8c633db7cf4cc370ccfb50b8aa56b5e38a8cdf1bf5d3a58f82dc21cc0` |
| ***redemptionVaultAdmin*** | `0x22e39eb53f44668fbc61c98ca3b75d9c269561162df7cd08bf1b4b51ee2d40c6` |

### liquidHYPE Roles

| Role Name | Role |
| --- | --- |
| ***minter*** | `0x5652862ba278bea9c37b31899106e05dde7b59edb9efa32f699274a11a9e5ce0` |
| ***burner*** | `0x3ad6caa208563575bbc20537065b7758606cfc02093977c82f21d01f1cc5f521` |
| ***pauser*** | `0xbfc742108d04824c9a3d911362fa7f2a8b8e60064178e809c134e9698f0f8512` |
| ***customFeedAdmin*** | `0xc8008cecd14e51254a5f110598d40e4f0176f51948f29516417e78147adb3b4f` |
| ***depositVaultAdmin*** | `0x8eb8d75c3e48abb8e2dd66f0c7051267ad19ead14e551bc18d1833986047eba9` |
| ***redemptionVaultAdmin*** | `0x00788a6cc736b61867c5eef2e9b994a921eb9dd76db6909af6b392748456e8e5` |

### TACmBTC Roles

| Role Name | Role |
Expand Down Expand Up @@ -257,4 +302,4 @@ All the roles for the Midas protocol smart contracts are listed below.
| ***pauser*** | `0xe181f7ebeab6043b2aef6e7b855ade1c6478effc8f161002c1a6db314fa00bff` |
| ***customFeedAdmin*** | `-` |
| ***depositVaultAdmin*** | `0x747cb0a703a70d6f4c9a939eb8562c818cbd166a32ee124c8f67d378fb7b3acf` |
| ***redemptionVaultAdmin*** | `0x2b1562306621e9994db493bf6f01d859047d843e24d2e2505ed812afb0c7f338` |
| ***redemptionVaultAdmin*** | `0x2b1562306621e9994db493bf6f01d859047d843e24d2e2505ed812afb0c7f338` |
45 changes: 44 additions & 1 deletion config/constants/addresses.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';

import { chainIds } from '../networks';
import { ConfigPerNetwork, MTokenName } from '../types/index';
import { ConfigPerNetwork, MTokenName } from '../types';

export type RedemptionVaultType =
| 'redemptionVault'
Expand Down Expand Up @@ -225,6 +225,20 @@ export const midasAddressesPerNetwork: ConfigPerNetwork<
depositVault: '0x41438435c20B1C2f1fcA702d387889F346A0C3DE',
redemptionVaultSwapper: '0x44b0440e35c596e858cEA433D0d82F5a985fD19C',
},
mHYPER: {
token: '0x9b5528528656DBC094765E2abB79F293c21191B9',
customFeed: '0x43881B05C3BE68B2d33eb70aDdF9F666C5005f68',
dataFeed: '0x92004DCC5359eD67f287F32d12715A37916deCdE',
depositVault: '0xbA9FD2850965053Ffab368Df8AA7eD2486f11024',
redemptionVaultSwapper: '0x6Be2f55816efd0d91f52720f096006d63c366e98',
},
mAPOLLO: {
token: '0x7CF9DEC92ca9FD46f8d86e7798B72624Bc116C05',
customFeed: '0x84303e5568C7B167fa4fEBc6253CDdfe12b7Ee4B',
dataFeed: '0x9aEBf5d6F9411BAc355021ddFbe9B2c756BDD358',
depositVault: '0xc21511EDd1E6eCdc36e8aD4c82117033e50D5921',
redemptionVaultSwapper: '0x5aeA6D35ED7B3B7aE78694B7da2Ee880756Af5C0',
},
mLIQUIDITY: {
token: '0x841EEb3e2489B2282b0E14202Dc8Bd8F7624e29A',
customFeed: '0x74508886cDFEF22FddEDcA0d9Caf9E00E876C5aF',
Expand Down Expand Up @@ -531,6 +545,21 @@ export const midasAddressesPerNetwork: ConfigPerNetwork<
aggregator: '0x215ADBE371A3664640c67d754466CCeE102e9349',
dataFeed: '0x289584e63A61C69EEE170cD553cff8B3FFD56EA7',
},
wsthype: {
token: '0x94e8396e0869c9F2200760aF0621aFd240E1CF38',
aggregator: '0xe6E8baDBB469d16e2060e1Ebeb60F92B2a1250A9',
dataFeed: '0xD28b1AB7098E7434a7b4eFdC99c35fb85CfD92C1',
},
khype: {
token: '0xfD739d4e423301CE9385c1fb8850539D657C296D',
aggregator: '0xFfe5F5e9e18b88FBdD7e28d4A583a111C874fB47',
dataFeed: '0x5A55899f324bF45DD2dA0b97E145774a4668A9E4',
},
whype: {
token: '0x5555555555555555555555555555555555555555',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The token address for whype appears to be a placeholder value. Using such an address in a production environment would lead to contract failures. Please replace it with the correct address or ensure it's only used in a context where this placeholder is expected and handled (e.g., test environments).

aggregator: '0x7F1f3E3D57E5549828909AE3381C7bFF05A4fE09',
dataFeed: '0xE1C769D56Cb6448813732F7736041425AA0A4A75',
},
},
accessControl: '0x0312A9D1Ff2372DDEdCBB21e4B6389aFc919aC4B',
hbUSDT: {
Expand All @@ -547,6 +576,20 @@ export const midasAddressesPerNetwork: ConfigPerNetwork<
depositVault: '0x48fb106Ef0c0C1a19EdDC9C5d27A945E66DA1C4E',
redemptionVaultSwapper: '0xD26bB9B45140D17eF14FbD4fCa8Cf0d610ac50E7',
},
lstHYPE: {
token: '0x81e064d0eB539de7c3170EDF38C1A42CBd752A76',
customFeed: '0x2b959a9Deb8e62FaaEA1b226F3bbcbcC0Af31560',
dataFeed: '0x7d876E544F12bD3347B9e904F0fb2d83bEd59a27',
depositVault: '0x2b158D44eEbb03a025F75B79F1d8B3004Ac97737',
redemptionVaultSwapper: '0x1eff01e0784ae8d06a17AF29A2300D2A9cdA5440',
},
liquidHYPE: {
token: '0x441794D6a8F9A3739F5D4E98a728937b33489D29',
customFeed: '0x1CeaB703956e24b18a0AF6b272E0bF3F499aCa0F',
dataFeed: '0x70519793f50c95f435972637E1190f41cfc907Bd',
depositVault: '0xF538675D292d8b372712f44eaf306Cc66cF6d8DC',
redemptionVaultSwapper: '0x558806a80b42cAB4ED75c74bfB178EDc9087AA32',
},
},
katana: {
accessControl: '0x980f57b62060824799F23f87d6FA321653b6f069',
Expand Down
7 changes: 7 additions & 0 deletions config/types/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export enum MTokenNameEnum {
mMEV = 'mMEV',
mSL = 'mSL',
mFONE = 'mFONE',
mHYPER = 'mHYPER',
mAPOLLO = 'mAPOLLO',
hbUSDT = 'hbUSDT',
hbXAUt = 'hbXAUt',
TACmBTC = 'TACmBTC',
Expand All @@ -21,6 +23,8 @@ export enum MTokenNameEnum {
tUSDe = 'tUSDe',
tBTC = 'tBTC',
mevBTC = 'mevBTC',
lstHYPE = 'lstHYPE',
liquidHYPE = 'liquidHYPE',
}

export type MTokenName = keyof typeof MTokenNameEnum;
Expand Down Expand Up @@ -58,6 +62,9 @@ export enum PaymentTokenNameEnum {
jitosol = 'jitosol',
usdhl = 'usdhl',
tbtc = 'tbtc',
wsthype = 'wsthype',
khype = 'khype',
whype = 'whype',
}

export type PaymentTokenName = keyof typeof PaymentTokenNameEnum;
28 changes: 28 additions & 0 deletions contracts/liquidHYPE/LiquidHypeCustomAggregatorFeed.sol
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 "./LiquidHypeMidasAccessControlRoles.sol";

/**
* @title LiquidHypeCustomAggregatorFeed
* @notice AggregatorV3 compatible feed for liquidHYPE,
* where price is submitted manually by feed admins
* @author RedDuck Software
*/
contract LiquidHypeCustomAggregatorFeed is
CustomAggregatorV3CompatibleFeed,
LiquidHypeMidasAccessControlRoles
{
/**
* @dev leaving a storage gap for futures updates
*/
uint256[50] private __gap;

/**
* @inheritdoc CustomAggregatorV3CompatibleFeed
*/
function feedAdminRole() public pure override returns (bytes32) {
return LIQUID_HYPE_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE;
}
}
24 changes: 24 additions & 0 deletions contracts/liquidHYPE/LiquidHypeDataFeed.sol
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 "./LiquidHypeMidasAccessControlRoles.sol";

/**
* @title LiquidHypeDataFeed
* @notice DataFeed for liquidHYPE product
* @author RedDuck Software
*/
contract LiquidHypeDataFeed is DataFeed, LiquidHypeMidasAccessControlRoles {
/**
* @dev leaving a storage gap for futures updates
*/
uint256[50] private __gap;

/**
* @inheritdoc DataFeed
*/
function feedAdminRole() public pure override returns (bytes32) {
return LIQUID_HYPE_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE;
}
}
27 changes: 27 additions & 0 deletions contracts/liquidHYPE/LiquidHypeDepositVault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../DepositVault.sol";
import "./LiquidHypeMidasAccessControlRoles.sol";

/**
* @title LiquidHypeDepositVault
* @notice Smart contract that handles liquidHYPE minting
* @author RedDuck Software
*/
contract LiquidHypeDepositVault is
DepositVault,
LiquidHypeMidasAccessControlRoles
{
/**
* @dev leaving a storage gap for futures updates
*/
uint256[50] private __gap;

/**
* @inheritdoc ManageableVault
*/
function vaultRole() public pure override returns (bytes32) {
return LIQUID_HYPE_DEPOSIT_VAULT_ADMIN_ROLE;
}
}
27 changes: 27 additions & 0 deletions contracts/liquidHYPE/LiquidHypeMidasAccessControlRoles.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
* @title LiquidHypeMidasAccessControlRoles
* @notice Base contract that stores all roles descriptors for liquidHYPE contracts
* @author RedDuck Software
*/
abstract contract LiquidHypeMidasAccessControlRoles {
/**
* @notice actor that can manage LiquidHypeDepositVault
*/
bytes32 public constant LIQUID_HYPE_DEPOSIT_VAULT_ADMIN_ROLE =
keccak256("LIQUID_HYPE_DEPOSIT_VAULT_ADMIN_ROLE");

/**
* @notice actor that can manage LiquidHypeRedemptionVault
*/
bytes32 public constant LIQUID_HYPE_REDEMPTION_VAULT_ADMIN_ROLE =
keccak256("LIQUID_HYPE_REDEMPTION_VAULT_ADMIN_ROLE");

/**
* @notice actor that can manage LiquidHypeCustomAggregatorFeed and LiquidHypeDataFeed
*/
bytes32 public constant LIQUID_HYPE_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE =
keccak256("LIQUID_HYPE_CUSTOM_AGGREGATOR_FEED_ADMIN_ROLE");
}
27 changes: 27 additions & 0 deletions contracts/liquidHYPE/LiquidHypeRedemptionVaultWithSwapper.sol
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 "./LiquidHypeMidasAccessControlRoles.sol";

/**
* @title LiquidHypeRedemptionVaultWithSwapper
* @notice Smart contract that handles liquidHYPE redemptions
* @author RedDuck Software
*/
contract LiquidHypeRedemptionVaultWithSwapper is
RedemptionVaultWithSwapper,
LiquidHypeMidasAccessControlRoles
{
/**
* @dev leaving a storage gap for futures updates
*/
uint256[50] private __gap;

/**
* @inheritdoc ManageableVault
*/
function vaultRole() public pure override returns (bytes32) {
return LIQUID_HYPE_REDEMPTION_VAULT_ADMIN_ROLE;
}
}
63 changes: 63 additions & 0 deletions contracts/liquidHYPE/liquidHYPE.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../mTBILL/mTBILL.sol";

/**
* @title liquidHYPE
* @author RedDuck Software
*/
//solhint-disable contract-name-camelcase
contract liquidHYPE is mTBILL {
/**
* @notice actor that can mint liquidHYPE
*/
bytes32 public constant LIQUID_HYPE_MINT_OPERATOR_ROLE =
keccak256("LIQUID_HYPE_MINT_OPERATOR_ROLE");

/**
* @notice actor that can burn liquidHYPE
*/
bytes32 public constant LIQUID_HYPE_BURN_OPERATOR_ROLE =
keccak256("LIQUID_HYPE_BURN_OPERATOR_ROLE");

/**
* @notice actor that can pause liquidHYPE
*/
bytes32 public constant LIQUID_HYPE_PAUSE_OPERATOR_ROLE =
keccak256("LIQUID_HYPE_PAUSE_OPERATOR_ROLE");

/**
* @dev leaving a storage gap for futures updates
*/
uint256[50] private __gap;

/**
* @notice upgradeable pattern contract`s initializer
* @param _accessControl address of MidasAccessControl contract
*/
function initialize(address _accessControl) external override initializer {
__Blacklistable_init(_accessControl);
__ERC20_init("Liquid HYPE Yield", "liquidHYPE");
}

/**
* @dev AC role, owner of which can mint liquidHYPE token
*/
function _minterRole() internal pure override returns (bytes32) {
return LIQUID_HYPE_MINT_OPERATOR_ROLE;
}

/**
* @dev AC role, owner of which can burn liquidHYPE token
*/
function _burnerRole() internal pure override returns (bytes32) {
return LIQUID_HYPE_BURN_OPERATOR_ROLE;
}

/**
* @dev AC role, owner of which can pause liquidHYPE token
*/
function _pauserRole() internal pure override returns (bytes32) {
return LIQUID_HYPE_PAUSE_OPERATOR_ROLE;
}
}
Loading
Loading