Skip to content

Commit a8539a2

Browse files
committed
Add set default LTV task
1 parent aa34306 commit a8539a2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

hardhat.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import {HardhatUserConfig, task} from "hardhat/config";
22
import "@nomicfoundation/hardhat-toolbox";
33
import {networkConfig, Network} from "./network.config";
44
import {TypedDataDomain} from "ethers";
5+
import {
6+
LiquidityPool,
7+
} from "./typechain-types";
58

69
import dotenv from "dotenv";
710

@@ -24,6 +27,20 @@ task("grant-role", "Grant some role on some AccessControl")
2427
console.log(`Role ${role} granted to ${actor} on ${contract}.`);
2528
});
2629

30+
task("set-default-ltv", "Update Liquidity Pool config")
31+
.addOptionalParam("pool", "Liquidity Pool address")
32+
.addOptionalParam("ltv", "New default LTV value")
33+
.setAction(async ({pool, ltv}: {pool?: string, ltv?: string}, hre) => {
34+
const [admin] = await hre.ethers.getSigners();
35+
36+
const targetAddress = pool || "0xB44aEaB4843094Dd086c26dD6ce284c417436Deb";
37+
const target = (await hre.ethers.getContractAt("LiquidityPool", targetAddress, admin)) as LiquidityPool;
38+
39+
const newLtv = ltv || "2000";
40+
await target.setDefaultLTV(newLtv);
41+
console.log(`Default LTV set to ${newLtv} on ${pool}.`);
42+
});
43+
2744
task("sign-borrow", "Sign a Liquidity Pool borrow request for testing purposes")
2845
.addOptionalParam("token", "Token to borrow")
2946
.addOptionalParam("amount", "Amount to borrow in base units")

0 commit comments

Comments
 (0)