Questions tagged [web3py]

Web3.py is a library for interacting with EVM based blockchains and smart contracts in Python.

For more information see Web3.py documentation.

Web3.py is maintained by Ethereum Foundation.

578 questions
1
vote
0 answers

How to decode data from uniswap transaction in python

I am getting stuck decoding data transaction from a swap using uniswap protocol (Uniswap V3: Router 2 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45). In other words, I'd like to know if it exists a function that given a smart contract address and the…
evan
  • 11
  • 2
1
vote
1 answer

in web3py, any function to call static?

I want to use Uniswap V3 Quoter function, but it's a write function. I have to call static to avoid gas cost. I don't see any static call in web3py documentation. Any suggestion? Thanks ahead!
1
vote
0 answers

Decode Result From JSON-RPC eth_call to a Smart Contract

I would like to know if web3py or another package has a function to decode the result you get when you send a call to a smart contract. Something similar to decode_function_input or abi.decodeParameters. I know that doing…
1
vote
0 answers

yte indices must be integers or slices, not str

I'm experiencing some issues with web3 in Python. The line : if tx['from'] not in ws['A']: in this code: for tx in transactions: if tx['from'] not in ws['A']: contract = w3.eth.contract(address=tx['to'], abi=CONTRACT_ABI) …
muttynhg
  • 11
  • 1
1
vote
2 answers

Web3 python crypto cypher issue on M1 Mac

When I try to build a blockchain transaction using Web3 on python, I'm getting an error that is apparently because I'm using an Apple Silicon computer (2020 M1 MacBook Pro). I'm following a popular Solidity, Blockchain, and Smart Contract course on…
Leon KC
  • 31
  • 9
1
vote
1 answer

Web3 ExtraDataLength Error on Optimism using python

ERROR - The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is:…
ALBERT V
  • 11
  • 1
1
vote
1 answer

How can I fix Thirdweb Goerli Testnet HTTP Error 429?

I'm minting the NFT with the Python SDK of Thirdweb using Goerli TestNet. Code : sdk = ThirdwebSDK.from_private_key(PRIVATE_KEY, NETWORK) NFT_COLLECTION_ADDRESS = contratonft nft_collection =…
1
vote
1 answer

decoding uniswap event data in python with ABI?

I started two days ago with ethereum blockchain, so my knowledge is still a little bit all over the place. Nevertheless, i managed to connect to a node, pull some general block data and so on. As a next level of difficulty, I tried to start building…
1
vote
1 answer

Pass tuple parameters to smart contracts using web3.py

I am using web3.py to pass a tuple type parameter to the contract smart, {'considerationToken': '0x0000000000000000000000000000000000000000', 'considerationIdentifier': 0, 'considerationAmount': 1950000000000000, 'offerer':…
1
vote
1 answer

Issue with python's web3 module: why is web3.isConnected() always returning false?

I'm trying to get acquainted with python's web3 class, and I cannot seem to get connected to infura's node using my API. The isConnected() function always returns false, no matter what. from web3 import Web3, eth infura_url =…
Defi_Noob
  • 11
  • 1
1
vote
2 answers

decode 'input' from Uniswap V3 transaction left 'data' attribute undecoded

I'm trying to read pending transactions that goes to UniswapV3 using this code in async way address_router = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45" with open("abiRouterUniswapV3.json", "r") as myFile: data = myFile.read() abiRouter =…
Abejorro78
  • 11
  • 1
1
vote
1 answer

Keyword argument 'args' interfering with JSON Data Conversion. How can I deal with this?

Though I've read many threads describing JSON to Python object conversion, I could not find anything about the specific issue I'm trying to deal with. I'm new to Python so please excuse me in advance if I'm asking a dumb question or if I'm…
1
vote
1 answer

Transaction REVERT error using Web3.py and local Ganache instance

Trying to deploy / transact against a local Ganache instance using web3.py. I'm able to read from a deployed contract. I'm also able to read / write through Truffle. At first I thought it was something wrong with the contract but I still get the…
kliao
  • 549
  • 1
  • 6
  • 14
1
vote
1 answer

How to differentiate using web3.py functions from a smart contract based on type/visibility?

I'm connecting to a smart contract with web3.py. I am the contract owner connecting with the same address which deployed the contract. I can print all functions, but I would like to separate each function based on their type and visibility, like…
Pro Girl
  • 762
  • 7
  • 21
1
vote
1 answer

My test fails when i run "brownie test". How can I correctly compare transactionReeipt to a float in python?

from scripts.helpful_scripts import get_account from scripts.deploy import deploy_donation from web3 import Web3 def test_can_get_conversion_rate(): account = get_account() donation = deploy_donation() tx =…