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
0answers
5 views

Possible to get event logs from a specific pending transaction?

So I'm using web3 py filtering and it looks like I can listen for event logs using a filter, but I don't know which transactions in the pending pool produced the logs. Similarly, I can use ...
0
votes
1answer
26 views

The method does not exist/is not available

web3py 5.15.0 i tried w3.geth.personal.new_account('pass-phrase') then get {'code': -32601, 'message': 'The method personal_newAccount does not exist/is not available'} then figured out that i need ...
0
votes
1answer
15 views

Not able to interact with Ganache-cli: “-bash: ganache-cli: command not found”

I've already installed ganache-cli with sudo npm install -g ganache-cli on my MacOS but I am not able to interact with it through my terminal. I always get the error: -bash: ganache-cli: command not ...
1
vote
1answer
19 views

Value error: Calling 1inch contract with web3.py but having problems with the ABI

i am trying to get the quote from 1inch regarding the Ethereum/DAI price. I am new to Web3.py and need some additional help regarding the following problem. My code: import json from web3 import Web3 ...
1
vote
1answer
12 views

Python web3 return value of getBlock(full_transactions=True)

I am trying to get the meaning of all fields returned by getBlock, but no where to find! web3.eth.getBlock(block_identifier='pending', full_transactions=True) returns a list of : AttributeDict({'...
0
votes
0answers
22 views

Python Web3 get all events

I am using web3 5.14.0 and Infura I am trying to get all transfer event for link chain token like the following: from web3 import Web3 ABI_REQUEST_ENDPOINT = 'https://api.etherscan.io/api?module=...
0
votes
0answers
16 views

“Error! Missing Or invalid Action name” Etherscan API error

I created a utility in my function to get the status of transactions using Etherscan APIs. It was working well until recently. Here's the function: def get_eth_or_usdt_transaction_status(...
1
vote
1answer
28 views

I am getting UnhandledPromiseRejectionWarning: Error: Returned error: execution reverted error while calling my smart contract methods using wb3js

Here is my code const web3 = new Web3(new Web3.providers.HttpProvider("https://rinkeby.infura.io/v3/2a6f2bf907594edfbe6343066c394df8")); // web3.eth.handleRevert = true var address = "...
0
votes
1answer
36 views

getting data from events

versions: solidity 6.0.0 python3.8 web3 5.13.1 I am trying to get return data from a smart contract function that changes a struct on the contract. I cannot do that using return because the ...
0
votes
0answers
36 views

Exception errors and contract calls

Noob here. I've set up a test blockchain using Ganache and have successfully deployed a sample contract to one of the addresses in my environment (using Remix). However, when I try to run my python ...
1
vote
0answers
28 views

executing functions on a Smart Contract on ropsten via web3.py

I am trying to use web3.py to interact with a smart contract deployed on Ropsten. The Contract lives on the address 0xb80206789De27D14b3f458Bed9072d4a0129b41e and has two functions, one to save a ...
1
vote
1answer
27 views

How to implement the CREATE2 in Python

I'd like to know either how to implement the skinny CREATE2 in Python or a package that provides it. This is the function I'm trying to port from TypeScript to Python. It calls generateAddress2 with ...
1
vote
1answer
88 views

Unable to install 'web3[tester]' - Cannot open source file: 'src/libethash/io_win32.c'

Version: web3==5.13.0 Python: 3.9.0 OS: win 10 pip freeze output - attrs==20.3.0 backcall==0.2.0 base58==2.0.1 bitarray==1.2.2 blake2b-py==0.1.3 cached-property==1.5.2 certifi==2020.11.8 chardet==3.0....
0
votes
1answer
68 views

How to find out if a token takes a fee on transfer?

I'm trying to find out if there is a way programmatically (using web3) to check if a token takes a fee on transfer, such as the ones that require the swapExactETHForTokensSupportingFeeOnTransferTokens ...
0
votes
0answers
10 views

Monitoring new token Creation

Is there anyway to monitor new token creation using Web3.py? I tried to accompulish with event_filter.get_all_entries() and using Topics: but no luck.. 'topics': [None,'...
0
votes
0answers
386 views

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7545): Max retries exceeded with url

I created a blockchain app using Ethereum, I downloaded a virtual box. I activated the smart contract on the virtual box and connected it to the Python file on the original device. When the ...
0
votes
0answers
11 views

estimateGasPrice succeeds but sending a transaction fails?

I have a simple contract with a function (simplified for the sake of discussion): function test(address tokenAddress, address userAddress) external { IERC20 token = IERC20(tokenAddress); ...
0
votes
0answers
33 views

gas_estimate returning error for too man arguments

running Web3 5.13; python 3.9; Mac 10.15.7 Trying to run test on solidity contract based on the example provided in teh Web3.py docs. When running this I receive an error stating TypeError: ...
0
votes
0answers
17 views

What extra RPCs does web3 transact do?

I am using the 'transact' function on the web3 generated contract functions, and I noticed it does a call to estimate gas before sending the transaction. What other calls does it do? Does it do ...
1
vote
1answer
29 views

How to get the non-packed solidityKeccak hash in Python Web3

For Web3.solidityKeccak(['bool'], [True]) , Python Web3 yields: 0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2 This matches the output of keccak256(abi.encodePacked(true)) in ...
1
vote
1answer
40 views

Web3.py 'topics'

I have question regarding topic:. I'd want to query and filter for specific transaction below. Transaction Recept Event Logs Topics -1st log- 0 - ...
0
votes
1answer
119 views

How to get event log Web3.py?

I am using solidity 0.7.4, web3.py 5.12.2, and python 3.7. I am working with Windows 10. My goal is to emit an event inside a solidity function, in order to retrieve the log after the function is ...
0
votes
1answer
25 views

Ganache: How to see block data in every node?

I'm using ganache to simulate and a local blockchain network, and web3.py to interact with it. One aspect of blockchain is transparency: all transactions, once mined, are written into the ledgers of ...
1
vote
1answer
35 views

web3 python convert addresses from transaction log topics

I'm trying to get the to and from address from the logs in a transaction. In my example, the log entry is for a Transfer(address,address,uint256). The resulting topics[1] and [2] return the addresses, ...
1
vote
1answer
24 views

Web3py didn't throw error(in Remix it did)

The contracts I used: EtherDelta(DEX) Freedomcoin(Token) Here is my logic: I use userA who deployed the two contracts to transfer 100Ether to userB, then userB invoke depositToken, however, as there ...
0
votes
1answer
47 views

Web3.py with Ganache - Error “from not found”, 'code': -32000

I have opened an instance of ganache at localhost port 9545 where I can connect with web3.py. However when I am trying to perform a transact using the below code: w3 = Web3(Web3.HTTPProvider('http://...
0
votes
0answers
54 views

Running Ethereum Node for pending tx - beginner questions

I have been getting into blockchain development/solidity and started a project where I want to scan all pending tx for specific addresses. I am using python and web3.py and started by using Infura and ...
0
votes
0answers
26 views

ImportError: cannot import name 'is_string' from 'eth_utils'

I am using web3.py but following imports is giving me error for eth_keys eth_utils is installed File "C:\Users\neeraj bansal\Anaconda3\lib\site-packages\eth_keys\main.py", line 3, in <...
1
vote
0answers
33 views

Help Web3 Metamsk [closed]

I have a code that works without any problems Ethereum payments to your site with MetaMask When you click the button, the metamask program opens for the default payment that I set 1 ETH I want to add ...
0
votes
0answers
23 views

How to track deposits into my account using web3.py

I'm learning how to build blockchain applications. I'm using Django and Web3.py to create one. I wanna know if there's a way to listen for deposits into wallets I will be creating in the application. ...
0
votes
0answers
40 views

web3 import errors

I recently upgraded to Python 3.9 and am now having trouble importing web3. from web3 import Web3 File "C:\Users\User\Desktop\Misc Python Scripts\ssethereum_final.py", line 2, in <module&...
0
votes
0answers
8 views

How to detect public address with web3 py on dapp level?

Let's say I deploy a voting app with web3py as the backend. Now an arbitrary user wants to cast a vote. Given that web3py cannot be integrated with metamask, what is the conventional way to detect the ...
0
votes
0answers
128 views

Pass ADDRESS(string) as argument to contract function using web3.py

I've been stuck on this isseu for more then 24 hrs now. I have the following function in my solidity contract: function getBalance(address _addr) public view returns(uint256){ return userBalance[...
1
vote
1answer
175 views

how to get list of transactions history about specific contract address using web3?

I really don't know how to get a list of transactions history about specific contract address using web3.py and I use Infura HTTPProvider I just have only one 'contract address'. Can i get information ...
0
votes
1answer
28 views

Hoe to get the gas used by each transaction in a block in a single API call?

I am working on service which monitors Ethereum based blockchains using web3 API calls. For each new mined block, it has to parse each of the transactions in the block. In addition, it needs to parse ...
0
votes
1answer
128 views

Web3 estimateGas error: gas required exceeds allowance?

I would like to estimate the amount of gas required for a transaction before actually sending it with web3. For some reason I always get a gas exceeded error. I've double-checked my solidity code and ...
1
vote
0answers
55 views

How to catch contract exception in Web3 py?

I'm using infura.io with web3.py and I would like to catch exception thrown by smart contract. Currently, web3.py does not throw any exception even if the contract does, and hence it burns a lot of ...
1
vote
1answer
142 views

web3.py ( web3.exceptions.CannotHandleRequest: Could not discover provider while making request: method:eth_call ) --help

proveedores= ['https://mainnet.infura.io/v3/KEY_KEY','https://ropsten.infura.io/v3/KEY_KEY'] from web3 import Web3 , HTTPProvider, IPCProvider, WebsocketProvider from web3.auto import w3 web3= Web3(...
0
votes
0answers
16 views

gasprice mechanism of ethereum gas station api (ethgasstation)

i try to understand the gas price mechanism of ethgasstation but i cannot understand the varibale used in the dataset like block_posted and block_mined in line 29 in the picture can someone help me
0
votes
0answers
30 views

How can I set the timeout for web3 python function Eth.getTransactionReceipt and the ContractFunction.call?

I am polling the Eth.getTransactionReceipt and the ContractFunction.call to get the transaction receipt for a mass transaction submitted onto the Ethereum chain. I notices that I have a lot of ...
0
votes
0answers
16 views

puthon web3.py Get the latest block

I want to use the following code to monitor the latest block from web3 import Web3 import asyncio def handle_event(event): print(event) # and whatever async def log_loop(event_filter, ...
0
votes
1answer
242 views

Error on view function call {'code': -32015, 'data': 'Reverted 0x', 'message': 'VM execution error.'}

I have a view function I'm trying to call on the kovan network with the following code. (You'll need an RPC_URL for the kovan network.) The function is the Chainlink historical price view function. I ...
0
votes
1answer
85 views

How to construct a raw Ethereum transaction from transaction data

Let's say I have the following transaction information: { "jsonrpc":"2.0" "id":0 "result":{ "blockHash":"...
0
votes
1answer
70 views

Replaying Ethereum transactions, how could I extract the “from” account key from an existing transaction

I'm trying to replay transactions that exist in one chain on another. I can replicate all transaction arguments that are available through eth_getTransactionByHash, but now need to sign the ...
0
votes
0answers
39 views

Does Infura support Event Filters?

Does Infura support creating filters to Listen to events ? I have a dapp with many events, and would like to test it in Ropsten testnet and python web3.py, but it seems infura does not support filters....
1
vote
0answers
46 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
0
votes
0answers
49 views

Getting wrong nonce when trying to send transaction

Im using opencv in ganache in this app to send an ethereum transaction In my app im getting the transaction that i send like that nonce = web3.eth.getTransactionCount(account_1) tx = { 'nonce': nonce,...
0
votes
2answers
109 views

ERC1155 Validation Error code: -32000

I am using web3py to make a transaction. But I am getting validation error: {'message': 'VM Exception while processing transaction: revert Need operator approval for 3rd party transfers.', 'code': -...
1
vote
0answers
31 views

How to get external transaction using python

I am trying to test their code in order to detect the Ponzi smart contracts. When I run their code following error occurred to get the external transactions. Here is their code ; for addr in ponzi: ...
0
votes
1answer
113 views

web3 py - transact call with struct parameter

I am trying to call a smart constract function with the following abi with pragma experimental ABIEncoderV2: "constant": false, "inputs": [ { ...

1
2 3 4 5
8