Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [brownie]

Brownie is a Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.

Filter by
Sorted by
Tagged with
3 votes
3 answers
2k views

Brownie cannot locate deploy.py script

I have python installed on my system (Windows) with Anaconda from a prior course I had taken which may be the root cause of the issue. I'm at the stage where I need to run a deploy.py script to deploy ...
NickS's user avatar
  • 33
9 votes
5 answers
5k views

eth-brownie: Unable to expand environment variable in host setting

When running a script: brownie run scripts/deploy.py --network kovan I receive this error: raise ValueError(f"Unable to expand environment variable in host setting: ‘{uri}’”) ValueError: Unable ...
Patrick Collins's user avatar
9 votes
2 answers
6k views

Which Ethereum framework to choose Truffle vs Brownie?

I know that the most used framework for smart contract that is used for testing, deployment etc is Truffle. But, since I am not very good at javascript (i am mainly coding in python)- I saw there is ...
Dennis's user avatar
  • 91
6 votes
1 answer
2k views

How to deploy Ethereum Smart Contract through Brownie to the Private Network

I have a geth node that is connected to a private network on my computer that uses port: 8545. Hence, I have a smart contract that is tested using Brownie on the ganache-cli network. Brownie is a ...
alper's user avatar
  • 8,395
4 votes
4 answers
2k views

Brownie Chainlink Import Error VSCode - 'File import callback not supported'

The code seems to have successfully compiled, but VSCode keeps showing this error - "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found. File import callback not ...
Parteek Singh Jamwal's user avatar
1 vote
2 answers
1k views

How to compile Smart Contracts using Brownie on RASPBERRY PI 4B?

I have set up Raspberry Pi with npm, nodejs, ganache-cli, eth-brownie (by downloading straight from github), and VS code. I was able to do brownie command - it worked. I was able to do brownie init - ...
EMIL LOBACHEV's user avatar
1 vote
1 answer
660 views

ETH-Brownie How can I import from github when the version number includes letters and numbers?

Normally you can import npm style via a brownie-config.yaml file like so: dependencies: - uniswap/[email protected] compiler: solc: remappings: - 'uniswap=uniswap/[email protected]....
Pickinanameainteasy's user avatar
0 votes
1 answer
242 views

Brownie not reading Account Private key from cinfiguration file

I am using brownie to deploy the mart contract. But the brownie configuration file details is not accessing in deployment.py brownie-config.yaml project_structure: build: build contracts: ...
imhans4305's user avatar
8 votes
2 answers
5k views

How to get the return value of a transaction instead of the transaction receipt in brownie

I have a function in my smart contract called getRandomNumer, and it returns a bytes32. However, in brownie, when I make a transaction it returns the transaction receipt. How do I get the return value?...
Patrick Collins's user avatar
4 votes
2 answers
2k views

How to use contracts from project dependencies in Brownie scripts?

I want to deploy a contract directly accessible in OpenZeppelin/[email protected] Brownie package without changes, namely ERC1967Proxy and other non-abstract contracts from Brownie console. ...
Utgarda's user avatar
  • 791
3 votes
1 answer
1k views

Brownie cannot install solc on OSX

Follow the procedures on this page brownie : create new project and compile with brownie. Encounter the following error, please comment how to fix it. Configuration and environment. Python 3.7.7 ...
madeinQuant's user avatar
3 votes
1 answer
261 views

What is the purpose of a `// dev:` comment after a revert or require statement?

What does it mean when a Solidity contract includes a comment starting with // dev: after a revert or require statement? For example: contract Example { function greet(){ revert(); // ...
iamdefinitelyahuman's user avatar
3 votes
2 answers
1k views

Brownie / Rinkeby ValueError: Gas estimation failed: "you must set the gas limit manually"

from brownie import AdvancedCollectible, accounts, config, network from scripts.helpful_scripts import get_breed import time static_seed = 123 def main(): dev = accounts.add(config["wallets&...
Zakariae Bekri's user avatar
3 votes
5 answers
2k views

File outside of allowed directories on brownie compile command

trying to import to files from openzeppelin and chainlink in my contract file like so: import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@chainlink/contracts/src/v0.6/...
Mert Yurt's user avatar
3 votes
7 answers
3k views

LINK1120 error when attempting to install Brownie with 'pipx install eth-brownie'

I'm having some issues with my installation process for Brownie and wanted to reach out for some help. After getting pipx installed, my attempt to use 'pipx install eth-brownie' in the terminal of VSS ...
user79431's user avatar
2 votes
3 answers
3k views

Issue with importing Chainlink & Openzeppelin

Currently trying to run a script and keep running into an error when trying to import chainlink and openzeppelin contracts. Not sure why, I looked at brownie pm list to make sure I have the correct ...
rizonpoint's user avatar
2 votes
2 answers
1k views

Brownie - Constructor Sequence has incorrect length, expected 1 but got 0

I am trying to deploy a contract on Rinkeby by running brownie run scripts/deploy.py --network rinkeby but I get following error: Constructor Sequence has incorrect length, expected 1 but got 0 I ...
Magofoco's user avatar
  • 250
2 votes
1 answer
699 views

How to test internal members of solidity library or contract in brownie?

Say I have the following SimpleMath solidity library defined as follows: library SimpleMath { function add(uint a, uint b) internal pure returns(uint) { return a + b; } } How do I import ...
MShakeG's user avatar
  • 1,693
2 votes
1 answer
2k views

ImportError: cannot import name 'Accounts' from 'brownie.network.account'

Setup MacOS Catalina v10.15.6 IntelliJ Ultimate v2020.1.1 Python v3.7 eth-brownie v1.14.6 Ganache CLI v6.12.2 I created a VENV using my Python 3.7. Following Patricks tutorial, I have installed eth-...
pookie's user avatar
  • 121
1 vote
1 answer
2k views

ModuleNotFoundError: No module named 'brownie._cli'

After installing python3, ganache-cli, upgrading pip to pipx and installing eth-brownie.. I am receiving errors when trying to use "brownie". I followed all of the steps in their docs ...
Nico Chikuji's user avatar
1 vote
2 answers
149 views

gas now strategy doesn't work

When I'm using GasNowStrategy("fast") in my contract deployment I get an error: from brownie.network.gas.strategies import GasNowStrategy def main(): dev = accounts.add(config["...
OmerS's user avatar
  • 13
1 vote
2 answers
4k views

ParserError: while parsing a block mapping

This is the code in my brownie.config.yaml file: # exclude SafeMath when calculating test coverage # https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths reports: ...
rizonpoint's user avatar
1 vote
2 answers
2k views

Getting `No Python at ...` error trying to install Brownie with pipx on Windows

When I try and pipx install eth-brownie I get the following error: PS C:\Users\karee\web3_py_simple_storage> pipx install eth-brownie No Python at 'C:\Users\karee\AppData\Local\Programs\Python\...
ColburnCrypto's user avatar
1 vote
1 answer
938 views

SolcInstallationError: Downloaded binary would not execute, or returned unexpected output

I am attempting to do the 'brownie compile' but each time it processes I am provided with 'SolcInstallation Error' - Downloaded Library would not execute or returned unexpected output. I have gone ...
Niko's user avatar
  • 11
1 vote
0 answers
258 views

Working with Brownie scripts using Flask

My projects is built like this: React frontend -> Flask server to interact, save to SQL etc.. -> Brownie project. Now when trying to use a script from brownie in my flask file: from ...
grisVladko's user avatar
1 vote
6 answers
1k views

Infura network support for sepollia in Brownie

I have been trying to get testnet LINK for Goerli from chain.link. But it looks like it is no longer providing that for Goerli but Sepolia only. I am using the latest version of Brownie and it only ...
EmilyJ's user avatar
  • 147
1 vote
1 answer
338 views

How to calculate AAVE yield on chain

I’m working on a project which involves tracking and withdrawing AAVE yield on chain while maintaining the original deposit balance. I’m confused as to how to accurately calculate AAVE yield at a ...
xde's user avatar
  • 13
0 votes
1 answer
482 views

Brownie unable to compile contracts on Apple M1 Mac

I recently got an M1 mac and I'm trying to compile my brownie project's contracts which compiled fine on my previous machine. I've installed Brownie v1.18.2 and when attempting to run brownie compile ...
MShakeG's user avatar
  • 1,693
0 votes
1 answer
114 views

What version of web3py does ApeWorX support and does it also support account impersonation (unlock account) without needing the private key?

What is the most recent web3py version that ApeWorX supports? I need to have support for unlocking random eth accounts on a local test network (ex: http localhost 8545) through something like hardhat (...
josjunior's user avatar
0 votes
1 answer
44 views

Listening to events using EventWatcher

I am trying to listen to events emitted from a contract using eth-brownie. More specifically I am attempting to use EventWatcher. My contract emit has an event eventI in it. My run.py file looks like, ...
wayne 's user avatar