Skip to content

Commit

Permalink
Remediate scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Jun 20, 2023
1 parent 529d51b commit ab23430
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion scripts/example/SnapshotGate/deploy-snapshot-gate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function deploySnapshotGateExample(snapshotGateArgs, maxPriorityFeePerGas)
// Deploy the SnapshotGate
const SnapshotGate = await getContractFactory("SnapshotGate");
const snapshotGate = await SnapshotGate.deploy(...snapshotGateArgs, await getFees(maxPriorityFeePerGas));
await snapshotGate.deployTransaction.wait(confirmations);
await snapshotGate.waitForDeployment(confirmations);

return [snapshotGate];
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/util/cast-protocol-client-proxies.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hre = require("hardhat");
const ethers = hre.ethers;
const { getContractAt } = hre.ethers;

/**
* Cast the Protocol Client Proxy contracts to their implementation interfaces
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/deploy-mock-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ async function deployAndMintMockNFTAuthTokens() {
//Deploy a mock NFT to represent the Lens Protocol profile NFT
let lensTokenContractFactory = await getContractFactory("MockNFTAuth721");
const lensTokenContract = await lensTokenContractFactory.deploy();
await lensTokenContract.deployTransaction.wait(confirmations);
await lensTokenContract.waitForDeployment(confirmations);
console.log(`✅ Mock Lens NFT Token deployed to: ${await lensTokenContract.getAddress()}`);

//Deploy a mock NFT to represent the ENS NFT
let ensTokenContractFactory = await getContractFactory("MockNFTAuth721");
const ensTokenContract = await ensTokenContractFactory.deploy();
await ensTokenContract.deployTransaction.wait(confirmations);
await ensTokenContract.waitForDeployment(confirmations);
console.log(`✅ Mock ENS NFT Token deployed to: ${await ensTokenContract.getAddress()}`);

if (network == "test" || network == "localhost") {
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/deploy-protocol-client-beacons.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hre = require("hardhat");
const ethers = hre.ethers;
const { getContractFactory } = hre.ethers;
const environments = require("../../environments");
const confirmations = hre.network.name === "hardhat" ? 1 : environments.confirmations;
const { getFees } = require("./utils");
Expand Down Expand Up @@ -34,7 +34,7 @@ async function deployProtocolClientBeacons(protocolClients, protocolClientArgs,
await bosonVoucherImpl.getAddress(),
await getFees(maxPriorityFeePerGas)
);
await clientBeacon.deployTransaction.wait(confirmations);
await clientBeacon.waitForDeployment(confirmations);

return [clientBeacon];
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/deploy-protocol-client-impls.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hre = require("hardhat");
const ethers = hre.ethers;
const { getContractFactory } = hre.ethers;
const environments = require("../../environments");
const confirmations = hre.network.name === "hardhat" ? 1 : environments.confirmations;
const { getFees } = require("./utils");
Expand All @@ -23,7 +23,7 @@ async function deployProtocolClientImpls(implementationArgs, maxPriorityFeePerGa
// Deploy the BosonVoucher contract
const BosonVoucher = await getContractFactory("BosonVoucher");
const bosonVoucher = await BosonVoucher.deploy(...implementationArgs, await getFees(maxPriorityFeePerGas));
await bosonVoucher.deployTransaction.wait(confirmations);
await bosonVoucher.waitForDeployment(confirmations);

return [bosonVoucher];
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/deploy-protocol-client-proxies.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hre = require("hardhat");
const ethers = hre.ethers;
const { getContractFactory } = hre.ethers;
const environments = require("../../environments");
const confirmations = hre.network.name === "hardhat" ? 1 : environments.confirmations;
const { getFees } = require("./utils");
Expand Down Expand Up @@ -31,7 +31,7 @@ async function deployProtocolClientProxies(protocolClients, maxPriorityFeePerGas
// Deploy the ClientProxy for BosonVoucher
const ClientProxy = await getContractFactory("BeaconClientProxy");
const clientProxy = await ClientProxy.deploy(await getFees(maxPriorityFeePerGas));
await clientProxy.deployTransaction.wait(confirmations);
await clientProxy.waitForDeployment(confirmations);

// init instead of constructors
let transactionResponse = await clientProxy.initialize(
Expand Down
2 changes: 1 addition & 1 deletion scripts/util/deploy-protocol-handler-facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployProtocolFacets(facetNames, facetsToInit, maxPriorityFeePerG
let FacetContractFactory = await getContractFactory(facetName);
const constructorArgs = (facetsToInit[facetName] && facetsToInit[facetName].constructorArgs) || [];
const facetContract = await FacetContractFactory.deploy(...constructorArgs, await getFees(maxPriorityFeePerGas));
await facetContract.deployTransaction.wait(confirmations);
await facetContract.waitForDeployment(confirmations);

const deployedFacet = {
name: facetName,
Expand Down
10 changes: 5 additions & 5 deletions test/protocol/ProtocolInitializationHandlerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("ProtocolInitializationHandler", async function () {
await getFees(maxPriorityFeePerGas)
);

await protocolInitializationFacetDeployed.deployTransaction.wait();
await protocolInitializationFacetDeployed.waitForDeployment();
});

it("Addresses and calldata length mismatch", async function () {
Expand Down Expand Up @@ -161,7 +161,7 @@ describe("ProtocolInitializationHandler", async function () {
// Mock a new facet to add to diamond so we can call initialize again
let FacetTestFactory = await getContractFactory("Test3Facet");
const testFacet = await FacetTestFactory.deploy(await getFees(maxPriorityFeePerGas));
await testFacet.deployTransaction.wait();
await testFacet.waitForDeployment();

const calldataTestFacet = testFacet.interface.encodeFunctionData("initialize", [await rando.getAddress()]);

Expand Down Expand Up @@ -296,7 +296,7 @@ describe("ProtocolInitializationHandler", async function () {
it("Should call facet initializer internally when _addresses and _calldata are supplied", async function () {
let FacetTestFactory = await getContractFactory("Test3Facet");
const testFacet = await FacetTestFactory.deploy(await getFees(maxPriorityFeePerGas));
await testFacet.deployTransaction.wait();
await testFacet.waitForDeployment();

const calldataTestFacet = testFacet.interface.encodeFunctionData("initialize", [await rando.getAddress()]);

Expand Down Expand Up @@ -332,7 +332,7 @@ describe("ProtocolInitializationHandler", async function () {
beforeEach(async function () {
let FacetTestFactory = await getContractFactory("Test3Facet");
testFacet = await FacetTestFactory.deploy(await getFees(maxPriorityFeePerGas));
await testFacet.deployTransaction.wait();
await testFacet.waitForDeployment();

version = formatBytes32String("2.3.0");
});
Expand Down Expand Up @@ -408,7 +408,7 @@ describe("ProtocolInitializationHandler", async function () {
await getFees(maxPriorityFeePerGas)
);

await mockInitializationFacetDeployed.deployTransaction.wait();
await mockInitializationFacetDeployed.waitForDeployment();

const facetNames = [
"SellerHandlerFacet",
Expand Down

0 comments on commit ab23430

Please sign in to comment.