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

Commit c807c3f

Browse files
committed
feat: fraxtal script
1 parent 4d5421c commit c807c3f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tasks/chain-specific/fraxtal/markets.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { task } from "hardhat/config";
22
import { assets } from "../../../../monorepo/packages/chains/src/fraxtal/assets";
33
import { assetSymbols } from "../../../../monorepo/packages/types";
44
import { COMPTROLLER } from ".";
5+
import { zeroAddress } from "viem";
56

67
task("markets:deploy:fraxtal:main", "deploy base market").setAction(async (_, { viem, run }) => {
78
const assetsToDeploy: string[] = [
@@ -39,6 +40,20 @@ task("markets:deploy:fraxtal:main", "deploy base market").setAction(async (_, {
3940
}
4041
});
4142

43+
task("markets:fraxtal:set-cf", "deploy base market").setAction(async (_, { viem, run }) => {
44+
for (const asset of assets) {
45+
const pool = await viem.getContractAt("IonicComptroller", COMPTROLLER);
46+
const cToken = await pool.read.cTokensByUnderlying([asset.underlying]);
47+
console.log("cToken: ", cToken, asset.symbol);
48+
if (cToken !== zeroAddress) {
49+
await run("market:set:ltv", {
50+
marketAddress: cToken,
51+
ltv: asset.initialCf
52+
});
53+
}
54+
}
55+
});
56+
4257
task("markets:fraxtal:set-caps", "Set supply and borrow caps for markets").setAction(async (_, { viem, run }) => {
4358
const asset = assets.find((asset) => asset.symbol === assetSymbols.WETH);
4459
if (!asset) {

0 commit comments

Comments
 (0)