@@ -2,6 +2,9 @@ import {HardhatUserConfig, task} from "hardhat/config";
22import "@nomicfoundation/hardhat-toolbox" ;
33import { networkConfig , Network } from "./network.config" ;
44import { TypedDataDomain } from "ethers" ;
5+ import {
6+ LiquidityPool ,
7+ } from "./typechain-types" ;
58
69import 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+
2744task ( "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