rhlsthrm / hardhat-typechain

TypeChain tasks for Buidler
MIT License
18 stars 13 forks source link

Usage in the README is outdated #1

Closed PaulRBerg closed 4 years ago

PaulRBerg commented 4 years ago

Hey! Thanks for creating this plugin. I tried to follow the instructions in the README:

const provider = ethers.provider;
let [wallet] = getWallets(provider);

But these don't work anymore as of @nomiclabs/buidler@1.3.3 and ethereum-waffle@2.5.0:

Capture d’écran 2020-05-20 à 15 24 43

Related: https://github.com/EthWorks/Waffle/issues/270

PaulRBerg commented 4 years ago

I think I figured it out, as per @pcowgill's work on chicago-ethereum/quadratic-funding:

https://github.com/chicago-ethereum/quadratic-funding/blob/master/contract-project/test/cemToken.ts

One ought to now use the waffle's provider and pull the wallets from there, not ethers:

import { deployContract } from "ethereum-waffle";
import { waffle } from "@nomiclabs/buidler";

...

const provider = waffle.provider;
let [wallet] = provider.getWallets();
let greeter = (await deployContract(alice, GreeterArtifact)) as Greeter;
rhlsthrm commented 4 years ago

Thanks for the input! Everything is updated now.