Skip to main content

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
0 votes
2 answers
345 views

Can't call existing Solidity function with Brownie due AttributeError

I have deployed a simple contract on the BSC testnet which has a simple function that executes a swap on Pancakeswap. This is how I call the function with Brownie: def main(): tx = contract1....
1 vote
3 answers
351 views

Verification of contract using Brownie

I'm at the point of a solidity course where I need to get the API key token from etherscan.io. I followed all the steps, but my code breaks when I use Brownies deploy function with "...
1 vote
4 answers
1k 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
1 answer
3k 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 ...
0 votes
1 answer
613 views

Execution reverted on token swap on Fantom (Solidly, SpookySwap) using Brownie

I am developing a trading bot, that directly interacts with smart contracts on Fantom, an EVM compatible blockchain. Smart contracts I tried in order to swap TOMB tokens to FTM tokens: Solidly ...
2 votes
1 answer
473 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. ...
0 votes
1 answer
549 views

Brownie does not find @openzeppelin after being installed

Brownie does not find openzeppelin contracts, even if brownie knows that it is installed (base) andrea@andrea-ThinkPad-S430:~/MEGA/smart_contracts/demos/ERC20-brownie$ brownie pm install OpenZeppelin/...
0 votes
1 answer
432 views

Solidity transaction "reverted" when contract is called by another contract

This deposit function works perfectly. However, when I attempt to call this function from another contract (through an interface), it does all the right transactions, but then reverts at the end, ...
0 votes
3 answers
450 views

AttributeError - 'InterfaceContainer' object has no attribute

from brownie import config, network, interface from scripts.helpful_scripts import get_account from scripts.get_weth import get_weth def main(): account = get_account() erc20_address = config[...
0 votes
1 answer
315 views

account not accessible through brownie accounts while using --network ganache-local

(eth-brownie) PS C:\Users\lucky\Desktop\Investing\Courses\Solidity\demos\brownie_fund_me> brownie run scripts/deploy.py --network ganache-local INFO: Could not find files for the given pattern(s). ...
2 votes
1 answer
738 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 ...
0 votes
1 answer
454 views

OpenZeppelin and chainlink not found; the error is probably on the dependencies; The npm I also not working

Lottery.sol file " CompilerError: solc returned the following errors: "contracts/Lottery.sol:4:1: ParserError: Source "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol&...
1 vote
1 answer
769 views

ERC20: insufficient allowance error after using approve function while testing Vesting Vault fund function [Brownie]

I made a vesting vault with one beneficiary set on construction and a one time fund function which can be only called by the owner. The fund function funds the contract with ERC-20 tokens and sets an ...
0 votes
2 answers
526 views

ValueError: Unable to expand environment variable in host setting: 'https://rinkeby.infura.io/v3/$WEB3_INFURA_PROJECT_ID'

Brownie v1.15.1 - Python development framework for Ethereum File "brownie/_cli/__main__.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main() File &...
1 vote
1 answer
950 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 ...
0 votes
1 answer
383 views

Is there any way to upload a list or array of addresses on ipfs, and access it from a smart contract?

I am planning to make a decentralized voting application. The addresses of eligible voters should be uploaded on IPFS for anyone to access. This file on IPFS will be used in the contract to make sure ...
0 votes
1 answer
352 views

ValueError: max fee per gas less than block base fee - Brownie

I am getting the error "ValueError: max fee per gas less than block base fee" when I try to run the following script using Brownie. I think I figured out that when I send a transaction, I ...
0 votes
2 answers
430 views

Brownie : Contract Functionality not available in local environment

I have set up a new brownie project (brownie bake yearn strategy mix). When I try running tests I get this error : brownie.exceptions.BrownieEnvironmentError: Functionality not available in local ...
0 votes
0 answers
13 views

I am not able to specify network in brownie run

I am not able to specify networks in brownie run. brownie run ./scripts/deployment_v2.py --network ropsten I get error TypeError: 'NoneType' object is not subscriptable error log: PS C:\Users\ADMIN\...
1 vote
1 answer
482 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 ...
2 votes
1 answer
831 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
1 answer
848 views

How to add polygon fork network to brownie with correct chain-id

I want to add a forked network to brownie. If i do it like this: brownie networks add development polygon-main-fork-dev cmd=ganache-cli host=http://127.0.0.1 chainid=137 fork='https://polygon-mainnet....
2 votes
2 answers
935 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
2 answers
504 views

ImportError: cannot import name 'LinkToken' from 'brownie'

I am working with the tutorial by freecodecamp.org and have the following error: ImportError: cannot import name 'LinkToken' from 'brownie It is also not able to import VRFCoordinatorMock which I am ...
0 votes
1 answer
397 views

ParserError: Source "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found: File outside of allowed directories

I'm trying to compile a "FundMe.sol" contract: the issue is that when I try to compile it I keep getting the following Compiler Error: Brownie v1.19.2 - Python development framework for ...
1 vote
1 answer
376 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 ...
0 votes
1 answer
859 views

Gas estimation failed: execution reverted on goerli with brownie

I'm trying to test an onlyOwner function on goerli testnet which's expected to be passed with pytest.raises(exceptions.VirtualMachineError) but it keeps getting below error. I added priority_fee and ...
0 votes
1 answer
354 views

Brownie contract Interface not working on mainnet-fork

I'm following Patric Collins youtube video and trying to deposit wETH in the wETH contract using an interface and working using a fork of mainnet. I am trying to deposit eth in the next contract. ...
2 votes
1 answer
96 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 ...
0 votes
0 answers
22 views

Trouble publishing contract source code in Brownie: ConnectionError 403

I'm encountering an issue while attempting to deploy a contract using Brownie and publish its source code to Etherscan. The deployment itself is successful, but I'm unable to publish the contract ...
0 votes
1 answer
392 views

Gas estimation failed on run in rinkeby network

ValueError: Gas estimation failed: 'invalid opcode: opcode 0xfe not defined'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually. Could someone please ...
2 votes
2 answers
403 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....
1 vote
1 answer
870 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 ...
0 votes
1 answer
2k views

ParserError: Source file requires different compiler version

I am a beginner working on brownie using vscode related to a lottery smart contract. Please don't mind if I am doing any rookie mistakes I am still trying my best to understand it as much as I can :) ...
1 vote
2 answers
4k 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 ...
0 votes
1 answer
650 views

Error from brownie compile with IERC721.sol

I am getting an error from brownie compile and I can't figure out why it wont import one of the openzeppelin contracts when all the others import ok. here is my brownie-config.yaml # https://eth-...
0 votes
1 answer
505 views

from brownie import Token, accounts

Error is cannot find Token Exception has occurred: ImportError cannot import name 'Token' from 'brownie However Token JSON file exists brownie bake token worked
0 votes
1 answer
48 views

I am trying to make my contract get to call approve function of an erc20 token

I am trying to build a contract that allows user to supply/deposit token to the aavae protocol but i need to make my contract get approval of the token amount to be spent by the contract. I tried ...
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\...
0 votes
0 answers
81 views

Transaction Error: Uniswap RouterV2 Sepolia Testnet

Im trying to swap WETH -> USDC in the Sepolia Testnet using Uniswap Router02 contract. Firstly I minted 0.5 ETH from the Faucet then created a Python script that uses Brownie (had to add the ...
2 votes
4 answers
2k 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 = ...
0 votes
0 answers
12 views

brownie deploy using script error

PS C:\Users\Rakshit_Kumar_Singh\Desktop\brownie-learn> brownie run .\scripts\deploy_testnet.py Brownie v1.20.0 - Python development framework for Ethereum File "C:\Users\Rakshit_Kumar_Singh\...
3 votes
2 answers
470 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/ ...
1 vote
1 answer
365 views

Brownie: TransactionReceipt from a reverted tx inside a script

In the Brownie-documentation it says: Debugging Tools When using the console, transactions that revert still return a TransactionReceipt object. This object provides access to various attributes and ...
2 votes
1 answer
334 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 ...
0 votes
1 answer
340 views

Unable to install Ganache

I am learning Solidity from this tutorial: https://www.youtube.com/watch?v=M576WGiDBdQ And there is a section about ganache cli and brownie. Brownie doesn't run scripts because I am unable to install ...
1 vote
0 answers
12 views

Is brownie supporting OpenZeppelin/[email protected]?

I got the following answer after runing brownie pm install OpenZeppelin/[email protected] WARNING: Unable to compile OpenZeppelin/[email protected] due to a AttributeError - you ...
0 votes
0 answers
16 views

Brownie Request for Random number (Mock VRF) reverts

Using chainlink tutorial and concept for testing a random request locally, Request Randomness fails to execute in brownie for VRFCoordinatorV2Mock, however, I tested the same code in remix IDE and it ...
0 votes
0 answers
32 views

What is the importance of `message Hash` generated from signing using private key

when we are signing a message using our private key what's the use case of the message hash ? Take the example from the eth_accounts module from python. >>> msg = "I♥SF" >>>...
1 vote
2 answers
292 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 :)

1
2 3 4 5
8