Questions tagged [brownie]
Brownie is a Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
175
questions with no upvoted or accepted answers
5
votes
0
answers
153
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 ...
3
votes
0
answers
219
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 ...
3
votes
0
answers
698
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, ...
3
votes
2
answers
467
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/
...
3
votes
1
answer
160
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 ?
2
votes
0
answers
132
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 ...
2
votes
0
answers
70
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 ...
2
votes
0
answers
88
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 ...
2
votes
1
answer
339
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. ...
2
votes
0
answers
70
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 ...
2
votes
1
answer
204
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 ...
2
votes
0
answers
152
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 ...
2
votes
0
answers
85
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 "...
2
votes
1
answer
317
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 ...
2
votes
2
answers
393
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....
2
votes
0
answers
550
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 ...
2
votes
1
answer
818
views
Brownie: CompilerError: File outside of allowed directories
I'm trying to import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" to my contract but i encountered this error.
CompilerError: solc returned the following errors:
...
2
votes
0
answers
117
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 ...
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/...
2
votes
1
answer
712
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 ...
1
vote
0
answers
46
views
How can we get the result of swap in curve.fi like `getAmountsOut` for uniswapV2
I'm trying to get the price for the swap WETH->DAI by calling get_dy but there is no direct pool in curve. I went to the UI & put in this swap & got this. tricypto: WETH -> USDT -> ...
1
vote
0
answers
533
views
has anyone seen this error installing brownie?
Banging my head against a wall trying this. have tried uninstalling cytoolz, pipx, and reinstalling but keep getting this error trying to install brownie.
Collecting click==8.1.3 (from eth-brownie)
...
1
vote
0
answers
11
views
Vyper: How to test internal helper functions?
I'm writing a Roulette contract as a learning activity in Vyper. My contract seems to be working through manual testing, and now I'm starting to write unit tests.
I have an internal helper function ...
1
vote
1
answer
21
views
Call fundSubcription() chain link vrf v2 using brownie gas fee error?
def addCustomerAndFundsub(_subId, _cunsumerContract):
account = get_account()
if network.show_active() in LOCAL_BLOCKCHIAN_ENVIROMENTS:
VRF_contract = VRFCoordinatorV2Mock[-1]
else:...
1
vote
0
answers
192
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 ...
1
vote
1
answer
35
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/...
1
vote
1
answer
38
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':...
1
vote
0
answers
58
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,
...
1
vote
0
answers
121
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 ...
1
vote
0
answers
93
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/...
1
vote
0
answers
40
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 ...
1
vote
1
answer
732
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 ...
1
vote
0
answers
32
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 ...
1
vote
0
answers
66
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
...
1
vote
0
answers
65
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 ...
1
vote
0
answers
92
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 ...
1
vote
1
answer
73
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:\...
1
vote
0
answers
38
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 ...
1
vote
1
answer
92
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 ...
1
vote
0
answers
342
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 ...
1
vote
1
answer
156
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 ...
1
vote
0
answers
101
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 ...
1
vote
0
answers
80
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.
...
1
vote
0
answers
150
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(...
1
vote
0
answers
153
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 ...
1
vote
0
answers
437
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 ...
1
vote
0
answers
322
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....
1
vote
2
answers
224
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: ...
1
vote
1
answer
84
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....
1
vote
2
answers
259
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 :)