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

Commit 846503f

Browse files
committed
Merge branch 'development' into feat/liquidate-borrow-permissioning
2 parents 2b07696 + 7969359 commit 846503f

File tree

8 files changed

+38
-16
lines changed

8 files changed

+38
-16
lines changed

chains/bob/assets.ts

Lines changed: 6 additions & 6 deletions
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

hardhat.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ const config: HardhatUserConfig = {
5454
optimism: {
5555
url: "https://mainnet.optimism.io",
5656
accounts: [process.env.DEPLOYER!]
57+
},
58+
bob: {
59+
url: "https://rpc.gobob.xyz",
60+
accounts: [process.env.DEPLOYER!]
5761
}
5862
}
5963
};

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@
3535
"ts-node": "^10.9.2",
3636
"typescript": "^5.5.3",
3737
"viem": "^2.17.3"
38+
},
39+
"overrides": {
40+
"typescript": "^5.5.3"
3841
}
3942
}

tasks/admin/revenue.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,11 @@ task("revenue:flywheels:calculate", "Calculate the fees accrued from 4626 Perfor
201201
}
202202
);
203203

204-
task("revenue:all:calculate", "Calculate the fees accrued from 4626 Performance Fees").setAction(
205-
async (taskArgs, hre) => {
206-
const pluginFees = await hre.run("revenue:4626:calculate");
207-
const adminFees = await hre.run("revenue:admin:calculate");
208-
const flywheelFees = await hre.run("revenue:flywheels:calculate");
209-
console.log(`Total Fees: ${formatEther(pluginFees + adminFees + flywheelFees)}`);
210-
}
211-
);
204+
task("revenue:all:calculate", "Calculate the fees accrued from 4626 Performance Fees").setAction(async (_, hre) => {
205+
const adminFees = await hre.run("revenue:admin:calculate");
206+
const flywheelFees = await hre.run("revenue:flywheels:calculate");
207+
console.log(`Total Fees: ${formatEther(adminFees + flywheelFees)}`);
208+
});
212209

213210
task("revenue:admin:withdraw", "Calculate the fees accrued from admin fees")
214211
.addParam("signer", "The address of the current deployer", "deployer", types.string)

tasks/chain-setup/bob.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { task } from "hardhat/config";
2+
import { assets as bobAssets } from "../../chains/bob/assets";
3+
4+
task("market:set-cf:bob:main", "Sets caps on a market").setAction(async (_, { viem, run }) => {
5+
const COMPTROLLER = "0x9cFEe81970AA10CC593B83fB96eAA9880a6DF715";
6+
for (const asset of bobAssets) {
7+
const pool = await viem.getContractAt("IonicComptroller", COMPTROLLER);
8+
const cToken = await pool.read.cTokensByUnderlying([asset.underlying]);
9+
console.log("cToken: ", cToken, asset.symbol);
10+
11+
await run("market:set:ltv", {
12+
marketAddress: cToken,
13+
ltv: asset.initialCf
14+
});
15+
}
16+
});

tasks/chain-setup/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "./bob";

tasks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ import "./leverage/configurePair";
66
import "./plugin";
77
import "./pool";
88
import "./market";
9+
import "./chain-setup";

tasks/market/admin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ task("market:set:ltv", "Set the LTV (loan to value / collateral factor) of a mar
1717
.addParam("ltv", "The LTV as a floating point value between 0 and 1", undefined, types.string)
1818
.setAction(async ({ marketAddress, ltv }, { viem }) => {
1919
const publicClient = await viem.getPublicClient();
20-
const market = await viem.getContractAt("CTokenInterfaces.sol:ICErc20", marketAddress);
20+
const market = await viem.getContractAt("ICErc20", marketAddress);
2121
const poolAddress = await market.read.comptroller();
22-
const pool = await viem.getContractAt("Comptroller.sol:Comptroller", poolAddress as Address);
22+
const pool = await viem.getContractAt("IonicComptroller", poolAddress as Address);
2323

2424
const ltvMantissa = parseUnits(ltv, 18);
2525
console.log(`will set the LTV of market ${marketAddress} to ${ltvMantissa}`);

0 commit comments

Comments
 (0)