-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { ConfigFileHelper } from "../file-helper.ts/config-file.helper"; | ||
import { getDeployer } from "../utils/deployer-helper"; | ||
import { IMoneyMarket__factory } from "../../typechain"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const configFileHelper = new ConfigFileHelper(); | ||
const config = configFileHelper.getConfig(); | ||
|
||
/* | ||
░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ | ||
░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ | ||
░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ | ||
░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ | ||
░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ | ||
░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ | ||
Check all variables below before execute the deployment script | ||
*/ | ||
|
||
const INPUTS = [ | ||
{ | ||
account: "0xD0dfE9277B1DB02187557eAeD7e25F74eF2DE8f3", | ||
token: "", | ||
model: "", | ||
}, | ||
]; | ||
|
||
const deployer = await getDeployer(); | ||
let nonce = await deployer.getTransactionCount(); | ||
|
||
for (const input of INPUTS) { | ||
console.log(`>>> 🔧 Setting Interest Model ${input.model} for: ${input.token}`); | ||
const moneyMarket = IMoneyMarket__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); | ||
const tx = await moneyMarket.setNonCollatInterestModel(input.account, input.token, input.model, { nonce: nonce++ }); | ||
await tx.wait(); | ||
console.log(`> 🟢 Done | Tx hash: ${tx.hash}\n`); | ||
} | ||
|
||
console.log("\n✅ All Done"); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["SetNonCollatInterestModel"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ethers } from "hardhat"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { getDeployer } from "../../utils/deployer-helper"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const SLOPE_MODEL = "MMFlatSlopeModel3"; | ||
|
||
const deployer = await getDeployer(); | ||
const InterestModel = await ethers.getContractFactory(SLOPE_MODEL, deployer); | ||
|
||
console.log(`Deploying Interest Model Contract`); | ||
const model = await InterestModel.deploy(); | ||
await model.deployed(); | ||
console.log(`Deployed at: ${model.address}`); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["FlatSlopeModelDeploy"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters