Skip to content

Commit

Permalink
Update deploy scripts, silence warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Soghoian committed Dec 12, 2022
1 parent 9ee2c62 commit 684de77
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
21 changes: 19 additions & 2 deletions scripts/deploy-permissionless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,26 @@ async function main() {
await tx.wait();
console.log(`PoolController set as implementation for its factory`);

// Deploy VaultFactory
const VaultFactory = await ethers.getContractFactory("VaultFactory");
const vaultFactory = await VaultFactory.deploy(serviceConfiguration.address);
await vaultFactory.deployed();
console.log(`VaultFactory deployed to ${vaultFactory.address}`);
const Vault = await ethers.getContractFactory("Vault");
const vault = await Vault.deploy();
await vault.deployed();
console.log(`Vault deployed to ${vault.address}`);
tx = await vaultFactory.connect(deployer).setImplementation(vault.address);
await tx.wait();
console.log(`Vault set as implementation for its factory`);

// Deploy PoolFactory
const PoolFactory = await ethers.getContractFactory("PoolFactory", {});
const poolFactory = await PoolFactory.deploy(
serviceConfiguration.address,
withdrawControllerFactory.address,
poolControllerFactory.address
poolControllerFactory.address,
vaultFactory.address
);
await poolFactory.deployed();
console.log(`PoolFactory deployed to ${poolFactory.address}`);
Expand All @@ -142,7 +156,10 @@ async function main() {

// Deploy LoanFactory
const LoanFactory = await ethers.getContractFactory("LoanFactory");
const loanFactory = await LoanFactory.deploy(serviceConfiguration.address);
const loanFactory = await LoanFactory.deploy(
serviceConfiguration.address,
vaultFactory.address
);
await loanFactory.deployed();
console.log(`LoanFactory deployed to ${loanFactory.address}`);

Expand Down
19 changes: 18 additions & 1 deletion scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ async function main() {
await tx.wait();
console.log(`PoolController set as implementation for its factory`);

// Deploy VaultFactory
const VaultFactory = await ethers.getContractFactory("VaultFactory");
const vaultFactory = await VaultFactory.deploy(serviceConfiguration.address);
await vaultFactory.deployed();
console.log(`VaultFactory deployed to ${vaultFactory.address}`);
const Vault = await ethers.getContractFactory("Vault");
const vault = await Vault.deploy();
await vault.deployed();
console.log(`Vault deployed to ${vault.address}`);
tx = await vaultFactory.connect(deployer).setImplementation(vault.address);
await tx.wait();
console.log(`Vault set as implementation for its factory`);

// Deploy PoolFactory
const PoolFactory = await ethers.getContractFactory(
"PermissionedPoolFactory",
Expand All @@ -201,6 +214,7 @@ async function main() {
serviceConfiguration.address,
withdrawControllerFactory.address,
poolControllerFactory.address,
vaultFactory.address,
poolAccessControlFactory.address
);
await poolFactory.deployed();
Expand All @@ -219,7 +233,10 @@ async function main() {

// Deploy LoanFactory
const LoanFactory = await ethers.getContractFactory("PermissionLoanFactory");
const loanFactory = await LoanFactory.deploy(serviceConfiguration.address);
const loanFactory = await LoanFactory.deploy(
serviceConfiguration.address,
vaultFactory.address
);
await loanFactory.deployed();
console.log(`LoanFactory deployed to ${loanFactory.address}`);

Expand Down
6 changes: 2 additions & 4 deletions test/permissioned/PermissionedLoan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ describe("PermissionedLoan", () => {
pool,
tosAcceptanceRegistry,
serviceConfiguration,
poolController,
vaultFactory
poolController
} = await deployPermissionedPool({
poolAdmin: poolAdmin,
settings: DEFAULT_POOL_SETTINGS,
Expand All @@ -46,8 +45,7 @@ describe("PermissionedLoan", () => {
pool.address,
borrower.address,
liquidityAsset.address,
serviceConfiguration,
vaultFactory
serviceConfiguration
);

// Mint ERC20 for lender
Expand Down

0 comments on commit 684de77

Please sign in to comment.