Browse Source

refactor: use Greeter type instead of Contract type in script

build: delete stale dep @ethersproject/contracts
Paul Razvan Berg 4 years ago
parent
commit
38ab62dca2
3 changed files with 3 additions and 6 deletions
  1. 0 1
      package.json
  2. 2 3
      scripts/deploy.ts
  3. 1 2
      yarn.lock

+ 0 - 1
package.json

@@ -14,7 +14,6 @@
     "@ethersproject/abstract-signer": "^5.4.0",
     "@ethersproject/bignumber": "^5.4.0",
     "@ethersproject/bytes": "^5.4.0",
-    "@ethersproject/contracts": "^5.4.0",
     "@ethersproject/providers": "^5.4.0",
     "@nomiclabs/hardhat-ethers": "^2.0.2",
     "@nomiclabs/hardhat-waffle": "^2.0.1",

+ 2 - 3
scripts/deploy.ts

@@ -1,14 +1,13 @@
-import { Contract } from "@ethersproject/contracts";
 // We require the Hardhat Runtime Environment explicitly here. This is optional but useful for running the
 // script in a standalone fashion through `node <script>`. When running the script with `hardhat run <script>`,
 // you'll find the Hardhat Runtime Environment's members available in the global scope.
 import { ethers } from "hardhat";
 
-import { Greeter__factory } from "../typechain";
+import { Greeter, Greeter__factory } from "../typechain";
 
 async function main(): Promise<void> {
   const Greeter: Greeter__factory = await ethers.getContractFactory("Greeter");
-  const greeter: Contract = await Greeter.deploy("Hello, Buidler!");
+  const greeter: Greeter = await Greeter.deploy("Hello, Hardhat!");
   await greeter.deployed();
 
   console.log("Greeter deployed to: ", greeter.address);

+ 1 - 2
yarn.lock

@@ -621,7 +621,7 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@ethersproject/contracts@npm:5.4.0, @ethersproject/contracts@npm:^5.4.0":
+"@ethersproject/contracts@npm:5.4.0":
   version: 5.4.0
   resolution: "@ethersproject/contracts@npm:5.4.0"
   dependencies:
@@ -1053,7 +1053,6 @@ __metadata:
     "@ethersproject/abstract-signer": ^5.4.0
     "@ethersproject/bignumber": ^5.4.0
     "@ethersproject/bytes": ^5.4.0
-    "@ethersproject/contracts": ^5.4.0
     "@ethersproject/providers": ^5.4.0
     "@nomiclabs/hardhat-ethers": ^2.0.2
     "@nomiclabs/hardhat-waffle": ^2.0.1