The Configuration File

You can modify Brownie’s default behaviours by creating an optional configuration file.

The configuration file must be saved as brownie-config.yaml. If saved in the root directory of a project it will be loaded whenever that project is active. If saved in your home path, it will always be loaded.

All configuration fields are optional. You can copy from the examples below and modify the settings as required.

Default Configuration

The following example shows all configuration settings and their default values:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
networks:
    default: development
    development:
        gas_limit: 6721975
        gas_price: 0
        reverting_tx_gas_limit: 6721975
        default_contract_owner: true
    live:
        gas_limit: auto
        gas_price: auto
        reverting_tx_gas_limit: false
        default_contract_owner: false

compiler:
    evm_version: null
    solc:
        version: null
        optimizer:
            enabled: true
            runs: 200
        remappings: null

console:
    show_colors: true
    color_style: monokai
    auto_suggest: true
    completions: true

hypothesis:
    deadline: null
    max_examples: 50
    stateful_step_count: 10

autofetch_sources: false
dependencies: null

Settings

Networks

default

The default network that Brownie connects. If a different network is required, you can override this setting with the --network flag in the command line.

default value: development

networks.development
networks.live

Default settings for development and live environments.

gas_price

The default gas price for all transactions. If set to auto the gas price is determined using web3.eth.gasPrice.

development default: 0

live default: auto

gas_limit

The default gas limit for all transactions. If set to auto the gas limit is determined using web3.eth.estimateGas.

development default: 6721975

live default: auto

default_contract_owner

If false, deployed contracts will not remember the account that they were created by. Every transaction will require a from kwarg.

reverting_tx_gas_limit

The gas limit to use when a transaction would revert. If set to false, transactions that would revert will instead raise a VirtualMachineError.

development default: 6721975

live default: false

Compiler

Compiler settings. See compiler settings for more information.

evm_version

The EVM version to compile for. If null the most recent one is used. Possible values are byzantium, constantinople, petersburg, istanbul, atlantis and agharta.

default value: null

compiler.solc

Settings specific to the Solidity compiler.

version

The version of solc to use. Should be given as a string in the format 0.x.x. If set to null, the version is set based on the contract pragma. Brownie supports solc versions >=0.4.22.

default value: null

optimizer

Optimizer settings to be passed to the Solidity compiler. Values given here are passed into the compiler with no reformatting. See the Solidity documentation for a list of possible values.

remappings

Optional field used to supply path remappings.

remappings:
  - zeppelin=/usr/local/lib/open-zeppelin/contracts/
  - github.com/ethereum/dapp-bin/=/usr/local/lib/dapp-bin/

Console

show_colors

Enable or disable colorful output.

default value: true

color_style

Set the Pygments color style used within the console and throughout Brownie.

You can view a gallery of popular styles here.

default value: monokai

auto_suggest

Enable or disable type hints for contract function inputs.

default value: true

completions

Enable or disable autocompletion.

default value: true

Hypothesis

Default settings for property-based and stateful test execution. See the Hypothesis settings documentation for a complete list of available settings.

hypothesis:
    deadline: null
    max_examples: 50
    stateful_step_count: 10

Other Settings

autofetch_sources

If enabled, Brownie will always attempt to fetch source code for unknown addresses using Contract.from_explorer.

default value: false

dependencies

A list of packages that a project depends on. Brownie will attempt to install all listed dependencies prior to compiling the project.

dependencies:
    - aragon/aragonOS@4.0.0
    - defi.snakecharmers.eth/compound@1.1.0

See the Brownie Package Manager to learn more about package dependencies.