Questions tagged [brownie]

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

106 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
404 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
2answers
358 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
0answers
98 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
0answers
55 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 ...
2
votes
0answers
47 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
1answer
738 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-...
2
votes
0answers
843 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
1answer
256 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
0answers
10 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
2answers
73 views

raise ValueError("Explorer API not set for this network") ValueError: Explorer API not set for this network

I run this code in brownie: brownie run scripts/deploy.py --networks Rinkeby deploy.py: from brownie import network, config, accounts from brownie import FundMe def deploy_fund_me(): account = ...
1
vote
0answers
22 views

brownie is not reading web3 infura project id even though it's already set in .env

I'm following Patrick Collins' NFT Smart Contract course on YT and I can't get Brownie to read the WEB3 Infura project id This is what the Error looks like Brownie v1.16.4 - Python development ...
1
vote
0answers
13 views

Brownie compiler remappings: "@"?

In the doc'n: brownie compiler remappings for the file brownie-config.yaml It gives two examples, ex 1. has no "@" symbol: compiler: solc: remappings: - zeppelin=/usr/local/lib/...
1
vote
0answers
53 views

I am getting virtual machine error while running my brownie fundme contract

PS E:\brownie_fund_me> brownie run scripts/fund_and_withdraw.py --network ganache-local INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for ...
1
vote
0answers
14 views

brownie deploying contract get transaction-receipt

Is there a way to get the transaction-receipt when deploying a contract with contract.deploy()? The method returns the Contract object but i also want the transaction receipt. Background: i want to ...
1
vote
0answers
6 views

Where does brownie save classes generated from Solidity contracts?

Brownie makes available solidity Contracts as Python classes (ContractContainer). Where are those Python source files? I am interested because would like to direct the IDE I use to read and parse ...
1
vote
0answers
11 views

Brownie Compile - Show compiler warnings

Am using Brownie v1.16.3, and when running brownie compile I do not see any compiler warnings. Is there a way to show compiler warnings when using brownie?
1
vote
0answers
58 views

Using imported solidity interfaces with brownie

It seems like brownie compile doesn't produce ABI for an imported interface. I would like to use OpenZeppelin IERC20 interface. Here is the setup: brownie-config.yaml: dependencies: - OpenZeppelin/...
1
vote
0answers
24 views

Type error when running brownie --version

Please I am getting this error after installing brownie using pipx. I tried running "brownie --version" and I got the error above. can someone assist in resolving this pls? C:\Users\OGIDAN ...
1
vote
1answer
122 views

Unable to transfer funds to contract address using Brownie

I have deployed a contract, testContract, onto bsc testnet I have a test wallet with sufficient funds and can seemingly make transfers to other wallet addresses without any issues. I am just trying to ...
1
vote
1answer
257 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&...
1
vote
0answers
36 views

odd Brownie revert error

I keep getting this error VirtualMachineError: revert Trace step 1206, program counter 176: File "contracts/UniswapV2Factory.sol", line 7, in UniswapV2Factory.createPair: contract ...
1
vote
0answers
131 views

Running a flashloan arbitrage contract on Quickswap but I keep getting a 'VirtualMachineError: revert' error with no other details

I assume that this means the transaction works but the profit margin isn't high enough to pay back the loan. But unlike the Uniswap errors that have an output like "INSUFFICIENT LIQUIDITY" ...
1
vote
0answers
217 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 ...
1
vote
1answer
358 views

Brownie AttributeError: 'NoneType' object has no attribute 'get'

Hey all I'm learning solidity and I'm following a guide on how to make a lottery smart contract. At the beginning of the project I'm trying to compile after making a brownie-config.yaml I am met with: ...
1
vote
1answer
263 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: ...
1
vote
0answers
26 views

How can I use Brownie build folder to restore my deployments?

I use brownie bake chainlink-mix and set the environment, then I run brownie run scripts/price_feed_scripts/deploy_price_consumer_v3.py --network kovan and the contract crate successfully,but the ...
1
vote
0answers
32 views

Smartcontract lottery project - brownie compile generates Connection Error : 404

When I am trying to brownie compile "smartcontract-lottery" I get a connection error -> Something like this : : ConnectionError: Status 404 when getting package versions from Github: '...
1
vote
0answers
159 views

SOLVED How to use Metamask with Brownie and Flask

How to: Spin up a front end with brownie Initiate a transaction Have metamask sign the transaction I have my brownie app connected to my flask app to run the Code of the smart contracts, but i don't ...
1
vote
0answers
69 views

Why is delegatecall returning 0 and erroring?

I'm working with OpenZeppelin upgradable proxies, as well as their governance. I have a propose function that looks like: function propose( address[] memory targets, uint256[] memory ...
1
vote
1answer
124 views

Cant compile contracts with brownie because of this error: which: no solc in $PATH (on Gnu/Linux boxes) after a fresh install

After following the instructions to install Brownie using pipx (https://eth-brownie.readthedocs.io/en/stable/install.html#installing-brownie) I was able to execute brownie (after adding ~/.local/bin ...
1
vote
0answers
474 views

brownie.exceptions.RPCRequestError when calling a function from contract using Brownie

Encountering the following issues calling a contract w/ Brownie v1.14.6 on mainnet-fork w/ infura. Note that pool_lens = interface.FusePoolLens("0x8dA38681826f4ABBe089643D2B3fE4C6e4730493"). ...
1
vote
1answer
236 views

Error installing eth-brownie in MacOS

I call pipx install eth-brownie and get this error: pip failed to build packages: bitarray cytoolz lru-dict Some possibly relevant errors from pip install: fatal error: too many ...
1
vote
1answer
311 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
1answer
874 views

How do I execute the withdraw function to withdraw token from smart contract?

Total newbie here. So I deployed a contract and already did the flash loan, but now I want to withdraw the remaining funds that I deposited into the smart contract (for the premium fee). How do I ...
1
vote
1answer
1k views

Getting "ValueError: intrinsic gas too low" when trying to make a basic swap on Quickswap (polygon/matic)

I'm using Brownie to try and make a basic swap on Quickswap: from brownie import accounts, config, network, interface def main(): """ Runs the make_swap function on the Uniswap ...
1
vote
0answers
74 views

Call and send transaction function call without having to build transaction [web3.py]

Right now, when I want to send a transaction, I have to build it, sign it, and then send it like so: function_call = contract.functions.function_call(parameters) transaction = function_call....
1
vote
0answers
20 views

Unable to Compile Contract in Brownie

When I "Brownie compile" I don't receive a .json file under build>contracts If anyone can please help me I'll gladly send you a tip for your time.
1
vote
3answers
559 views

Unable to Compile Contract in Brownie (not receiving a .json file in "build" folder )

I'm currently running Brownie in Studio Visual Code. My problem is that when I write a smart contract and try to compile it using command "Brownie Compile" I don't' receive a .json file in ...
1
vote
1answer
117 views

Brownie package manager: pm or ethpm

I have read several documentations about brownie. I have find 2 ways to install a package like openzeppelin-contracts: $ brownie pm install OpenZeppelin/openzeppelin-contracts@3.0.0 and $ brownie ...
1
vote
0answers
22 views

How can I automize process of deploying my contract?

I am using following appoach How to deploy Ethereum Smart Contract through Brownie to the Private Network. I want to automate this process in order to capture the transaction hash and deployed ...
0
votes
0answers
3 views

Where to include infura project id in brownie

I am trying to use infura with brownie. My env file looks like this: export WEB3_INFURA_PROJECT_ID = 9801991e384642dd9eeccecb7af46dfe My deploy.py file looks like this def main(): accounts.add(os....
0
votes
0answers
12 views

Error publishing source code

Here's my deploy.py: from brownie import FundMe from scripts.helpful_scripts import get_account def deploy_fund_me(): account = get_account() fund_me = FundMe.deploy({"from": ...
0
votes
0answers
12 views

Gas estimation failed: 'execution reverted' | Brownie | Rinkeby

I have created a smart contract in order to hack Coin Flip on Ethernaut: // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import '@openzeppelin/contracts/math/SafeMath.sol'; import './CoinFlip....
0
votes
1answer
10 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.. ............................................
0
votes
0answers
5 views

How to enforce relative constraints on brownie hypothesis strategy?

Say I have the the following 2 strategies for 2 variables smaller and bigger. How can I enforce a constraint on either strategy such that the randomly selected smaller is always less than than bigger ...
0
votes
0answers
21 views

No such file or directory: brownie-config.yaml

I am deploying the deploy.py script # from brownie import FundMe, accounts, config from brownie import FundMe, accounts import yaml import json from scripts.helpful_scripts import get_account # here ...
0
votes
0answers
26 views

How can I fix this Uniswap Router bot?? It's making me put a time.sleep(40) just before buy() function?

This uniswap router bot triggers a swapExactETHForTokens transaction but it always fails with an "out of gas" error unless I put a time.sleep(40) just before the buy() function. I tried to ...
0
votes
0answers
35 views

How can I fix a ValueError revert transaction on a sniper bot that reverts only when triggered by an event(PairCreated)..otherwise swap goes through?

THIS IS A BOT TO SWAP ON UNISWAP WHEN NEW PAIR IS CREATED BUT WHEN BUY FUNCTION IS TRIGGERED BY AN EVENT THE TRANSACTION REVERTS BUT BUY FUNCTION GOES THROUGH WHEN TESTING JUST THE buy() ...
0
votes
0answers
6 views

Contract size in brownie

What is the best way to get a contract size in Brownie? Looking at the json in build/contract, I can see deployedBytecode. Is this what must be constrained in the 24k main net limit?
0
votes
0answers
13 views

Python Brownie: Import statement does not import solidity contract when run from python

I am trying to run the below script from python but it does not find the ADAI contract that I just compiled. It works fine when I do brownie run scripts/interact.py from the command line. Looks like ...