Questions tagged [brownie]
Brownie is a Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
28
questions
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 ...
1
vote
1
answer
874
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\...
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 ...
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 ...
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 ...
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 ...
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 ...
1
vote
1
answer
609
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/v2-core@1.0.1
compiler:
solc:
remappings:
- 'uniswap=uniswap/v2-core@1.0....
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 - ...
0
votes
1
answer
162
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: ...
6
votes
2
answers
4k
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?...
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/openzeppelin-contracts@4.2.0 Brownie package without changes, namely ERC1967Proxy
and other non-abstract contracts from Brownie console.
...
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
...
3
votes
1
answer
246
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(); // ...
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&...
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 ...
2
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/...
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 ...
2
votes
1
answer
541
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 ...
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-...
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 ...
1
vote
1
answer
816
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 ...
1
vote
5
answers
486
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 ...
1
vote
2
answers
2k
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:
...
1
vote
0
answers
227
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 ...
1
vote
2
answers
125
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["...
0
votes
1
answer
22
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 (...
0
votes
0
answers
83
views
Passing an array of string from Brownie Python deployment script to Smart contract
I am using brownie python script to interact with smart contract. In the smart contract there is a function which accepts string array as argument like below
function Multiple(string[] memory my_ids) ...