How to use the @nomiclabs/buidler.artifacts function in @nomiclabs/buidler

To help you get started, we’ve selected a few @nomiclabs/buidler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nomiclabs / buidler / packages / buidler-core / sample-project / scripts / sample-script.js View on Github external
async function main() {
  // You can run Buidler tasks from a script.
  // For example, we make sure everything is compiled by running "compile"
  await env.run("compile");

  // We require the artifacts once our contracts are compiled
  const Greeter = env.artifacts.require("Greeter");
  const greeter = await Greeter.new("Hello, world!");

  console.log("Greeter address:", greeter.address);
}