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
0 answers
11 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\...
Udayarajan gauthaman's user avatar
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 ...
Aria's user avatar
  • 11
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 ...
Salaudeen Sulaimon's user avatar
0 votes
0 answers
80 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
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\...
Abc def's user avatar
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 ...
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
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" >>>...
Saikat Karmakar's user avatar
0 votes
1 answer
17 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
40 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
351 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
15 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
88 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
19 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,735
0 votes
0 answers
12 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
668 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
74 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
831 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
344 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
1 vote
0 answers
20 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
1 answer
179 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
31 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
63 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
1 answer
52 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
1 answer
129 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
40 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
242 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
150 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
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
1 answer
300 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
385 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
202 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
586 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
94 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
40 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
42 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
67 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
135 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
27 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
113 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
44 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
0 votes
0 answers
204 views

ValueError: Gas estimation failed: 'execution reverted'. Gaslimit already set

I'm getting this error when I try to run my Brownie Python script: myAwesomeGasLimit = 200000 def enter_for_free(): account = get_account() lottery = Lottery[-1] tx = lottery....
Christopherus's user avatar
0 votes
1 answer
87 views

PancakeSwap Error with Brownie, revert: TransferHelper::transferFrom: transferFrom failed

I am in bsc-testnet and have 0.3 WBNB in my wallet and I try to swap 0.1 WBNB for USDT with the function swapExactTokensForTokens() Token1 = '0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd' Token2 = '...
Emericdt's user avatar
0 votes
3 answers
278 views

Brownie private keys

Brownie under the hood use Ganache. Ones we start brownie console accounts are generate automatically (10 by default) for further use. Question: is there a way to discover private key from account[0] ...
Ilija's user avatar
  • 41
2 votes
1 answer
470 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. ...
aliercanozgokce's user avatar
1 vote
0 answers
73 views

test transaction call brownie

in brownie, i have a function that calls another one in the same contract, and i want to test if it does it properly : The function : function onTokenTransfer( address _sender, uint256 _fee, ...
noro meb's user avatar
  • 368
2 votes
0 answers
147 views

Is it possible to get the raw transaction hex of the entire transaction in Brownie?

I am creating unit tests for a smart contract that I am working on using Brownie and pytest. In one of the functions, I need to pass the raw transaction hex of an entire Ethereum transaction (not just ...
Jdawg287's user avatar
0 votes
1 answer
48 views

Brownie Smart Contract Function how to understand parameters

From the smark contract to get WETH from ETH on this link https://goerli.etherscan.io/address/0xccb14936c2e000ed8393a571d15a2672537838ad#writeContract To make the deposit function work I have to code ...
Emericdt's user avatar

1
2 3 4 5
8