Questions tagged [web3.py]

Web3.py helps you access your Ethereum node from Python. It is web3.js for Python.

Filter by
Sorted by
Tagged with
0
votes
1answer
8 views

Connect web3.py with Ganache

I am new to this. So, how do I connect web3.py with Ganache. I've got Ganache up and running, smart contract deployed. I would like to interact with it from, lets say, a python shell. So, this is what ...
0
votes
0answers
20 views

How can I pass an unsigned transaction to a smart contract?

I have an unsigned transaction that I got from the 0x API in my web3 app. I would like to pass it as an argument to a function within a smart contract, is this doable? how? I already read about a ...
0
votes
0answers
10 views

Event listener works correctly from outside of the machine but not from inside the machine

I have created an event listener for my application. When I run the event listener from outside of the machine it listens correctly to all the events but when I run the same event listener (with ...
3
votes
1answer
34 views

Make an erc20 transfer with web3py

how to send an erc20 in web3py please, I have that : tx_hash = contract.functions.transfer(destination_address, value).transact({'from': myaddress }) and I get this error : ValueError: {'code': -32601,...
0
votes
1answer
19 views

how to check instantly when a user charges amount to his address generated by our app

Our app needs to detect and create a charging order asap whenever a user charges an amount of ETH/USDT(ERC20). Due to the limit of infura API, we decided to set up our own ETH nodes and use JAVA to ...
0
votes
0answers
23 views

Detecting dropped and replaced transactions web3.py

I am using web3.py. Given a transaction hash, is there any way to determine if a transaction was dropped and replaced by another transaction with the same nonce? Currently i am looping w3.eth....
0
votes
0answers
22 views

Getting txpool with python web3 and infura

I am trying to monitor pending transactions with python web3 and an infura node. I am currently using web3.eth.getBlock(block_identifier='pending', full_transactions=True) on a loop to fetch pending ...
0
votes
1answer
21 views

Invisible transaction

I work in a Ropsten testnet. I have a Python application that sends a transaction and returns the transaction's txHash. It is possible to send a maximum of 500 transactions in one request. The ...
0
votes
0answers
29 views

“TxRejectedError” Using Ganache with Web3

I am having trouble sending my transaction Using Ganache. I am showing the logic that creates and sends the transaction and it says it cant be found or it is rejected don;t really know what the error ...
0
votes
0answers
21 views

decode a transaction receipt which does not have an event log

Is there a way to decode a transaction receipt which does not have an event log? In the case of an event log we have topics which we can decode, but what about the case when an event isn't triggered ...
1
vote
0answers
47 views

Opcode error when interacting with smartcontract in geth

Initially, I was working locally with ganache and the smart contracts were working correctly. Then I tried to work on geth and I get the following error: Traceback (most recent call last): File &...
0
votes
0answers
13 views

How to extract the block sealer identity from the extraData hexbytes (which is renamed proofOfAuthorityData) in web3.py?

Question is in the tittle. I use a local network with PoA clique and middleware w3 = Web3(IPCProvider('~/mygethnode/geth.ipc')) w3.middleware_onion.inject(geth_poa_middleware, layer=0) And then ...
1
vote
1answer
28 views

Web3.py: ValueError: Could not format value when trying to deploy smart contract bytecode from Truffle

I have a working solidity contract which compiles and gets deployed successfully by both truffle and web3.js + metamask. Importing the very same contract into python and deploying it using web3.py (...
0
votes
0answers
11 views

why can't we get the meta mask injected account using web3.py? [duplicate]

I am trying to get the current account from meta mask in my Dapp ,i am using web3.py. In web3.js ,web3.eth.getCoinbase() returns the current account of the metamask, but web3.eth.coinbasein web3.py ...
0
votes
0answers
49 views

how to match python list and integer to solidity smart contract uint256[] and uint256. web3.py

web3.exceptions.ValidationError: Could not identify the intended function with name `storeSurvey`, positional argument(s) of type `(<class 'int'>, <class 'list'>, <class 'numpy.ndarray'&...
2
votes
0answers
24 views

unable to veriify a signed message in solidity

behaviour of web3py and solidity. Samples: ## First in web3py sig = Web3.soliditySha3( [uint256], [tokens] ) ## used below also output: HexBytes('...
1
vote
0answers
21 views

message signing and verification for micropayment channel

I am writing a micropayment channel for ERC20 Token, but I have pasted here a small signature verification code which is not working. The transaction doesn't succeeds. I have to use web3py to send ...
0
votes
0answers
7 views

How to list sub calls of conctract methods transferring money?

Assuming I have a contract method which conducts several money transfers, e.g. function payalot(address payable p1, address payable p2, address payable p3) public { p1.transfer(42); p2....
0
votes
1answer
27 views

Getting this error `ValueError: {'code': -32000, 'message': 'insufficient funds for gas * price + value'}` on raw transaction send

I know for sure I have enough eth on account. Some prelims: I am signing a raw transaction with web3.py, like so: transaction = { 'to': '0xSENDHEREFINALLYPLEASE', 'value': 1000, 'gas': ...
0
votes
0answers
47 views

Problems with transferFrom within a contract

I am playing around with this repo, more exactly with the ERC20ContinuousToken.sol contract. I am able to successfully run the truffle tests after connecting the project to Ganache, so I know that ...
3
votes
1answer
28 views

Brownie: Hypothesis given() is not resetting chain for each function call

I have the following test code snippet in my brownie project: from hypothesis import settings, given, strategies as st from brownie import * import brownie st_buy_amount_eth = st.integers(min_value=...
1
vote
2answers
37 views

Web3.py Sending Transaction Not Updating Contract

I'm new to the world of Web3.py however I have an ERC20 compliant contract and I am tryin to call the transfer() method on it to simply transfer some tokens from sender to receiver. I am testing it ...
1
vote
1answer
98 views

How do you know if a contract is destroyed?

I'm using web3.py to interact with contracts. I was wondering, after calling a function with selfdestruct or suicide(address), how do I find out that the contract is in fact dead?
0
votes
0answers
48 views

Could not transact with/call contract function, is contract deployed correctly and chain synced?

i got "web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced? " error when try to run this code: from web3.auto.infura ...
0
votes
1answer
30 views

Out of Gas when using Web3py

I have a contract that I am trying to deploy using Web3PY that is failing with: VM Exception while processing transaction: out of gas. It deploys with no errors when using Web3 on node. I am running ...
0
votes
0answers
34 views

web3 filter function not working

I am trying to filter Transfer events from my local Ethereum node using web3 py. I am accessing my local ethereum node remotely using teamviewer and it was running and fully synced as well. My code is ...
0
votes
1answer
48 views

'Contract' object has no attribute 'eventFilter' web3.py

I am trying to filter Transfer events from my local ethereum node using web3 py. I have created a venv in visual studio code. My code is as follows: def decodeLogswithfilter(t1, t2, abi1, addr): ...
0
votes
0answers
23 views

How to interact with Remix contract through web3py

I have an assignment for which I must write a client that can interact with a deployed contract by transacting and filtering event logs, but I cannot figure out how to successfully get either to work ...
0
votes
2answers
21 views

Execute from truffle dev to python language

I successfully execute smart contract function in the truffle development console, for example: let instance = await MetaCoin.deployed() let accounts = await web3.eth.getAccounts() instance.sendCoin(...
1
vote
1answer
36 views

How long does it take it typically take for call value of changed variable to update?

I'm trying to mine a proof of work contract. Each time a solution is found, the return value for units.functions.getChallengeNumber().call() should change. I ran two instances of this script (with ...
0
votes
0answers
29 views

Transaction submits but is not valid when processed

I'm running two scripts that try to solve the same proof of work problem. from web3 import Web3 import json from hexbytes import HexBytes import numpy as np import os import time INFURA_ROPSTEN_URL ...
1
vote
0answers
22 views

Sending tokens out on coinpayments success payment using Web3py

I'm writing Django app and want to send out tokens using Web3 once Coinpayments sends me callback about successfull payment. The problem is that Coinpayments sends multiple callbacks at once and just ...
0
votes
1answer
42 views

Execute smart contract function on python

so I already successfully make a smart contract and deployed it on my BC network. I can execute the function using the Ethereum wallet. My question is, how can I execute the functions on Python ...
0
votes
1answer
24 views

Withdraw ether from other miner

I'm working with blockchain ethereum private network with several miners. I already successfully send and stamp a transaction from (example) one minerA to minerB using web3 library in python language. ...
1
vote
3answers
65 views

Get method signature from contract rather than manually constructing

Is there a way to get a method signature from the contract object (using Web3.py) rather than manually constructing it? I don't see a function in there that accomplishes this. It seems like ...
0
votes
0answers
8 views

Setting up listener using web3py

I'm setting up a proof of work contract. When a solution is found, the contract emits a Transfer event and the number that gets hashed with future solutions changes. I need to set up a listener so ...
2
votes
1answer
43 views

How can i simulate the write contract in etherscan using Web3.py?

I would like to use web3.py instead of using the etherscan write contract function available in ethercan.io, Is this possible? if yes can someone please show me a sample. The contract address of the ...
1
vote
1answer
23 views

Unable to sign transaction

As per this documentation, I'm trying to send a signed transaction. Here's what I have def send(web3, wallet_private_key, gas_price, transactionABI, value=0): options = { 'to': ...
1
vote
1answer
73 views

geth v1.9.13 - web3.exceptions.BadFunctionCallOutput: Could not decode contract function call func return data b'' for output_types ['uint256']

For clearity I am using two different ubuntu machines as follows, please note that both machines are sync to my private black chain and working on the same smart-contract: Contract call was working ...
3
votes
2answers
93 views

Failed building wheel error when installing web3 using pip and Python 3.8.2

I have been trying to install web3 using the command pip install web3 but it doesn't work !!!, I have tried so many solutions but nothing works , here is the error that I have, I hope guys you can ...
1
vote
2answers
48 views

Empty to field in web3.py transactionReceipt

I fetched the transaction receipts of a block and had some questions regarding some of the fields. If a transaction receipt shows the "to" field empty and a address in the "contractAddress" field, ...
1
vote
0answers
60 views

Sending secure transactions using web3.py

An ethereum account I had has been hacked, where whenever I send it, say, 0.1 eth, some evil bot immediately sends 0.0009 eth from that account to a dummy account, and then spends the remaining 0.0991 ...
3
votes
0answers
72 views

ENS Name Look Kraken

I'm trying to get the ENS for addresses, so I thought initially to use the ENS on web3 from ens import ENS import web3 as w3 provider = w3.HTTPProvider('https://mainnet.infura.io/v3/...
1
vote
1answer
34 views

Hexbytes versus python bytes

I'm trying to find the python analog for the following function In solidity function getMineDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 ...
3
votes
1answer
116 views

Internal Trace Transactions Python

I've been trying to figure out the best way to get the Net internal/trace transactions using python for a specific transaction hash. I have read other topics on the forum that say that these are not ...
2
votes
1answer
28 views

SAI - DAI Symbol Not Captured Right Web3.py

trying to capture the symbol of the receipts of transaction using web3.py. I am getting the DAI, DAI and DAI... while this should return SAI, SAI, DAI. Although, I checked that the correct SAI ...
1
vote
1answer
66 views

Getting Tokens Transferred from Web3.py

I'm trying to find how etherscan finds the "Tokens Transferred" using the logs of a given transaction. Using this 0x52caaf79bf913064a70a6c9d917fd4190cdb099fe79e7d3a9dfe0600e1cfbc81 arbitrary ...
1
vote
2answers
63 views

Decoding Input Data

I'm trying to decode the input data in a transaction... I've been stuck on this for a while, as I'm really new to using this api. I have written the below example, but I'm getting stuck when loading ...
0
votes
0answers
44 views

Go-ethereum light node does not provide getTransactionReceipt after upgrade

I'm running the following services in docker: go-ethereum 1.9.11-stable-6a62fe39 in light mode python 3.7-alpine app with Web3 v5.5.1. Geth node startup is straightforward: image: ethereum/client-...
0
votes
0answers
46 views

Timeout when try to connect over websocket in web3.py

I am trying to listen for events emitted by a simple Solidity contract. I am not able to connect using ws though I can commit transactions using http. Here's my code for event listening - import ...

1
2 3 4 5
7