Gelato-automations/test/helpers/setups/Contracts-For-Full-Refinancing-Maker-To-Maker.helper.js

45 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-10-30 17:35:11 +00:00
const hre = require("hardhat");
const {ethers} = hre;
const getContracts = require("./Common-Contracts.helper");
async function getAllContracts() {
2020-11-02 10:51:49 +00:00
let connectGelatoData;
let debtBridgeFromMakerForFullRefinance;
2020-10-30 17:35:11 +00:00
let dsaProviderModule;
let contracts = await getContracts();
2020-11-02 10:51:49 +00:00
const ConnectGelatoData = await ethers.getContractFactory(
"ConnectGelatoData"
2020-10-30 17:35:11 +00:00
);
2020-11-02 10:51:49 +00:00
connectGelatoData = await ConnectGelatoData.deploy(
2020-10-30 17:35:11 +00:00
(await contracts.instaConnectors.connectorLength()).add(1)
);
2020-11-02 10:51:49 +00:00
await connectGelatoData.deployed();
2020-10-30 17:35:11 +00:00
2020-11-02 10:51:49 +00:00
const DebtBridgeFromMakerForFullRefinance = await ethers.getContractFactory(
2020-10-30 17:35:11 +00:00
"DebtBridgeFromMakerForFullRefinance"
);
2020-11-02 10:51:49 +00:00
debtBridgeFromMakerForFullRefinance = await DebtBridgeFromMakerForFullRefinance.deploy(
2020-10-30 17:35:11 +00:00
contracts.connectGelatoProviderPayment.address
);
2020-11-02 10:51:49 +00:00
await debtBridgeFromMakerForFullRefinance.deployed();
2020-10-30 17:35:11 +00:00
2020-11-02 14:52:03 +00:00
const ProviderModuleDsa = await ethers.getContractFactory(
2020-11-02 10:51:49 +00:00
"ProviderModuleDsaFromMakerToMaker"
2020-10-30 17:35:11 +00:00
);
2020-11-02 14:52:03 +00:00
dsaProviderModule = await ProviderModuleDsa.deploy(
2020-10-30 17:35:11 +00:00
hre.network.config.GelatoCore,
contracts.connectGelatoProviderPayment.address
);
await dsaProviderModule.deployed();
2020-11-02 10:51:49 +00:00
contracts.connectGelatoData = connectGelatoData;
contracts.debtBridgeFromMakerForFullRefinance = debtBridgeFromMakerForFullRefinance;
2020-10-30 17:35:11 +00:00
contracts.dsaProviderModule = dsaProviderModule;
return contracts;
}
module.exports = getAllContracts;