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
18 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 ...
Aria's user avatar
  • 11
0 votes
1 answer
31 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 ...
Salaudeen Sulaimon's user avatar
0 votes
0 answers
63 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 ...
Javier C Salaverri's user avatar
0 votes
0 answers
11 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\...
Abc def's user avatar
1 vote
0 answers
11 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 ...
Lalo's user avatar
  • 11
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 ...
Obanla Andrew's user avatar
0 votes
0 answers
20 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" >>>...
Saikat Karmakar's user avatar
0 votes
1 answer
16 views

How to change response from oracle?

I need to test my contract, and to test I need to change data that I recieve from ChainLink Oracle (I get Ethereum price from it). So how can I change price on ETH local for tests using Ganache-Cli or ...
0 x's user avatar
  • 1
0 votes
0 answers
37 views

Mainnet-fork has different result than mainnet

I'm currently forking Binance Smart Chain using Brownie and Python. The idea is to use the forked network to test if new BEP20 tokens can be traded (buy and sell) using pancakeswap, and check if the ...
BJ2M's user avatar
  • 11
0 votes
0 answers
17 views

ImportError - Python script in Brownie when file is definitely there

I'm writing a script in Python to deploy the smart contract lottery (from the older Brownie/Python course from freecodecamp). I am only trying to deploy on development, so I have saved all the ...
user127148's user avatar
0 votes
1 answer
190 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 ...
user127148's user avatar
0 votes
0 answers
14 views

Is there a way to update block to `latest` in case of a network forked by brownie?

I plan on something such as this: Fork the network as fork-network chain.snapshot() Perform tests chain.revert() Update the network to latest state because my next tests will require data from newer ...
aste123's user avatar
  • 233
0 votes
1 answer
83 views

Having problems installing Brownie

I have been struggling installing brownie for while now and i cant seem to figure it out. I am quite new to all of this so all help is appreciated:) Running python 3.9.11. Using a an m2 mac with ...
Sigve Lunde Soldal's user avatar
1 vote
1 answer
17 views

brownie test results in ValueError: sender account not recognized

I am trying to run curve finance's multi-rewards test suite with brownie test, however, the tests fail with the following error: accounts = <brownie.network.account.Accounts object at 0x103e0caf0&...
MShakeG's user avatar
  • 1,613
0 votes
0 answers
11 views

Brownie Contract creation takes too long

The function Contract.from_abi in brownie is taking too much time, even after disabling bytecode check with a dirty hack. How can one use Brownie in a meaningful way for a project that loads thousands ...
miskin's user avatar
  • 21
0 votes
1 answer
483 views

How to call `quoteExactInputSingle` on quoter2 uniswap using python

I'm trying to call like this in ape def SushiswapV3quoteExactInputSingleV3( router, _from, tokenIn: str, tokenOut: str, fee: int, amountIn: int, sqrtPriceLimitX96: int = 0, ...
Saikat Karmakar's user avatar
1 vote
0 answers
71 views

How can we get the result of swap in curve.fi like `getAmountsOut` for uniswapV2

I'm trying to get the price for the swap WETH->DAI by calling get_dy but there is no direct pool in curve. I went to the UI & put in this swap & got this. tricypto: WETH -> USDT -> ...
Saikat Karmakar's user avatar
1 vote
0 answers
765 views

has anyone seen this error installing brownie?

Banging my head against a wall trying this. have tried uninstalling cytoolz, pipx, and reinstalling but keep getting this error trying to install brownie. Collecting click==8.1.3 (from eth-brownie) ...
Kyle5349's user avatar
1 vote
3 answers
215 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 "...
Kumo's user avatar
  • 11
0 votes
0 answers
11 views

gas estimation fail when call addLiquidity from UniswapV2Router02.sol contract [duplicate]

I am trying to deploy uniswap V2 contracts using brownie but I have always an error when I call addLiquidity on UniswapV2Router02.sol Waht I did so far: 1.- Deploy UniswapV2Factory.sol def ...
Agustin Gonzalez Ribas's user avatar
1 vote
0 answers
16 views

Vyper: How to test internal helper functions?

I'm writing a Roulette contract as a learning activity in Vyper. My contract seems to be working through manual testing, and now I'm starting to write unit tests. I have an internal helper function ...
JoshOrndorff's user avatar
0 votes
0 answers
10 views

Does Brownie support structs and enums?

Brownie is a seemingly popular framework for testing smart contracts (both solidity and vyper) in python. I've just gotten started with brownie and my first few tests are working. However, I can't ...
JoshOrndorff's user avatar
0 votes
1 answer
143 views

Brownie Explorer API not set for this network

I am trying to deploy a solidity contract with the source code to a Sepolia test net, using Brownie. The contract deploys successfully, but the source code does not. I keep getting this error. File &...
Vladimir Yaremchuk's user avatar
1 vote
1 answer
29 views

Call fundSubcription() chain link vrf v2 using brownie gas fee error?

def addCustomerAndFundsub(_subId, _cunsumerContract): account = get_account() if network.show_active() in LOCAL_BLOCKCHIAN_ENVIROMENTS: VRF_contract = VRFCoordinatorV2Mock[-1] else:...
Rhaegar's user avatar
  • 31
1 vote
2 answers
57 views

eth_rlp: AttributeError: module 'rlp' has no attribute 'Serializable'

Brownie won't initialise. Even after clearing paths, pipx, installing new versions.
kanv gupta's user avatar
0 votes
0 answers
51 views

how to estimate gas usage of a view function?

according to this question gas limit of eth_call depends on the node that you use, but still I wanted to have an estimate that how much gas that it use for my view function eth_call to be on safer ...
sciNFTist.eth's user avatar
0 votes
1 answer
38 views

Listening to events using EventWatcher

I am trying to listen to events emitted from a contract using eth-brownie. More specifically I am attempting to use EventWatcher. My contract emit has an event eventI in it. My run.py file looks like, ...
wayne 's user avatar
0 votes
0 answers
11 views

Brownie map.json is empty need to restore it

My map.json got corrupted and i had build folder not in sync with github. Is there a way to recreate the map.json for an already deployed contract? File "brownie/_cli/__main__.py", line 64, ...
Christs's user avatar
0 votes
1 answer
112 views

What version of web3py does ApeWorX support and does it also support account impersonation (unlock account) without needing the private key?

What is the most recent web3py version that ApeWorX supports? I need to have support for unlocking random eth accounts on a local test network (ex: http localhost 8545) through something like hardhat (...
josjunior's user avatar
0 votes
1 answer
39 views

Brownie not returning Mapping Values

Good day to everyone, I've been working with brownie for sometime now and have been running into a lot of challenges. I created a struct basically and a mapping to that struct, however when I deploy ...
Tolu's user avatar
  • 3
0 votes
2 answers
220 views

Does eth-brownie require using web3py below version 6?

I need to use the Async features found in web3py 6+ as the features I need are not in pre v6 web3py. I manage my env's using anaconda, but eth-brownie is not available via anaconda to my knowledge ...
josjunior's user avatar
0 votes
0 answers
134 views

Sepolia Unauthorized URL

Good day, Ive constantly been getting errors while working with Sepolia Test Eth with Brownie, I've checked for errors in my .envfile as well as in my brownie-config and still havent seen a ny issues, ...
Tolu's user avatar
  • 3
0 votes
0 answers
55 views

What is the equivalent of Brownie's (Pytest) "Contract.from_abi()" in Foundry test?

There is a test that uses brownie (pytest) where it creates a new contract using two contracts' abi: Contract.from_abi("mock", mock.address, Contract1.abi + Contract2.abi, owner=accounts[0]) ...
Kemmgl's user avatar
  • 1
0 votes
0 answers
57 views

Dependency Conflict Between Slither And Brownie

I have encountered strange issue and I'm not sure how can I fix it permanently. I had brownie (similar to hardhat) tool installed and once I have installed slither those 2 seems to have some conflicts,...
Neftyr's user avatar
  • 3
0 votes
0 answers
54 views

Callable: Caller is not the owner (onlyOwner protected function call fails on upgradable contract)

I follow this https://github.com/brownie-mix/upgrades-mix repository to create transparent upgradable contract. It worked fine. Then I edited my contract and restricted some of the functions to ...
Yalchin403's user avatar
0 votes
0 answers
22 views

How do I turn off the "Transaction Sent" logging on Brownie?

Everytime I send a transaction via Brownie, it prints a "Transaction sent" log. Is there any way to turn this off?
user120422's user avatar
0 votes
0 answers
75 views

ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert

Im building an DEFIAPP (AAVE)V3 I do have enough eth function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external Added settings: gas_limit: "100000000000&...
Salma Sameer's user avatar
0 votes
1 answer
235 views

Send bytes32 data to a smart contract using python

How to send data to a function which takes bytes32 as the input parameter.
Saikat Karmakar's user avatar
1 vote
0 answers
326 views

How to find the Bytecode of Ethereum Smart Contract by just it's address

Hi actually I found the answer & I just wanted to share this with the community You can use the web3.py or brownie module of Python to achieve this web3.py from web3 import Web3 # Connect to ...
Saikat Karmakar's user avatar
2 votes
0 answers
178 views

Using Brownie to verify contract error

I added sepolia with my infura api key to deploy my contract it works fine. Until I try to verify my contract with publish_source=True in FundMe.deploy function: from brownie import FundMe from ...
Rhaegar's user avatar
  • 31
4 votes
1 answer
555 views

Cannot install eth-brownie with pipx

I have an MacBook Air M2 with python version 3.11.2 I am getting this error message when I follow the pipx instructions to install brownie I tried using pip to install each of these packages ...
Kate Johnson's user avatar
2 votes
1 answer
88 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 ...
B S's user avatar
  • 21
0 votes
1 answer
38 views

return from none view function a transaction id rather than the result data

Using Brownie, Python in VSCode: I am trying to combine getNumbers and findNumbers into findNumbers2. But findNumbers2 returned a transaction id rather than the result data. Any suggestions? Solidity ...
EmilyJ's user avatar
  • 147
1 vote
1 answer
39 views

Having A problem with file directory

I want to verify the contract using the API etherscan token FundMe.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import"node_modules/@chainlink/contracts/src/v0.8/interfaces/...
Salma Sameer's user avatar
0 votes
1 answer
64 views

Problem with brownie

when deploying the contract it gives me <function deploy_simple_storage at 0x0000021D6E255670> What does that mean? Deploy.py from brownie import accounts,config,SimpleStorage def ...
Salma Sameer's user avatar
1 vote
1 answer
125 views

Member "swapExactTokensForTokens" not found or not visible - Solidity trading bot

I've been working on a arbitrage solidity bot on Uni- and SushiSwap and I have a strange error: TypeError: Member "swapExactTokensForTokens" not found or not visible after argument-dependent ...
Christopherus's user avatar
0 votes
1 answer
25 views

$ brownie compile ; not recieving .json in /build/contracts

Im having an issue compiling my first contract with brownie. I run the following. mkdir brownie cd brownie brownie init touch contracts/SimpleStorage.sol Contents of SimpleStorage.sol pragma ...
Timothy Carter's user avatar
1 vote
6 answers
1k views

Infura network support for sepollia in Brownie

I have been trying to get testnet LINK for Goerli from chain.link. But it looks like it is no longer providing that for Goerli but Sepolia only. I am using the latest version of Brownie and it only ...
EmilyJ's user avatar
  • 147
2 votes
0 answers
99 views

Use Brownie to send ERC20 tokens to a payable function with the amount of tokens as an argument to the function

I have the following AlgoToken contract: interface StableCoin { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external ...
Steven Hochstadt's user avatar
1 vote
1 answer
42 views

Deploying Contracts Deterministically using Brownie Console

I am trying to deploy contracts determinsitically using 'salt' via brownie. I would like to be able to do something like this: >>> helloContract = Hello.deploy({'from':accounts[0],'salt':...
TS_101's user avatar
  • 141

1
2 3 4 5
8