Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit ee3feb3

Browse files
Merge branch 'development' of https://github.com/ionicprotocol/contracts into feat/liquidate-borrow-permissioning
2 parents fbea08a + 31600e4 commit ee3feb3

File tree

61 files changed

+9642
-8184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+9642
-8184
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ contracts.iml
1414
node_modules/
1515
ionic-contracts.iml
1616
cache_hardhat
17-
transactions.json
17+
transactions.json
18+
*transactions.json

chains/base/params.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ const specificParams: ChainParams = {
1313
img: "https://icons.llamao.fi/icons/chains/rsz_base.jpg",
1414
blockExplorerUrls: { default: { name: "basescan", url: "https://basescan.org/" } },
1515
rpcUrls: {
16-
default: { http: ["https://mainnet.base.org"] },
16+
default: {
17+
http: [
18+
"https://mainnet.base.org",
19+
"https://base.llamarpc.com",
20+
"https://base-rpc.publicnode.com",
21+
"https://gateway.tenderly.co/public/base",
22+
"https://base.meowrpc.com",
23+
"https://base-mainnet.public.blastapi.io"
24+
]
25+
},
1726
public: { http: ["https://mainnet.base.org"] }
1827
},
1928
nativeCurrency: {

chains/bob/assets.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const assets: SupportedAsset[] = [
1919
oracle: OracleTypes.FixedNativePriceOracle,
2020
initialSupplyCap: parseEther(String(3_000)).toString(),
2121
initialBorrowCap: parseEther("0.01").toString(),
22-
initialCf: "85"
22+
initialCf: "0.85"
2323
},
2424
{
2525
symbol: assetSymbols.WBTC,
@@ -33,7 +33,7 @@ export const assets: SupportedAsset[] = [
3333
} as ChainlinkSpecificParams,
3434
initialSupplyCap: parseUnits(String(100), 8).toString(),
3535
initialBorrowCap: parseUnits("0.00001", 8).toString(),
36-
initialCf: "85"
36+
initialCf: "0.85"
3737
},
3838
{
3939
symbol: assetSymbols.USDT,
@@ -47,7 +47,7 @@ export const assets: SupportedAsset[] = [
4747
} as ChainlinkSpecificParams,
4848
initialSupplyCap: parseUnits(String(10_000_000), 6).toString(),
4949
initialBorrowCap: parseUnits(String(30), 6).toString(),
50-
initialCf: "85"
50+
initialCf: "0.85"
5151
},
5252
{
5353
symbol: assetSymbols.tBTC,
@@ -61,7 +61,7 @@ export const assets: SupportedAsset[] = [
6161
} as ChainlinkSpecificParams,
6262
initialSupplyCap: parseUnits(String(100), 18).toString(),
6363
initialBorrowCap: parseUnits("0.00001", 18).toString(),
64-
initialCf: "85"
64+
initialCf: "0.85"
6565
},
6666
{
6767
symbol: assetSymbols.USDC,
@@ -75,7 +75,7 @@ export const assets: SupportedAsset[] = [
7575
} as ChainlinkSpecificParams,
7676
initialSupplyCap: parseUnits(String(10_000_000), 6).toString(),
7777
initialBorrowCap: parseUnits(String(30), 6).toString(),
78-
initialCf: "85"
78+
initialCf: "0.85"
7979
},
8080
{
8181
symbol: assetSymbols.SOV,
@@ -89,7 +89,7 @@ export const assets: SupportedAsset[] = [
8989
} as ChainlinkSpecificParams,
9090
initialSupplyCap: parseUnits(String(20_000_000), 18).toString(),
9191
initialBorrowCap: parseUnits(String(69), 18).toString(),
92-
initialCf: "45"
92+
initialCf: "0.45"
9393
}
9494
];
9595

chains/mode/leveragePairs.ts

+88-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,92 @@
1+
import { Address } from "viem";
12
import { LeveragePoolConfig } from "../types";
23

3-
const leveragePairs: LeveragePoolConfig[] = [];
4+
const leveragePairs: LeveragePoolConfig[] = [
5+
{
6+
pool: "Main" as Address,
7+
pairs: [
8+
// ezETH
9+
{
10+
collateral: "0x59e710215d45F584f44c0FEe83DA6d43D762D857",
11+
borrow: "0x2BE717340023C9e14C1Bb12cb3ecBcfd3c3fB038"
12+
}, // usdc
13+
{
14+
collateral: "0x59e710215d45F584f44c0FEe83DA6d43D762D857",
15+
borrow: "0x94812F2eEa03A49869f95e1b5868C6f3206ee3D3"
16+
}, // usdt
17+
{
18+
collateral: "0x59e710215d45F584f44c0FEe83DA6d43D762D857",
19+
borrow: "0xd70254C3baD29504789714A7c69d60Ec1127375C"
20+
}, // wbtc
21+
{
22+
collateral: "0x59e710215d45F584f44c0FEe83DA6d43D762D857",
23+
borrow: "0x19f245782b1258cf3e11eda25784a378cc18c108"
24+
}, // mbtc
25+
{
26+
collateral: "0x59e710215d45F584f44c0FEe83DA6d43D762D857",
27+
borrow: "0x71ef7EDa2Be775E5A7aa8afD02C45F059833e9d2"
28+
}, // weth
29+
30+
// wrsETH
31+
{
32+
collateral: "0x49950319aBE7CE5c3A6C90698381b45989C99b46",
33+
borrow: "0x2BE717340023C9e14C1Bb12cb3ecBcfd3c3fB038"
34+
}, // usdc
35+
{
36+
collateral: "0x49950319aBE7CE5c3A6C90698381b45989C99b46",
37+
borrow: "0x94812F2eEa03A49869f95e1b5868C6f3206ee3D3"
38+
}, // usdt
39+
{
40+
collateral: "0x49950319aBE7CE5c3A6C90698381b45989C99b46",
41+
borrow: "0xd70254C3baD29504789714A7c69d60Ec1127375C"
42+
}, // wbtc
43+
{
44+
collateral: "0x49950319aBE7CE5c3A6C90698381b45989C99b46",
45+
borrow: "0x19f245782b1258cf3e11eda25784a378cc18c108"
46+
}, // mbtc
47+
{
48+
collateral: "0x49950319aBE7CE5c3A6C90698381b45989C99b46",
49+
borrow: "0x71ef7EDa2Be775E5A7aa8afD02C45F059833e9d2"
50+
}, // weth
51+
52+
// weETH.mode
53+
{
54+
collateral: "0xA0D844742B4abbbc43d8931a6Edb00C56325aA18",
55+
borrow: "0x2BE717340023C9e14C1Bb12cb3ecBcfd3c3fB038"
56+
}, // usdc
57+
{
58+
collateral: "0xA0D844742B4abbbc43d8931a6Edb00C56325aA18",
59+
borrow: "0x94812F2eEa03A49869f95e1b5868C6f3206ee3D3"
60+
}, // usdt
61+
{
62+
collateral: "0xA0D844742B4abbbc43d8931a6Edb00C56325aA18",
63+
borrow: "0xd70254C3baD29504789714A7c69d60Ec1127375C"
64+
}, // wbtc
65+
{
66+
collateral: "0xA0D844742B4abbbc43d8931a6Edb00C56325aA18",
67+
borrow: "0x19f245782b1258cf3e11eda25784a378cc18c108"
68+
}, // mbtc
69+
{
70+
collateral: "0xA0D844742B4abbbc43d8931a6Edb00C56325aA18",
71+
borrow: "0x71ef7EDa2Be775E5A7aa8afD02C45F059833e9d2"
72+
}, // weth
73+
74+
// mbtc
75+
{
76+
collateral: "0x19f245782b1258cf3e11eda25784a378cc18c108",
77+
borrow: "0x2BE717340023C9e14C1Bb12cb3ecBcfd3c3fB038"
78+
}, // usdc
79+
{
80+
collateral: "0x19f245782b1258cf3e11eda25784a378cc18c108",
81+
borrow: "0x94812F2eEa03A49869f95e1b5868C6f3206ee3D3"
82+
}, // usdt
83+
{
84+
collateral: "0x19f245782b1258cf3e11eda25784a378cc18c108",
85+
borrow: "0xd70254C3baD29504789714A7c69d60Ec1127375C"
86+
}, // wbtc
87+
{ collateral: "0x19f245782b1258cf3e11eda25784a378cc18c108", borrow: "0x71ef7EDa2Be775E5A7aa8afD02C45F059833e9d2" } // mbtc
88+
]
89+
}
90+
];
491

592
export default leveragePairs;

chains/mode/params.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const specificParams: ChainParams = {
1212
img: "https://1430441113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOUA87dDndFyiETJjxpf%2Ficon%2FzSRXk7tkG8rWFi6tG9wV%2FIYXD4bdy_400x400.jpg?alt=media",
1313
blockExplorerUrls: { default: { name: "modeexplorer", url: "https://explorer.mode.network" } },
1414
rpcUrls: {
15-
default: { http: ["https://mainnet.mode.network/"] },
15+
default: { http: ["https://mainnet.mode.network/", "https://1rpc.io/mode", "https://mode.drpc.org"] },
1616
public: { http: ["https://mainnet.mode.network/"] }
1717
},
1818
nativeCurrency: {

contracts/ionic/strategies/IonicERC4626.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ abstract contract IonicERC4626 is SafeOwnableUpgradeable, PausableUpgradeable, E
3131

3232
/* ========== INITIALIZER ========== */
3333

34-
function __MidasER4626_init(ERC20Upgradeable asset_) internal onlyInitializing {
34+
function __IonicER4626_init(ERC20Upgradeable asset_) internal onlyInitializing {
3535
__SafeOwnable_init(msg.sender);
3636
__Pausable_init();
3737
__Context_init();
3838
__ERC20_init(
39-
string(abi.encodePacked("Midas ", asset_.name(), " Vault")),
39+
string(abi.encodePacked("Ionic ", asset_.name(), " Vault")),
4040
string(abi.encodePacked("mv", asset_.symbol()))
4141
);
4242
__ERC4626_init(asset_);

contracts/ionic/strategies/MockERC4626Dynamic.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ERC20 } from "solmate/tokens/ERC20.sol";
55

66
import { ERC4626 } from "solmate/mixins/ERC4626.sol";
77
import { FixedPointMathLib } from "solmate/utils/FixedPointMathLib.sol";
8-
import { FlywheelCore } from "flywheel-v2/FlywheelCore.sol";
8+
import { IonicFlywheelCore } from "./flywheel/IonicFlywheelCore.sol";
99

1010
/**
1111
* @title Mock ERC4626 Contract
@@ -17,7 +17,7 @@ contract MockERC4626Dynamic is ERC4626 {
1717
using FixedPointMathLib for uint256;
1818

1919
/* ========== STATE VARIABLES ========== */
20-
FlywheelCore public immutable flywheel;
20+
IonicFlywheelCore public immutable flywheel;
2121

2222
/* ========== INITIALIZER ========== */
2323

@@ -26,7 +26,7 @@ contract MockERC4626Dynamic is ERC4626 {
2626
@param _asset The ERC20 compliant token the Vault should accept.
2727
@param _flywheel Flywheel to pull in rewardsToken
2828
*/
29-
constructor(ERC20 _asset, FlywheelCore _flywheel)
29+
constructor(ERC20 _asset, IonicFlywheelCore _flywheel)
3030
ERC4626(
3131
_asset,
3232
string(abi.encodePacked("Midas ", _asset.name(), " Vault")),

0 commit comments

Comments
 (0)