Skip to content

Commit c186823

Browse files
Krishang NadgaudaKrishang Nadgauda
Krishang Nadgauda
authored and
Krishang Nadgauda
committed
update deploy scripts for drop contracts
1 parent c6f27f9 commit c186823

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

scripts/deploy/dropERC20.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
import hre, { ethers } from "hardhat";
22

3-
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
4-
5-
import { DropERC20, TWFactory } from "typechain";
3+
import { DropERC20 } from "typechain";
64

75
async function main() {
8-
const [caller]: SignerWithAddress[] = await ethers.getSigners();
9-
10-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
116

12-
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
13-
14-
const hasFactoryRole = await twFactory.hasRole(
15-
ethers.utils.solidityKeccak256(["string"], ["FACTORY_ROLE"]),
16-
caller.address,
17-
);
18-
if (!hasFactoryRole) {
19-
throw new Error("Caller does not have FACTORY_ROLE on factory");
20-
}
217
const dropERC20: DropERC20 = await ethers.getContractFactory("DropERC20").then(f => f.deploy());
228

239
console.log(
@@ -29,12 +15,6 @@ async function main() {
2915

3016
console.log("\n");
3117

32-
const addImplementationTx = await twFactory.addImplementation(dropERC20.address);
33-
console.log("Adding DropERC20 implementation to TWFactory: ", addImplementationTx.hash);
34-
await addImplementationTx.wait();
35-
36-
console.log("\n");
37-
3818
console.log("Verifying contract.");
3919
await verify(dropERC20.address, []);
4020
}

scripts/deploy/dropERC721.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
import hre, { ethers } from "hardhat";
22

3-
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
4-
5-
import { TWFactory, DropERC721 } from "typechain";
3+
import { DropERC721 } from "typechain";
64

75
async function main() {
8-
const [caller]: SignerWithAddress[] = await ethers.getSigners();
9-
10-
const twFactoryAddress: string = ethers.constants.AddressZero; // replace
116

12-
const twFactory: TWFactory = await ethers.getContractAt("TWFactory", twFactoryAddress);
13-
14-
const hasFactoryRole = await twFactory.hasRole(
15-
ethers.utils.solidityKeccak256(["string"], ["FACTORY_ROLE"]),
16-
caller.address,
17-
);
18-
if (!hasFactoryRole) {
19-
throw new Error("Caller does not have FACTORY_ROLE on factory");
20-
}
217
const dropERC721: DropERC721 = await ethers.getContractFactory("DropERC721").then(f => f.deploy());
228

239
console.log(
@@ -31,12 +17,6 @@ async function main() {
3117

3218
console.log("\n");
3319

34-
const addImplementationTx = await twFactory.addImplementation(dropERC721.address);
35-
console.log("Adding DropERC721 implementation to TWFactory: ", addImplementationTx.hash);
36-
await addImplementationTx.wait();
37-
38-
console.log("\n");
39-
4020
console.log("Verifying contract.");
4121
await verify(dropERC721.address, []);
4222
}

0 commit comments

Comments
 (0)