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
1answer
5 views

How to explicitly use ContractCall in Brownie

When fetching Uniswap v3 pool prices from its quoter contract via web3 I'm calling contract function which is not labeled as view or pure, however with web3 I'm doing like this: price = quoter....
1
vote
2answers
23 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 ...
0
votes
1answer
7 views

Documentation for brownie env variables

I'm using brownie for a while to interact with ethereum, and I've always used ETHERSCAN_TOKEN to publish the source code in Etherscan, however I'm unable to find this env variable in the documentation....
0
votes
1answer
35 views

Brownie: Constructor Sequence has incorrect length, expected 1 but got 0? [duplicate]

Following this tutorial: https://youtu.be/M576WGiDBdQ?t=18945 (timestamped for your convenience!) When I run brownie run scripts/deploy.py --network rinkeby I get back File "brownie/_cli/run.py&...
0
votes
1answer
18 views

Race conditions in brownie, how to guarantee this will execute in order?

Let's say I have a contract like this: contract Test{ uint8 test = 0; // getter and setter } and I want to issue it using some python code like: initial = contract.getTest() contract.setTest(1, {&...
2
votes
1answer
36 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/...
0
votes
1answer
19 views

How do I set the price automatically?

I have a question related to billing for NFT, is it possible to prescribe in the smart contract function to set the price ? The problem is that after posting the nft you need to press Salle, set the ...
0
votes
0answers
37 views

Is it necessary to prescribe in the smart contract to set the price and pass the NFT to another person?

I am developing a smart contract to publish the NFT. Since I am using ipfs to store json I made a function to create a collection that gets the metadata reference and mints the token. Is it necessary ...
1
vote
0answers
34 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 ...
0
votes
0answers
14 views

error install eth-brownie by pipx because command returned non-zero exit status 1

I'm having problem on installing brownie for python. I've install latest python 3.9.6 and also install pipx. Any suggestion to solve this?thanks PS C:\Users\dohva\Documents\Github Repo\cointoken> ...
0
votes
0answers
27 views

Brownie - Contract.from_explorer is not working - What else can I try?

I'm working with the Balancer Vault Contract, address: 0xBA12222222228d8Ba445958a75a0704d566BF2C8 I was running tests and they were failing, the error was 'SourceUnit' object has no attribute 'name' I ...
0
votes
2answers
45 views

Eth Beginner Problems

For the last couple days I've been trying to create my first NFT project so I've been following the beginners guides. Long story short the 'brownie' command WILL NOT WORK so I cant even get started ...
1
vote
1answer
79 views

HTTPError: 401 Client Error: Unauthorized for url: https://rinkeby.infura.io/v3/

I'm getting this error Brownie v1.15.1 - Python development framework for Ethereum NftMixProject is the active project. File "brownie/_cli/__main__.py", line 64, in main importlib....
1
vote
1answer
18 views

Reference already-deployed contracts in testing-suite

when I run my deploy script in console, ContractContainer has the newly deployed contract-address. But when I try to reference that in tests, ContractContainer seems to be empty. What would be the ...
0
votes
0answers
90 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 &...
0
votes
0answers
8 views

I try to run a script but receive attribute error: "module 'user' has no method 'main

from brownie import AdvancedCollectible, accounts, network, config def main(): print('hello') pass I receive this error when trying to run this script, NftFromScratchProject is the active ...
0
votes
0answers
32 views

:38:14: ParserError: Expected '(' but got identifier, got this error when trying to compile this code, can someone help please,thank you

pragma solidity 0.6.6; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol"; contract AdvancedCollectible is ...
2
votes
2answers
153 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. ...
1
vote
1answer
254 views

Brownie: PRIVATE_KEY issue: ValueError: The private key must be exactly 32 bytes long, instead of 0 bytes

I am trying to run a script in brownie, but I'm running into this error: ValueError: The private key must be exactly 32 bytes long, instead of 0 bytes. Terminating local RPC client... I'm using a ....
0
votes
1answer
26 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
0answers
140 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, ...
0
votes
0answers
104 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
0answers
80 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
101 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
1answer
115 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 ...
2
votes
1answer
42 views

How to use Script from Brownie Dependency

I have a brownie project containing the source code for a Vault contract as well as it's deployment script. Badger-Vaults Containing the Vault.vy contract for vaults, as well as scripts/...
0
votes
0answers
10 views

How to subscribe to events in brownie

I am having trouble subscribing to events with brownie. My interface is imported with from brownie import interface From there, I have access to the external methods but not the events. I have found ...
2
votes
3answers
917 views

How can I make an ERC721 NFT such that the token owner can edit an attribute in the metadata? Where can they edit the metadata?

I've read that ERC721 tokens can be created such that the token owner can edit the on-chain metadata. I've been following tutorials for the brownie-nft mix and making NFTs on OpenSea, but I have yet ...
1
vote
2answers
206 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
1answer
352 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 ...
0
votes
1answer
89 views

Solidity: Unable to expand environment variable in host setting

When I try to run: brownie run scripts/collectible/deploy_advanced.py --network rinkeby this error occurs... INFO: Could not find files for the given pattern(s). Brownie v1.14.6 - Python ...
1
vote
2answers
202 views

'Brownie compile' using different compiler version than specified in configuration file

Why does brownie attempt to compile with the latest locally available version of solc even if I set a specific older version in the config file? Example: bernat:uniswap-v3-playground bernat$ brownie ...
0
votes
1answer
92 views

Can you check if an address is a contract or an EOA with eth-brownie or some other python native package?

I'm trying to categorize smart contracts versus EOAs since I am treating them differently in an application. Does anyone have ideas? I know in solidity you could try address.code.length or extcodesize ...
1
vote
1answer
57 views

What is the recommended way to setup brownie project?

So as to run the brownie cli I have to install browine as python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install eth-brownie But to import and playaround the brownie modules it ...
2
votes
0answers
228 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-...
0
votes
2answers
31 views

View remote chain in GUI [duplicate]

I have a brownie project on a remote server. I'm interacting with it using VS Code and launch a ganache-cli mainchain fork using the brownie console command. I have no problem issuing transactions ...
2
votes
1answer
104 views

Call fallback function from eth-brownie from proxy

I have a contract that has a fallback function to delegatecall all function calls to a different contract. I can't seem to use my typical API to interact with the contract it delegates a call to. I ...
0
votes
0answers
136 views

Gas estimation failed -- flashloans -- solidity

I am able to deploy a smart contract, and even fund it with WETH from my metamask wallet without any gas estimation failures. When I try to execute my flashloan on this smart contract, however, I get ...
0
votes
1answer
253 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
1answer
315 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
1answer
202 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
0answers
13 views

Cannot import 'VRFConsumer', 'PriceFeed', 'APIConsumer', and 'interface'

I'm new to brownie ( but not new to python) and am trying to get a basic project running to make sure everything works. I've been going off the Patrick Collins tutorial where uses the chainlink mix. ...
1
vote
1answer
451 views

Error: Non-hexadecimal digit found

I seem to be running the following error when I try to run this script: , from brownie import AdvancedCollectible, accounts, network, config def main(): dev = accounts.add(config['wallets']['...
1
vote
1answer
91 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: ...
2
votes
1answer
90 views

KeyError: 'wallets'

Screenshot of directory: This is the code in my brownie.config.yaml file: reports: exclude_contracts: - SafeMath dependencies: - smartcontractkit/chainlink-brownie-contracts@1.0.2 - ...
2
votes
1answer
361 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
0answers
38 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....
0
votes
0answers
47 views

AttributeError: Module 'Users' Has No Method 'Main'

In Brownie I'm running a script which sends me this error "AttributeError: Module 'Users' Has No Method 'Main'. Do you have any suggestions on how I can fix this? import os from brownie import ...
1
vote
0answers
17 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.
0
votes
0answers
50 views

Problem with deploying a collectible with brownie

I tried to deploy a collectible with brownie. When I typed "brownie run scripts/simple_collectible/deploy_simple.py" the terminal simply told me, that there was a file missing. Here is a ...