Buidler plugin for using ethers.js
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
src
test
.env
.gitignore
.travis.yml
LICENSE
README.md
package.json
tsconfig.json
tslint.json
yarn.lock

README.md

npm Build Status

buidler-ethers

Buidler plugin for integration with ethers.js.

What

This plugin brings to Buidler the Ethereum library ethers.js, which allows you to interact with the Ethereum blockchain in a simple way.

Installation

npm install @nomiclabs/buidler-ethers ethers@^4.0.23

And add the following require to the top of your buidler.config.js:

require("@nomiclabs/buidler-ethers")

Tasks

This plugin creates no additional tasks.

Environment extensions

An initialized ethers object is injected into the environment:

ethers: {
  provider: JsonRpcProvider;
  getContract: (name: string) => Promise<ContractFactory>;
  signers: () => Promise<Signer[]>;
};

The ContractFactory in getContract is connected by default to the signer 0 in env.ethers.signers.

Usage

There are no additional steps you need to take for this plugin to work. Install it and access ethers through the environment anywhere you need it (tasks, scripts, tests, etc).