Questions tagged [brownie]

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

197 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
147 views

Brownie empty traceback and revert_msg

I'm trying to create a Yearn strategy following https://github.com/yearn/brownie-strategy-mix. But a transaction is failing, and brownie isn't telling me why: % brownie console Brownie environment is ...
pineda's user avatar
  • 51
3 votes
0 answers
197 views

Does brownie have functionality to analyze gas costs for all function calls?

Does brownie have any sort of functionality that gives a breakdown of the cost to deploy all contracts and execute all function calls within a brownie project with min, max and average gas cost ...
MShakeG's user avatar
  • 573
3 votes
0 answers
680 views

Brownie INFO: Could not find files for the given pattern(s)

I installed Brownie succefully, and also am able to make a init project from it. But every time I run brownie I get INFO: Could not find files for the given pattern(s) I've installed ganache-cli, ...
Jaydeep Dholakia's user avatar
3 votes
2 answers
456 views

How to run Chainlink Project using eth-brownie python

I had installed eth-brownie using command pip install eth-brownie after Brownie installed.I had bake existing Brownie project into a new directory. mkdir MyChainlinkProject cd MyChainlinkProject/ ...
Hassan ALi's user avatar
3 votes
1 answer
157 views

How do I automatically verify my contracts on etherscan using brownie?

I discovered truffle has truffle-plugin-verify that help you verify your contracts on etherscan. I wonder if similar functionality can be done with brownie ?
H4F's user avatar
  • 31
2 votes
0 answers
60 views

Using Brownie to verify contract error

I added sepolia with my infura api key to deploy my contract it works fine. Until I try to verify my contract with publish_source=True in FundMe.deploy function: from brownie import FundMe from ...
Rhaegar's user avatar
  • 21
2 votes
0 answers
44 views

Brownie <> SolcInstallationError, I've tried everything I can find -- nothing has worked!

Everytime I try brownie compile I see this: SolcInstallationError: Downloaded binary would not execute, or returned unexpected output. If this issue persists, you can try to compile from source code ...
B S's user avatar
  • 21
2 votes
0 answers
56 views

Use Brownie to send ERC20 tokens to a payable function with the amount of tokens as an argument to the function

I have the following AlgoToken contract: interface StableCoin { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external ...
Steven Hochstadt's user avatar
2 votes
1 answer
164 views

Adding viaIR: true option Brownie

I'm getting CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. ...
aliercanozgokce's user avatar
2 votes
0 answers
32 views

Reverting blockchain state after each test (Hardhhat isolation Fixture)

When writing smart contract tests in python (using Brownie). I extensively used isolation fixture. This allowed me to isolate test cases from each other. Example: We have TokenContract, which upon ...
Sky's user avatar
  • 2,059
2 votes
1 answer
176 views

Obtaining human readable ABI from Brownie package

I am implementing an app in react-native using ethers.js to interact with blockchain. I needed human readable ABI to create a new instance of a smart contract. But I initially deployed my smart ...
Divyya's user avatar
  • 31
2 votes
0 answers
135 views

How to send 3 transactions to 3 different testnets in brownie

I'm trying send 3 transactions on python (using brownie as api) to 3 different testnets (kovan, rinkeby and goerli), and i'm doing this using 3 differents threads. I have already import inside of ...
1manonearth's user avatar
2 votes
0 answers
83 views

Populating function names in Brownie traces

When I check the traces of a tx, there are a lot of non populated names, e.g <UnknownContract>.0x095ea7b3 It is unclear and hard to trace. But I know 0x095ea7b3 is the standard erc20 "...
Nicolas Bernard's user avatar
2 votes
1 answer
296 views

Brownie ConnectionResetError on running forks

I am running a test script with mainnet-fork using alchemy. The test appears to be successfully completed, but during the tear down bit, brownie throws up: ConnectionResetError: [WinError 10054] An ...
calnix's user avatar
  • 21
2 votes
2 answers
351 views

how to deploy the smart contract in brownie

Error: Final argument must be a dict of transaction parameters that includes a `from` field specifying the address to deploy from Terminating local RPC client... smart contract: pragma solidity ^0.5....
Abed ja'fari's user avatar
2 votes
0 answers
492 views

Help. I have reached an issue that is preventing me from installing Brownie

I can't for the life of me install Brownie completely through Pipx, Septuptools, or anything. Because my python command doesn't seem to work as normal. Preface: So I installed everything that I was ...
WealthEngineer's user avatar
2 votes
0 answers
112 views

In brownie tests how to use interfaces defined in packages

In brownie tests how to use third party interfaces defined in brownie packages? For example how do I use @openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol from OpenZeppelin ...
redfallenstar's user avatar
2 votes
0 answers
1k views

brownie steps to compile, deploy and interact on ropsten

I have created a smart contract and deployed it on ropsten with brownie framework. Here are the steps I've done: Run the command: $ brownie init projet1 I have created my contract in contracts/...
Bob5421's user avatar
  • 1,363
2 votes
1 answer
669 views

Setup brownie to run certain test in a specific network

I am using brownie to run tests and right now my project is using two networks, development and mainnet-fork. I have a test which only runs in mainnet-fork and I am trying to figure out a way to tell ...
Macarse's user avatar
  • 106
1 vote
0 answers
41 views

How to find the Bytecode of Ethereum Smart Contract by just it's address

Hi actually I found the answer & I just wanted to share this with the community You can use the web3.py or brownie module of Python to achieve this web3.py from web3 import Web3 # Connect to ...
Saikat Karmakar's user avatar
1 vote
1 answer
34 views

Having A problem with file directory

I want to verify the contract using the API etherscan token FundMe.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import"node_modules/@chainlink/contracts/src/v0.8/interfaces/...
Salma Sameer's user avatar
1 vote
1 answer
21 views

Deploying Contracts Deterministically using Brownie Console

I am trying to deploy contracts determinsitically using 'salt' via brownie. I would like to be able to do something like this: >>> helloContract = Hello.deploy({'from':accounts[0],'salt':...
TS_101's user avatar
  • 131
1 vote
0 answers
35 views

test transaction call brownie

in brownie, i have a function that calls another one in the same contract, and i want to test if it does it properly : The function : function onTokenTransfer( address _sender, uint256 _fee, ...
noro meb's user avatar
  • 298
1 vote
0 answers
86 views

Is it possible to get the raw transaction hex of the entire transaction in Brownie?

I am creating unit tests for a smart contract that I am working on using Brownie and pytest. In one of the functions, I need to pass the raw transaction hex of an entire Ethereum transaction (not just ...
Jdawg287's user avatar
1 vote
0 answers
66 views

Brownie as a package in Flask project

I have a Flask project and a brownie project with a small smartcontract. Now I want to integrate my smartcontract functionality into my Flask app. But, I used to run brownie by: brownie run scripts/...
bl0ckCh4in's user avatar
1 vote
0 answers
29 views

test_can_withdraw() not working in Brownie

Struggling with testing my withdraw function in a Solidity smart-contract via Brownie: My withdrawing function is the following but in Remix it definitely works and I have tested _owner.send() and ...
emilrueh's user avatar
1 vote
1 answer
473 views

Error Installing ETH Brownie

So I get a error for each of the 3 different processes when I attempt to install eth-brownie on my Mac OS... With "pip install eth-brownie", I get the error fatal error: too many ...
Wealthanaire's user avatar
1 vote
0 answers
22 views

ValueError(f"Dotenv specified in config but not found at path: {env_path}")

I am trying to run this contract but I get the following error: (base) elly@elly-Lenovo-G50-80:~/demos/web3_py_simple_storage/brownie_fund_me$ brownie run scripts/deploy.py Brownie v1.19.1 - Python ...
Elena 46's user avatar
1 vote
0 answers
61 views

Eth-brownie related problem- Error trying to deploy a contract

I’ve run into the following error while deploying a script. The script runs fine until the encode_and_supply function is called. File "brownie/_cli/run.py", line 51, in main ...
Philip's user avatar
  • 11
1 vote
0 answers
55 views

Setting runs in solc options at brownie-config.yaml

My goal is to set the runs key of solc to the value of 100 inside the brownie-config.yaml file. I have found two different solutions and I would like to know what is the difference between the two in ...
rihekopo's user avatar
  • 288
1 vote
0 answers
82 views

Brownie Compile Unicode Decode Error

I am trying to compile this smart contract (fluxAggregator) to setup a Flux-Monitor within VS Code using brownie: Windows 10, Brownie v1.19.0, Python v3.9.13, Node.JS v16.14.2, NPM v8.13.1 Within the ...
Matt's user avatar
  • 171
1 vote
1 answer
57 views

Brownie doesnt compile but says it did

if i run brownie compile i get INFO: Could not find files for the given pattern(s). Brownie v1.19.0 - Python development framework for Ethereum Project has been compiled. Build artifacts saved at C:\...
Toshiro Nakamoto's user avatar
1 vote
0 answers
29 views

How to add all the EVM chains to brownie?

I am able to add particular RPC url for that particular chain for eg. Binace Smart Chain to brownie using "brownie networks add". But I want to multiple networks to brownie, how can I ...
Harsh Shah's user avatar
1 vote
1 answer
78 views

How do I make sure I have enough gas for my transaction to go through. I get a value error whenever I try to deploy a contract in brownie

I am following Patrick Alphas tutorial using brownie https://youtu.be/M576WGiDBdQ . I have a fund_and_withdrawl script that has been compiled . With that, I am trying to deploy a fundme contract on a ...
Light Samus's user avatar
1 vote
0 answers
294 views

Depositing Weth ERC20 from Brownie into Aave Pool in contract

I am tying to do a simple deposit into an Aave V2 pool with Python Brownie and Solidity on a mainnet-fork but my transaction keeps getting reverted and I dont know why. In brownie, I call my function ...
Pysnek313's user avatar
1 vote
1 answer
146 views

Is there a way to import LinkToken, MockV3Aggregator, and all the other Chainlink mocks without adding the interface file?

I'm following the Solidity, Blockchain, and Smart Contract Course lessons from Free Code Camp and I noticed that Patrick sometimes seems to import mock Chainlink aggregators and mock token contracts ...
Leaf Defi's user avatar
1 vote
0 answers
96 views

Can I combine Brownie to view events and contracts on Ganache?

It seems that ganache can only work for truffle-config file , if i want to see the events and smart contracts on my local ganache blockchain? I am developing an app where i want to locally test the ...
Harsh Gill's user avatar
1 vote
1 answer
296 views

Approve and dis-approve ownership of erc721 tokens

I have created a contract which takes care of buy and sell of NFT's or ERC721 tokens. So i have approved the contract to sell the NFT. Now my questions are:- Once I have transferred the contract to a ...
Deepak Lohmod's user avatar
1 vote
0 answers
76 views

Has anyone gotten Brownie developer revert comments to work with Vyper?

When I try to use Brownie developer revert comments with a Vyper contract as described in the Brownie documentation here: Developer Revert Comments Brownie does not seem to recognize the comments. ...
Alec Stewart's user avatar
1 vote
0 answers
124 views

Brownie: replacement transaction underpriced

I have a stuck transaction in brownie, when I try to deploy another contract I have this error: ValueError: replacement transaction underpriced my deployment code is like this: dev = accounts.add(...
user97483's user avatar
1 vote
0 answers
141 views

Deployed Contract Doesn't Show up

I deploy a smart contract using Brownie to local Ganache blockchain (GUI, not CLI). I can see every transaction that I do and accounts (tx-count). However, the contract tab is always empty and asks me ...
Emrah's user avatar
  • 1,454
1 vote
0 answers
372 views

UUPS proxy with the Brownie framework

I am trying to implement a UUPS proxy using the OpenZeppelin UUPSUpgradeable abstract contract. I actually succeeded to do so but I think that there may be a better way than the one I found. In other ...
Angelo's user avatar
  • 11
1 vote
0 answers
306 views

How to pass struct argument in brownie-eth?

I tried to pass list of dicts to an argument like this. mycontract.myfunction([{"token1": "...", "token2": "..."}], {"from": account}]) it don't work....
Prisius's user avatar
  • 23
1 vote
2 answers
211 views

brownie.exceptions.EventLookupError: Event 'xxx' did not fire

I am testing my contracts with brownie on local ganache and hit an issue where my events are not firing. When I call tx.events['xxx']['param1'] I get error: brownie.exceptions.EventLookupError: ...
user94798's user avatar
1 vote
1 answer
76 views

Is property based testing easily setup in a hardhat project?

I've initially started solidity development using the python brownie framework, however I am thinking of transitions over to hardhat to keep all codebases(frontend&backend) language consistent i.e....
MShakeG's user avatar
  • 573
1 vote
1 answer
230 views

How to clean or reset brownie build folder

Is there a command to clear/reset the brownie build folder (including the deployments folder)? It would be a nice feature to have :)
user94798's user avatar
1 vote
0 answers
123 views

ProcessLookupError: Could not attach to RPC process by querying 'proc.net_connections()'

Anyone know the solution to this? root@DESKTOP-MIQQV4H:/mnt/c/users/user/documents/Blockchain/brownie_fund_me# brownie run scripts/deploy.py Brownie v1.17.2 - Python development framework for Ethereum ...
defi legend's user avatar
1 vote
0 answers
43 views

Expected in: flat namespace after install brownie

i installed brownie with pipx but when i type any command i get this: Traceback (most recent call last): File "/Users/lorisfacchinetti/.local/bin/brownie", line 5, in <module> ...
netti169's user avatar
1 vote
1 answer
296 views

How do I tell which solidity version eth-brownie is using to compile my contracts?

I'm not specifying a solidity version so I'm not sure which solidity version brownie is using to compile my contract. I'm using pragma solidity ^0.8.0; so I'm not sure which version above 0.8.0 ...
tythereum's user avatar
1 vote
1 answer
206 views

Brownie "No Module named"Users"" error

I keep on getting this error, following the Freecodecamp solidity tutorial. Brownie seems to be fine when making the accounts and adding private key like seen in video, and ganache-cli is installed ...
Unreal._.N1K's user avatar