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
1 answer
8 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/...
0 votes
1 answer
18 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 ...
0 votes
1 answer
15 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 ...
0 votes
1 answer
8 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 ...
0 votes
1 answer
55 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 ...
  • 115
0 votes
0 answers
23 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 ...
1 vote
1 answer
18 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':...
  • 121
0 votes
0 answers
24 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....
0 votes
1 answer
35 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 = '...
0 votes
3 answers
68 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] ...
  • 21
1 vote
0 answers
59 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. ...
0 votes
0 answers
21 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, ...
  • 187
1 vote
0 answers
42 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 ...
0 votes
1 answer
21 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 ...
0 votes
1 answer
77 views

Transaction is getting reverted in the `refundToInsurer()` function call

The deployment of InsuranceProvider is working fine and the calling of newContract() with the required parameters is successfully creating/deploying the InsuranceConsumer contract. Even, the ...
0 votes
1 answer
18 views

Live testing so annoying and time-consuming

After days of unit local testing i begin testing on testnet, and it turns that i have some errors that appear from nowhere, to fix those errors i need to redeploy all the contracts and arrange all the ...
  • 187
0 votes
1 answer
66 views

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

I'm trying to compile a "FundMe.sol" contract: the issue is that when I try to compile it I keep getting the following Compiler Error: Brownie v1.19.2 - Python development framework for ...
0 votes
1 answer
182 views

Contract verification Failed

I have two contracts Pool and PoolConfiguration, when deploying them to goerli test they both deploy successfully but when verifying on etherscan PoolConfiguration fail to verify and drops this error :...
  • 187
0 votes
1 answer
43 views

Check if contract already deployed in Brownie

im writing a script in python and brownie to deploy my smart contract to a testnet but i want to set an if statement for not deploying the smart contract if its already deployed . I know that deployed ...
  • 187
0 votes
0 answers
21 views

Error while running slither

Getting this error : UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 11: invalid start byte while running slither . on the root of my brownie project . have someone faced this ...
  • 187
1 vote
0 answers
49 views

Brownie as a package in Flask project

I have a Flask project and a brownie project with a small smartcontract. Now I want to integrate my smartcontract functionality into my Flask app. But, I used to run brownie by: brownie run scripts/...
0 votes
0 answers
87 views

Transaction reverted while depositing WETH on aave v2 lending pool on goerli testnet

while I am trying to use deposit() function from Aave v2 lending pool on goerli testnet, to deposit WETH token to the lending pool, the transaction is getting reverted and the error is following: ...
1 vote
0 answers
23 views

test_can_withdraw() not working in Brownie

Struggling with testing my withdraw function in a Solidity smart-contract via Brownie: My withdrawing function is the following but in Remix it definitely works and I have tested _owner.send() and ...
2 votes
0 answers
27 views

Reverting blockchain state after each test (Hardhhat isolation Fixture)

When writing smart contract tests in python (using Brownie). I extensively used isolation fixture. This allowed me to isolate test cases from each other. Example: We have TokenContract, which upon ...
  • 1,819
0 votes
1 answer
20 views

Error when calling already deployed contract: AttributeError: Final argument must be a dict of transaction parameters that includes a `from` field

I'm trying to create a contract that communicates with JIRA API through Chainlink Oracle on the Goerli Network. The interaction should create a JIRA project, then write some of the returned JSON's ...
1 vote
1 answer
263 views

Error Installing ETH Brownie

So I get a error for each of the 3 different processes when I attempt to install eth-brownie on my Mac OS... With "pip install eth-brownie", I get the error fatal error: too many ...
1 vote
1 answer
37 views

In Brownie test, how to call contract's __default__() method?

I have a contract Foo with a __default__() method. I have another contract Bar that invokes Foo's __default__() method when it calls send(foo.address, 1). When running Brownie tests, with both Foo ...
  • 174
0 votes
2 answers
29 views

is it possible to deposit Avax into brownie generated account? [brownie]

I like to ask if I generate a new account in brownie, can I deposit avax into it? I am wondering because many platforms warn about sending coins to the wrong type of address. I understand I can ...
0 votes
0 answers
20 views

How do you recompile a contract while in brownie console?

Lets say I make a change to a solidity contract while in the brownie console. How do I get these changes to reflect in the brownie console?
0 votes
1 answer
169 views

ERC20: insufficient allowance error after using approve function while testing Vesting Vault fund function [Brownie]

I made a vesting vault with one beneficiary set on construction and a one time fund function which can be only called by the owner. The fund function funds the contract with ERC-20 tokens and sets an ...
  • 1
0 votes
1 answer
118 views

Brownie not reading Account Private key from cinfiguration file

I am using brownie to deploy the mart contract. But the brownie configuration file details is not accessing in deployment.py brownie-config.yaml project_structure: build: build contracts: ...
0 votes
0 answers
62 views

call payable function inside contract constructor

CONTEXT I am trying to create and add liquidity to a pool inside the contract constructor CODE // SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/contracts/utils/...
0 votes
0 answers
112 views

Adding liquidity to newly created pool fails

Context I am trying to build a smart contract of a ERC20 token which comprehends the creation of the relative WETH/token pair on Uniswap V2. Code The smart contract is as follow: // SPDX-License-...
0 votes
0 answers
55 views

Passing an array of string from Brownie Python deployment script to Smart contract

I am using brownie python script to interact with smart contract. In the smart contract there is a function which accepts string array as argument like below function Multiple(string[] memory my_ids) ...
1 vote
1 answer
51 views

How to handle two solidity events with asyncio python

Im trying to get every Swap event happens on Uniswap and Sushiswap using python and do stuff based on these Swaps i know how to do it but with one exchange, it means that only one event in time . from ...
  • 187
0 votes
1 answer
204 views

UniswapV2Router02 swapExactTokensForTokens deadline

im trying to swap some DAI with USDC Using UniswapV2Router02 function swapExactTokensForTokens() with brownie and python by unlocking a DAI token holder account and im getting this error : ...
  • 187
0 votes
0 answers
61 views

How to dump/access contract storage in Brownie console?

In Brownie console, for a deployed contract, public contract attributes can be accessed with contract.nameOfAttribute(). This does not work for private attributes - how can one access private ...
0 votes
1 answer
71 views

Accessing private data on a blockchain address using Brownie

I'm trying to practice on the private data exploit on ethereum and was wondering if there is a function like web3.eth.getStorageAt() implemented in brownie which would allow me to access the storage ...
  • 17
0 votes
0 answers
204 views

Flashloan with DyDx on mainnet-fork

I forked the Ethereum mainnet with the ganache-cli using this command below : ganache-cli -f https://eth-mainnet.g.alchemy.com/v2/GsxpURWipc2UTubeBm3Mf-WdEyioVdwV -u ...
  • 187
0 votes
0 answers
62 views

error: "VirtualMachineError: revert"

I am watching free codecamp's blockchain course by PatrickAlphaC. In the lottery lesson I have this problem: in the lottery.sol file I use AggregatorV3Interface to get eth/usd price and use it to ...
0 votes
2 answers
236 views

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

I am working with the tutorial by freecodecamp.org and have the following error: ImportError: cannot import name 'LinkToken' from 'brownie It is also not able to import VRFCoordinatorMock which I am ...
0 votes
2 answers
138 views

Development Network - Multiple Transactions Same Block - Brownie

I'm trying to setup a test, where multiple transactions interacting with a contract are mined in the same block (from different accounts). However, the default behavior is to mine a block at each ...
0 votes
0 answers
30 views

eth-brownie: swapAVAXForExactTokens fail to perform a basic swap

I wrote a simple python program whose aim is to swap the native token of the underlying chain, e.g., ETH, AVAX, for other tokens. In this case, my account holds 5+ AVAX and I am trying to do the ...
0 votes
0 answers
58 views

How do we get to know the gas fee of a transaction on Ethereum Blockchain with Brownie

I was recently searching for a way using which I can calculate the gas fee for a transaction in Brownie Ethereum development environment.
0 votes
1 answer
64 views

Can't seem to filter uniswap transactions?

The following code doesn't print any transactions. What am I missing? def main(): uni_v3_router = Web3.toChecksumAddress('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45') event_filter = w3.eth.filter({...
0 votes
0 answers
30 views

See Balances on mainnet-fork?

I'm currently watching my first smart contracts tutorial by freecodecamp and it works fine but, I have one question: How can I check the balance of my mainnet-fork account(s)? When I work with Rinkeby ...
0 votes
0 answers
12 views

can we use brownie and solidity together, like for framework brownie and for smart contract solidity

I have to create an application using blockchain so while deciding on the tool I got this doubt
0 votes
0 answers
14 views

How to utilize brownie given-strategy testing function. As the website coding specs, it throws error

Here is my example code, but the pytest.mark.parametrize works well. And the given strategy emits error hereinafter.
0 votes
1 answer
28 views

How to link deployed library to contract in brownie?

As far as I know, brownie automatically links the library to contract. Is there a way to do this manually? I have bunch of contracts in different projects where some use library and some don't. So I ...
  • 1,306
1 vote
1 answer
138 views

How to calculate AAVE yield on chain

I’m working on a project which involves tracking and withdrawing AAVE yield on chain while maintaining the original deposit balance. I’m confused as to how to accurately calculate AAVE yield at a ...
  • 13

1
2 3 4 5
8