Questions tagged [python]

Python is a dynamic and strongly typed programming language designed to emphasize usability.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

my python event listener create duplicates in case of multiple event in one transaction

I have an issue to manage with my listener in python, here is my code : def handle_event(event, log_index): receipt = w3.eth.waitForTransactionReceipt(event['transactionHash']) ...
0
votes
0answers
12 views

get “event name” using web3

I want to build a listener in python using web3 as usual. The issue is that I have a lot of event on my contract (let say 30), and depending the event I have an action to do. Here is my code, and I'll ...
0
votes
1answer
36 views

How can my Ethereum node accept remote connections?

I need to use Web3 on some Python and Javascript applications i'm creating, so i decided to setup a light node on a VPS. The node seems to work, but i'm having troubles accessing it from outside the ...
1
vote
0answers
14 views

How can i get confirmed transactions from an address?

I'm looking for some way to listen to transactions happening on this address. Basically, whenever a new transaction is confirmed, i would like to receive it. How can i do that? I just got started to ...
1
vote
0answers
22 views

Python filtering the type of event in contact

I am building a python app that is listening to events from a contract. The issue is that I have different events in only one contract, let me explain. Currently my code is : def handle_event(event): ...
0
votes
0answers
18 views

Programmatically convert log data (hexadecimal) into negative decimal value

I'm having some trouble converting negative numbers in the log data of an Ethereum transaction. In this transaction, log index 192, topic 3 is listed as "...
0
votes
0answers
31 views

Python Web3 Contract Filtering

I am trying to filter out transactions from BSC and read their input data (specifically borrows from venus), however I am having trouble getting my event filter to work properly. I have already tried ...
1
vote
1answer
18 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
7 views

How do I pass a dictionary for the in3_registry value for the Incubed Python API?

I am using Python 3. I have installed the in3 (Incubed) Python module. I want to invoke the ClientConfig of the in3 Python API in a specific way. There is an in3_registry argument that is part of ...
0
votes
0answers
37 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
18 views

A python module equivalent to Nethereum codegen

Does anyone know a Python module that can help me convert an ABI for a contract to a python class automatically. Nethereum has Codegen for C#, is there anything like that for python ?
2
votes
0answers
434 views

How to get token prices with UNISWAP API

I am using uniswap python api to get live token prices. I am using all the variation of the built-in functions. However, it does not give me the right value. HERE IS MY CODE address = "...
1
vote
0answers
46 views

Get all transfers of a token contract from etherscan API with python

I am trying to pull out from etherscan api all token transfer from a particular token contract. Currently, I can pull data by manually going to etherscan token contract page - for ex cvc coin: https://...
0
votes
1answer
26 views

How can i get contract data from certain block [closed]

I need to get some data from an smart contract, but i want to generate something like history How can i get that data until some block or maybe be able to replay the blocks somehow? Im using python ...
2
votes
0answers
183 views

What are the front running bots?

I've been seeing too many threads about this. I was curious about what are they how do they function? Is it basically an automated trading algorithm that just executes trades when a cryptocurrency is ...
0
votes
1answer
49 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 ...
2
votes
1answer
42 views

Deploy to testnet with brownie

I'm looking to deploy some code to the kovan testnet with Brownie. However I keep getting an error accessing accounts. Here is the command I'm running: brownie run scripts/deploy_price_consumer_v3.py -...
1
vote
1answer
31 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 ...
0
votes
0answers
16 views

Quorum: Sending Private Transaction With Python

I am trying to experiment with GoQuorum and Python. I have read the documentation about how privateTransactions work and I am trying to perform one. Since Python's web3py does not support the ...
0
votes
0answers
615 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
45 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: ...
2
votes
1answer
48 views

How can I do abi.encodePacked in Python or PHP?

Just concatenating strings doesn't work. Keccak::hash(10 . $address, 256) is what I'm doing atm.
0
votes
1answer
191 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
28 views

How can I sign a message off-chain and verify it in the contract method that it was signed by a specific address?

I have a public / private keys. I release a contract with these keys. I want some user to withdraw a token / ether, so I sign some message like {withdraw: 10, nonce:1} offchain. User uses this signed ...
0
votes
0answers
18 views

Obtain ALL historical token transfer events for an address using Python [duplicate]

I would like to exhaustively obtain all token transactions for a specific address. Etherscan's API returns only the last 10,000 transactions in this way: Get a list of "ERC20 - Token Transfer ...
0
votes
0answers
202 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
378 views

Perform an automated transaction using 1inch API

To perform an automated 1 inch transaction I use these two functions. It works well at first. Unfortunately, in the last few days I have always had the same errors: Fail with error 'Return amount is ...
1
vote
1answer
22 views

How to parse the node information in the nodes directory by leveldb?

I want to get all the node IP addresses of ETH, so I need to parse the geth/nodes directory, but I can't find the specific data format and cannot parse it. I found a same problem, but there is no ...
1
vote
0answers
50 views

In Python, how do I use subscriptions, or otherwise perform asynchronous operations?

I have the following code that polls for transactions every second. I want to make it more responsive, and not use polling, but instead something quicker. tx_all_pending = w3.eth.filter('pending') ...
1
vote
1answer
184 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
89 views

Which ethereum framework to choose Traffle vs Brownie?

I know that the most used frmaework for smart contract testing deployment etc is Traffle. But, since I am not very good at javascript (i am mainly coding in python)- I saw there is an option to use ...
0
votes
0answers
51 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
57 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
57 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
0answers
51 views

Duplicate events from get_new_entries using web3.py

I'm struggling to understand how to properly poll events emitted from contracts. The provider I'm using is Infura. My code boils down to the following: filter = target_event.createFilter(fromBlock='...
0
votes
2answers
233 views

Generating cache from block_number and seed using Python

I'm trying to run Ethash algorithm from the Python-code provided over here: https://eth.wiki/concepts/ethash/ethash, and have some troubles comparing the produced cache-file with the actual cache-file ...
0
votes
0answers
30 views

Known transaction error in Python3

I'm experimenting on an automatic ethereum wallet. But I have some problems. The first process is successful but it's error message the second process: Known transaction how do I solve this problem? ...
4
votes
1answer
124 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
3answers
183 views

Let's say I forgot first 2 words of the seed, how could I find an account with ether in it?

Let's say I forgot first 2 words of the seed. I want to write a program that brute-forces all possible bip-39 word combinations for the first 2 words, generate private/public keys, addresses, and go ...
0
votes
0answers
260 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
409 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
29 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 ...
3
votes
1answer
150 views

Brownie cannot install solc on OSX

Follow the procedures on this page brownie : create new project and compile with brownie. Encounter the following error, please comment how to fix it. Configuration and environment. Python 3.7.7 ...
0
votes
0answers
94 views

How can I replicate the Token Tracker etherscan page using python and etherscan API?

So I want to list top tokens and their associated stats, like on https://etherscan.io/tokens. Even simpler than that, how can I use the etherscan python API (or https://github.com/corpetty/py-...
2
votes
1answer
374 views

How to decode a raw transaction in Python?

I have a raw_tx in hex format which I'm going to broadcast via eth_sendrawtransaction JSON-RPC method. I want to check this raw_tx by decoding it on fields: gas, gas_price, nonce, value, etc. Some ...
0
votes
1answer
37 views

Issues with using/installing python solidity parser

I am trying to install and use python solidity parser by ConsenSys I keep on getting the following error File "<stdin>", line 1, in <module> File "/home/seed/.local/lib/python3.5/site-...
3
votes
1answer
43 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=...
0
votes
1answer
94 views

Get latest block info with gas price, block time etc., from etherscan.io

I am trying to collect information such as, 'fast': 140, 'fastest': 165, 'safeLow': 100, 'average': 120, 'block_time': 8.875, 'blockNum': 10021935, 'speed': 0.8993211072506393,....etc. on the latest ...
0
votes
0answers
257 views

How to config geth node to get ERC-20 tokens balances

I'm trying to tune my geth node to get ERC-20 tokens balances, but y API call always returns {'jsonrpc': '2.0', 'id': 1, 'result': '0x'} My geth node version: instance=Geth/v1.9.13-stable-cbc4ac26/...
1
vote
2answers
166 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
2 3 4 5 6