Questions tagged [python]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
42 views

Error: Non-hexadecimal digit found

I seem to be running the following error when I try to run this script: , from brownie import AdvancedCollectible, accounts, network, config def main(): dev = accounts.add(config['wallets']['...
0
votes
0answers
15 views

Re-create raw transaction hash from transaction object

Is there a way to re-create the signed transaction hash from tx object. I found the How to construct a raw Ethereum transaction from transaction data answer helpful, but when I try to re-create the ...
0
votes
0answers
15 views

IPFS hash link keep loading without not responding

I'm trying to add many JSON files in IPFS using the following API from this liberary py-ipfs-http-client, after running locally ipfs daemon: client.add('item.json') And here is the output of the item....
3
votes
1answer
94 views

How to create and send Flashbot transactions?

So far, I only understand flashbot bundles are signed raw transactions with one of them being a bribe to the miner for the mining fee, but : Is the bribing transaction special in the way it is valid ...
1
vote
0answers
20 views

How to manually interpret balance change after custom Events using web3.py

Context I am trying to build my own Ethereum explorer. I know this already exists on Etherscan out-of-the-box but the features that I want are either rate-limited or not even provided via its API. To ...
0
votes
0answers
23 views

Blockchain. Using sub-wallets through the main wallet without any restrictions or commissions

What I mean: Alleged example: I have a wallet "A". This is the main wallet. I want to creat 5 sub-wallets (in real case it will be more than 10.000 sub-wallets) from the main wallet - "...
1
vote
1answer
30 views

Issue with importing Chainlink & Openzeppelin

Currently trying to run a script and keep running into an error when trying to import chainlink and openzeppelin contracts. Not sure why, I looked at brownie pm list to make sure I have the correct ...
1
vote
1answer
15 views

How to replicate pushing and deleting from an array of structs from Solidity in Vyper?

I'm trying to re-create a Solidity contract in Vyper for a demonstration and am trying to figure out the best way to replicate adding/removing from an array of structs... As far as I can tell I'd have ...
1
vote
0answers
36 views

Web3 - Buy token by code

i'm trying to buy $TRY token with my code. It's BSC token. The problem is when i send money to the contract i don't receive any token :/ The contract i'm trying to buy : https://bscscan.com/token/...
0
votes
0answers
8 views

How do I sign with web3.py?

Can I have some clarification on what is the first argument of web3.eth.sign. it says here that the first argument is a account-- What is an account? Is it my ethereum address or a private key. it ...
1
vote
0answers
8 views

Web3.py filter.get_new_entries() returns nothing if over 10 events have been emitted?

I'm using the following loop to try and add the metadata for tokens generated in my own smart contract, it all works exactly as intended when I am generating up to 9 "bots" at a time, but as ...
0
votes
0answers
9 views

Can you use Ganache to test create wallet using web3py?

I am using the web3.py library using the web3.eth.account.create () to create my own wallets, my question is if there is any way to use the Ganache services as Provider to be able to perform tests ...
1
vote
1answer
54 views

How to get Transaction Action Etherscan

I'm trying to get Transaction Action information from Etherscan Apis by using a transaction hash without success. Here is what I want to extract (Swap 1 Ether For 2 Yf-DAI) with the API. I have ...
0
votes
0answers
10 views

generate signmessage in python web3

I am learning solidity NFT, I am trying to generate v, r ,s using python web3 require(owner() == ecrecover(keccak256(abi.encodePacked(this, tokenId)), v, r, s), "owner should sign tokenId"); ...
0
votes
0answers
14 views

How to parse trace output using ABI & web3?

I am pulling a trace from a Parity node using the JSONRPC API. It looks like this: print(trace) { 'action': { 'callType': 'staticcall', 'from': '0xXXXXXXXXXXXXXXXXXXXXXXXXXXXX', ...
0
votes
0answers
16 views

Is Web3 on Python hosted on a Raspberry Pi possible?

I've created a Discord bot that allows users to calculate their net worth including altcoins and LP tokens, which I want to use web3 to determine the value of. I did the standard pip install web3 on ...
1
vote
0answers
45 views

How to get my USDT (ERC20) balance with web3.py + geth?

I have Geth in full node on my server and I want to get my USDT balance with web3.py. Here is my Code: from web3 import Web3 from ethtoken.abi import EIP20_ABI w3 = Web3(Web3.HTTPProvider('http://127....
0
votes
0answers
21 views

Ethereum Input Data Decoding

I Have the following input: ...
0
votes
0answers
23 views

AttributeError: Module 'Users' Has No Method 'Main'

In Brownie I'm running a script which sends me this error "AttributeError: Module 'Users' Has No Method 'Main'. Do you have any suggestions on how I can fix this? import os from brownie import ...
0
votes
0answers
7 views

Why would Web3 return an empty array after calling the solidity function

So I want to interact with my Smart Contract from remix with python library called Web3. The problem is when I try to call the function from the smart contract it runs successfully but it only returns ...
0
votes
1answer
12 views

How to use smtp protocol in solidity smart contract via chainlink Oracle

i had developed a external adapter that make a http get request to cryptocompare api and get latest eth-usd price for me. from bridge import Bridge class Adapter: base_url = 'https://min-api....
0
votes
0answers
11 views

Event data has insufficient length | What does this mean?

I've seen this warning from time to time when working with Brownie Event data has insufficient length This is after I made a call to a Chainlink node, calling a function like: function requestUsers()...
0
votes
2answers
133 views

Given an ETH wallet address - Fetch all ERC721 tokens currently owned

I would like to create an application that - given a specific wallet address - fetches and displays all NFTs/ERC721 tokens currently owned. How can this be accomplished? Are there any examples ...
1
vote
1answer
203 views

View all NFTs owned by specific Ethereum wallet

Python developer here, very interested in the ETH ecosystem. I would say I'm an experienced developer, but unaware of the many languages/tools that are available to interact with Ethereum wallets. Let'...
0
votes
0answers
14 views

How do I get the deployed contract's address from a ContractContainer object in Brownie?

I want to chain contract deployment, where the second contract gets as a parameter the address of the first. I'm using Brownie : from brownie import ContractA, ContractB , accounts def main(): ...
0
votes
0answers
15 views

Geth python node no transactions / no data

I want to get transaction information on the blockchain ethereum using Go Ethereum (GETH) with web3 and python. I am running eth node on windows using the following command : geth --http --syncmode ...
0
votes
0answers
34 views

Get ALL Token transfers from Block using Web3.py

I am looking for a way to get all token transfers from the block using web3.py. I can now get the simple transfer or transferFrom data which was sent directly to token contract. But how can I parse a ...
4
votes
1answer
2k views

ValueError: {'code': -32000, 'message': 'only replay-protected (EIP-155) transactions allowed over RPC'}

Good afternoon, after having been developing a blockchain web app for some months, it's the first time I get this error when making a transaction. ValueError: {'code': -32000, 'message': 'only replay-...
0
votes
1answer
705 views

How to interact with a BSC contract using Python

Binance Smart Chain. I've first tried sending a transaction with python: from web3 import Web3 transaction = { 'chainId': 97, # 97: Testnet. 56: main. 'to': '0xmyaddress', '...
0
votes
0answers
12 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
29 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
89 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
29 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
33 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
326 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
45 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
68 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
24 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 ?
3
votes
1answer
3k 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
164 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
80 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
1k views

What are the front running bots? [duplicate]

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
132 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
101 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
75 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
21 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
2k 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
86 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: ...

1
2 3 4 5 6