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
0 answers
7 views

Please Help ValueError: execution reverted: VM Exception while processing transaction: revert

Hi am learning brownie fundme What I tried to do here, is use brownie to deploy a contract(FundMe) using ganache-local then after running (deploy.py),i write a new script fund_and_withdraw.py i got ...
user avatar
0 votes
0 answers
18 views

ValueError: The private key must be exactly 32 bytes long, instead of 32 bytes

I am trying to run a brownie script in Visual Studio Code on a git bash terminal, I have set up environment variables WEB3_INFURA_PROJECT_ID and PRIVATE_KEY. within a .env file When I run my code I ...
user avatar
0 votes
0 answers
17 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 ...
user avatar
  • 1
1 vote
0 answers
4 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 ...
user avatar
0 votes
0 answers
11 views

browni and flask, how to do interact with smart contract in an api?

I have a project that I have developed with brownie and it works in cli mode. But now I want to set restful api and give API. for example I have a python file like this : from brownie import accounts,...
user avatar
0 votes
1 answer
12 views

Brownie Reverting Transactions With No Description Of Error

Getting error on add liquidity function with no description of the error. Error: CSAMM.addLiquidity 0:334 [476 / 29510689 gas] │ └── ERC201.transferFrom [CALL] 123:322 [29510213 gas] ├─...
user avatar
0 votes
1 answer
12 views

Same solidity contract compiles in Remix but not using brownie: "TypeError: '<' not supported between instances of 'str' and 'NoneType' "

I am new to solidity coding and have been practicing with some basic contracts. I've made a contract HotelRoom.sol which compiles and runs as intended in Remix, but when attempting to run 'brownie ...
user avatar
0 votes
0 answers
6 views

Brownie Stateful Testing

I currently decided to up my test game by going into property based tests and stateful tests on brownie using hypothesis and state machines. In the brownie documentation on stateful tests. In the ...
user avatar
0 votes
0 answers
5 views

What value does brownie hash for an empty contract?

I am trying to pinpoint what exactly is getting hashed when deploying a contract with no functions or any explicitly defined constructor. My contract is Hash.sol: pragma solidity ^0.8.0; contract ...
user avatar
0 votes
1 answer
21 views

How to access Struct values of Array invoked from solidity file on python brownie?

I look for a way to iterate struct values of Array that is returned from calling method of solidity file on eth-brownie python file. As I do some research on several topics asked on https://ethereum....
user avatar
0 votes
0 answers
17 views

Why is the eth/usd contract not marked as a valid ETH address ? I get a Value error constructor when I try to run deploy script on mainnet-fork

I am following Patrick Alpha's brownie tutorial using python visual studio: https://www.youtube.com/watch?v=M576WGiDBdQ (at around the 5:57 mark). I am using brownie and am trying to run my python ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
0 votes
0 answers
14 views

transferFrom doesn't emit an event

I use OpenZeppelin ERC20 contract and want to emit event when transferFrom is called. import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract TST is ERC20 { event diff(string ...
user avatar
  • 925
2 votes
0 answers
40 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 ...
user avatar
0 votes
1 answer
48 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&...
user avatar
  • 11
0 votes
0 answers
15 views

Brownie seems to revert the effect of some transactions while testing

I am currently testing an ERC721 smart contract with brownie, and I am implementing a stateful test for it. The structure is: def setup(self): self.balance = {i: 0 for i in self.accounts} ...
user avatar
0 votes
0 answers
3 views

What are the node providers for Genosis Network (xDai)?

Which node provider can be used to fork Genosis Network (xDai) using brownie? Alchemy, infura and moralis does not provide service. I tried getBlock but doesn't work at all.
user avatar
  • 925
0 votes
2 answers
29 views

insufficient gas funds error on rinkeby infura using brownie

I have sufficient ether in my testnet account but still the code is showing error. What to do next? I have attached multiple screenshots of my code and metamask rinkeby wallet.. Kindly guide me enter ...
user avatar
0 votes
0 answers
18 views

Running into and issue trying to deploy first smart contract with brownie & chainlink

I am trying to use brownie to learn how to deploy smart contracts and I get to the part on Chainlinks website where I type in brownie run scripts/price_feed_scripts/deploy_price_consumer_v3.py --...
user avatar
  • 1
0 votes
0 answers
60 views

Mocking and testing UniswapV2's swapExactETHForTokens in brownie: VirtualMachineError: revert: Index out of range

I'm at a loss with one particular brownie test I wrote, that relies on a mock I've written for Uniswap V2's swapExactETHForTokens, the code of which can be found below: In MockUniswapV2.sol: import &...
user avatar
  • 1
0 votes
0 answers
29 views

Brownie unable to compile contracts on Apple M1 Mac

I recently got an M1 mac and I'm trying to compile my brownie project's contracts which compiled fine on my previous machine. I've installed Brownie v1.18.2 and when attempting to run brownie compile ...
user avatar
  • 230
0 votes
0 answers
6 views

Increase block size in BROWNIE

Brownie, by default, mines new block per tx. How to increae block size in brownie so it doesnt keep mining block?
user avatar
  • 925
0 votes
1 answer
47 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 ...
user avatar
0 votes
0 answers
68 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 ...
user avatar
0 votes
0 answers
26 views

Cannot deploy to Swimmer Subnet (AVAX)

I have been trying to deploy a smart contract to the new AVAX Swimmer subnet. Its just stuck on the initial run, and does not seem to generate a transaction: pls see screenshot I added the Subnet ...
user avatar
  • 21
0 votes
1 answer
36 views

Add a 'from' account to hardhat transaction calls

I recently started learning to use hardhat to interact with and deploy smart contracts and I noticed that while brownie can accept a from address field for chain transactions, hardhat doesn't. Does ...
user avatar
0 votes
1 answer
29 views

How to skip blocks on forked mainnet using Brownie

When working on a forked mainnet, you can use the openzeppelin testnet helper called advanceBlockTo to skip x amount of blocks (Forces a block to be mined, incrementing the block height). However, ...
user avatar
  • 925
0 votes
2 answers
86 views

Deploy SmartContract to local Hyperledger-Besu network using Brownie

EDIT: In short, I want to use Brownie to deploy smartContracts to HyperLedger-Besu network on my local machine. For some reason, it doesn't work, so I wanted to ask if anyone here had experience with ...
user avatar
  • 636
1 vote
0 answers
11 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 "...
user avatar
0 votes
1 answer
39 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 ...
user avatar
0 votes
0 answers
24 views

How to get the minimum and maximum int value from web3.py?

I'm developing in brownie and would like to pass the max/min int{n} where n = i*8 and 1 < i < 32 to my function calls. How do I get those values using web3 or another python library that is ...
user avatar
  • 230
0 votes
0 answers
20 views

Unlock account from forked network

I know we can pass --unlock tag to truffle but how do we do the same thing with brownie? It doesn't let me unlock an account when I try to add network. This command fails: brownie networks add ...
user avatar
  • 925
0 votes
1 answer
92 views

Having trouble executing swapExactTokensForTokens on a uniswap contract?

I am attempting to use brownie to execute a swap on Quickswap. But I keep getting a Dai/insufficient-balance error. Here is the traceback for the tx: https://dashboard.tenderly.co/tx/mumbai/...
user avatar
0 votes
1 answer
37 views

Cannot install brownie with pipx

I struggle to install brownie it is impossible to do so even with the command line pipx install eth-brownie. It prints me this error, however I have nothing to to with it because it's an automatic ...
user avatar
  • 1
1 vote
2 answers
114 views

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

I am learning Solidity at the moment and I am facing an error when trying to use MockV3Aggregator: ImportError: cannot import name 'MockV3Aggregator' from 'brownie' Here is my bronwie-config.yaml: ...
user avatar
  • 113
0 votes
0 answers
69 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. ...
user avatar
0 votes
0 answers
16 views

aave v3 Pool decimals

I'm trying to get the user data from an aave v3 contract and I'm very confused by the number of decimals, or better I cannot find the number of decimals with which the collateral, borrowable and debt ...
user avatar
  • 11
0 votes
0 answers
25 views

How to get smart contract attributes by some block in mainnet?

I want to track some smart contract's attributes in the neighbouring blocks in mainnet. I know hash of the contract and hash of the 'starting' block. I use brownie. How can I get attributes of the ...
user avatar
0 votes
1 answer
99 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/...
user avatar
  • 11
0 votes
0 answers
31 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 ...
user avatar
0 votes
1 answer
35 views

How do I deploy a contract with payable constructor with Brownie python

I have a constructor in my Smart Contract: constructor() payable { require(msg.value >= 100000000 gwei, "Min == 0.1ETH"); require(msg.value <= 500000000 gwei, "Max == 0....
user avatar
0 votes
1 answer
137 views

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

I'm trying to deploy an interface from Chainlink and I have in my solidity contract the import for the AggregatorV3Interface: pragma solidity 0.6.6; import "@chainlink/contracts/src/v0.6/...
user avatar
  • 11
0 votes
1 answer
48 views

unbale to import smart contract into brownie scripts

I was trying to run a deploy script with brownie but i couldnt import required .sol smartContract into my scripts This is my folder structure My code in deploy.py from brownie import Fundme, accounts,...
user avatar
0 votes
1 answer
98 views

How to access Struct values in brownie

//transaction struct of what a tx should have struct Transaction{ address to; uint value; bool executed; uint numConfirmations; mapping(address => bool) isConfirmed; mapping(...
user avatar
0 votes
1 answer
152 views

abi.encode() in Python

I am working with brownie and I need to find a way to do what abi.encode() does in Python. Here is a contract: function fundSubscription(address _linkAddress,bytes calldata _data) { // _data needs ...
user avatar
0 votes
1 answer
48 views

Getting " Gas estimation failed" error for pet project - "smart_lottery_contract" project

I am new to blockchain and I am following the tutorial by Patrick based on the project I have my code here at :https://github.com/shashankvivek/blockchain/tree/main/smartLottery_contract_revisited ...
user avatar
0 votes
0 answers
25 views

How to get an old transaction from brownie

I'm new at brownie and got stuck with this doubt. Is there any way to call an old tx and get the event? I'm working on a testnet and ganache-local. Example: tx = contract.createCollectible({"from&...
user avatar
0 votes
1 answer
76 views

"codec can't encode character" error when I run "pipx install eth-brownie"

When I ran "pipx install eth-brownie", I got this error. Error: Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264....
user avatar
0 votes
0 answers
47 views

Approve and dis-approve ownership of erc721 tokens

I have created a contract which takes care of buy and sell of NFT's or ERC721 tokens. So i have approved the contract to sell the NFT. Now my questions are:- Once I have transferred the contract to a ...
user avatar
0 votes
0 answers
37 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. ...
user avatar

1
2 3 4 5
7