@nomiclabs/buidler > Environment

Class: Environment

Hierarchy

Environment

Implements

Index

Constructors

Properties

Methods


Constructors

constructor

new Environment(config: ResolvedBuidlerConfig, buidlerArguments: BuidlerArguments, tasks: TasksMap, extenders?: EnvironmentExtender[]): Environment

Defined in internal/core/runtime-environment.ts:38

Initializes the Buidler Runtime Environment and the given extender functions.

remarks: The extenders' execution order is given by the order of the requires in the buidler's config file and its plugins.

Parameters:

Name Type Default value Description
config ResolvedBuidlerConfig - The buidler's config object.
buidlerArguments BuidlerArguments - The parsed buidler's arguments.
tasks TasksMap - A map of tasks.
Default value extenders EnvironmentExtender[] [] A list of extenders.

Returns: Environment


Properties

buidlerArguments

● buidlerArguments: BuidlerArguments

Implementation of BuidlerRuntimeEnvironment.buidlerArguments

Defined in internal/core/runtime-environment.ts:54

The parsed buidler's arguments.


config

● config: ResolvedBuidlerConfig

Implementation of BuidlerRuntimeEnvironment.config

Defined in internal/core/runtime-environment.ts:53

The buidler's config object.


ethereum

● ethereum: EthereumProvider

Implementation of BuidlerRuntimeEnvironment.ethereum

Defined in internal/core/runtime-environment.ts:34

An EIP1193 Ethereum provider.


network

● network: Network

Implementation of BuidlerRuntimeEnvironment.network

Defined in internal/core/runtime-environment.ts:36


tasks

● tasks: TasksMap

Implementation of BuidlerRuntimeEnvironment.tasks

Defined in internal/core/runtime-environment.ts:55

A map of tasks.


Methods

injectToGlobal

injectToGlobal(blacklist?: string[]): function

Defined in internal/core/runtime-environment.ts:125

Injects the properties of this (the Buidler Runtime Environment) into the global scope.

Parameters:

Name Type Default value Description
Default value blacklist string[] Environment._BLACKLISTED_PROPERTIES a list of property names that won't be injected.

Returns: function a function that restores the previous environment.


run

run(name: string, taskArguments?: any): Promise<any>

Defined in internal/core/runtime-environment.ts:104

Executes the task with the given name.

Parameters:

Name Type Default value Description
name string - The task's name.
Default value taskArguments any {} A map of task's arguments.

Returns: Promise<any> a promise with the task's execution result.