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
0answers
5 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
21 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 ...
0
votes
0answers
14 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
12 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
18 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
71 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
30 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
31 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
61 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
8 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
137 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
37 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
41 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 - ...
1
vote
1answer
85 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
12 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
26 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
15 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
23 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 ...
3
votes
1answer
112 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
1answer
59 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 ...
0
votes
1answer
21 views

How to use smtp protocol in solidity smart contract via chainlink Oracle

i had developed a external adapter that make a http get request to cryptocompare api and get latest eth-usd price for me. from bridge import Bridge class Adapter: base_url = 'https://min-api....
0
votes
0answers
11 views

Event data has insufficient length | What does this mean?

I've seen this warning from time to time when working with Brownie Event data has insufficient length This is after I made a call to a Chainlink node, calling a function like: function requestUsers()...
0
votes
1answer
37 views

How do I get the deployed contract's address from a ContractContainer object in Brownie?

I want to chain contract deployment, where the second contract gets as a parameter the address of the first. I'm using Brownie : from brownie import ContractA, ContractB , accounts def main(): ...
0
votes
0answers
41 views

Better way to send transaction/call function with web3.py?

If I'm using a 3rd party provider for my web3.py connection, I have to do a few things to call a function. I need to get the nonce: nonce = w3.eth.getTransactionCount(address) I need to build the ...
0
votes
2answers
163 views

Verifying token contract on Rinkeby etherscan

I am testing my new token contract on Rinkeby. The contract was compiled and deployed using Brownie. I am deploying the token to Rinkeby and it is compiled and deployed correctly. However, when I try ...
0
votes
2answers
69 views

Deploy contract to Kovan with brownie and infura

I'm trying to simply deploy a smart contract in Kovan network, i've used the export of the ID using export WEB3_INFURA_PROJECT_ID=xxxx but i'm getting this error ValueError: The method ...
0
votes
0answers
94 views

Step by step smartcontract debugging with truffle or brownie

I am writing smart-contracts with Vyper/Brownie or Solidity/Truffle. In order to debug and test my smartcontracts, i want to execute them step by step. Is there a way to do that exactly like we debug ...
0
votes
1answer
48 views

I want to understand something with BigNumber assertions

I have create a truffle project with a smartcontract and a test file. Here is an extract of the test file: expect(ret).to.be.bignumber.equal(new BN('42')); ret is a value returned by a smartcontract'...
0
votes
1answer
32 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 ...
0
votes
0answers
12 views

Automated tests with brownie - how to handle “base fee exceeds gas limit”

I have wrote this very basic test scenario with brownie: import pytest def test_set_get_18(tcontrat1,accounts): tcontrat1.set(18, {'from': accounts[0],'gas_limit':100}) assert tcontrat1.get() ...
0
votes
1answer
77 views

Limit gas in brownie automated tests

I have create a brownie project with automated tests according to this documentation: https://vyper.readthedocs.io/en/stable/testing-contracts-brownie.html#writing-a-basic-test Here is an example: def ...
2
votes
0answers
251 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/...
1
vote
1answer
97 views

How to get the return value of a transaction instead of the transaction receipt in brownie

I have a function in my smart contract called getRandomNumer, and it returns a bytes32. However, in brownie, when I make a transaction it returns the transaction receipt. How do I get the return value?...
2
votes
1answer
134 views

Deploy to testnet with brownie

I'm looking to deploy some code to the kovan testnet with Brownie. However I keep getting an error accessing accounts. Here is the command I'm running: brownie run scripts/deploy_price_consumer_v3.py -...
1
vote
1answer
89 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 ...
2
votes
1answer
334 views

Which ethereum framework to choose Traffle vs Brownie?

I know that the most used frmaework for smart contract testing deployment etc is Traffle. But, since I am not very good at javascript (i am mainly coding in python)- I saw there is an option to use ...
0
votes
2answers
296 views

Brownie some contracts cannot be tested on mainnet fork

I am testing on mainnet-fork and it always fails when particular contracts like (Uniswap) are called more than once. Is there any fix for this or is this problem outside the scope of brownie? Thanks ...
2
votes
0answers
71 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 ?
1
vote
0answers
21 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 ...
3
votes
1answer
48 views

What is the purpose of a `// dev:` comment after a revert or require statement?

What does it mean when a Solidity contract includes a comment starting with // dev: after a revert or require statement? For example: contract Example { function greet(){ revert(); // ...
5
votes
1answer
180 views

How to catch a `revert()` error using Brownie?

I am using Brownie to develop my smart contracts, which helps me to intract with the smart contracts, please see doc. When my call Example.greet() is there any way to return the error message and act ...
3
votes
1answer
272 views

Brownie cannot install solc on OSX

Follow the procedures on this page brownie : create new project and compile with brownie. Encounter the following error, please comment how to fix it. Configuration and environment. Python 3.7.7 ...
3
votes
1answer
54 views

Brownie: Hypothesis given() is not resetting chain for each function call

I have the following test code snippet in my brownie project: from hypothesis import settings, given, strategies as st from brownie import * import brownie st_buy_amount_eth = st.integers(min_value=...
5
votes
1answer
679 views

How to deploy Ethereum Smart Contract through Brownie to the Private Network

I have a geth node that is connected to a private network on my computer that uses port: 8545. Hence, I have a smart contract that is tested using Brownie on the ganache-cli network. Brownie is a ...