562 questions
0
votes
0
answers
30
views
How can I get the reason for a failed transaction status 0 from Geth?
After sending a transaction to a payable smart contract (deployed to a geth instance) I receive transaction status 0. I don't understand where I'm going wrong as I followed the documentation.
Looking ...
0
votes
0
answers
67
views
swapExactTokensForTokens throws error: Fail with error 'STF'
I am trying to swap some cake2 token to tbnb using swapExactTokensForTokens function in web3py as following:
pancakeswap2_txn = pancake_router_contract.functions.swapExactTokensForTokens(
web3....
0
votes
0
answers
58
views
How to properly use swapExactETHForTokens function in a web3py
I am trying to use swapExactETHForTokens function using pancake router v2 and here is my code:
#!/usr/bin/env python3
import time
from web3 import Web3
bsc = "https://data-seed-prebsc-1-s1....
0
votes
1
answer
191
views
Unable to generate valid signatures for Four.meme wallet authentication
Problem Description:
I'm trying to authenticate with Four.meme using their wallet-based authentication system, but I keep receiving a "Signature for this request is not valid" error. I've ...
1
vote
0
answers
87
views
How to view data and preform actions on a Solana Program with an IDL?
I've create a python script to output the raffles from the Solana NFT raffle site https://rafffle.famousfoxes.com/
import asyncio
import json
from anchorpy import Provider, Program, Idl
from solana....
0
votes
1
answer
266
views
Ethereum Flashbots python code not working correctly with web3.py
Recently I've been having some trouble with the X-Flashbots-Signature header when sending a request to the flashbots endpoint. My python code looks like this:
import requests
import json
import ...
0
votes
1
answer
128
views
telegram chatbot for crypto transaction (solana) using python: Unexpected Error: argument 'signature': 'str' object cannot be converted to 'Signature'
Python: How to check a Solana transaction and sanitize the transaction ID
I have written a script to fetch transaction details from the Solana blockchain using the solana-py library. It includes ...
1
vote
1
answer
73
views
Execution Reverted on Base Layer 2 Buy transaction using web3.py
I'm trying to write a service using python and web3.py to execute a "buy" transaction on a Base smart contract.
I can't figure out why my buy transactions aren't working from my code but ...
0
votes
1
answer
222
views
Web3.py AsyncWeb3 WebSocket Connection Fails for Infura Sepolia
I’m working on an Ethereum project that connects to the Sepolia network using Infura's WebSocket endpoint (wss://sepolia.infura.io/ws/v3/<PROJECT_ID>). While the connection works fine in Postman,...
0
votes
2
answers
267
views
bitcoinlib signing raw text message using python
I am trying to sign a raw message, like "Hello World", using the Python library bitcoinlib. The goal is to generate a base64-encoded signature for the message that can be verified. However, ...
1
vote
2
answers
1k
views
'SignedTransaction' object has no attribute 'rawTransaction'
`
from web3 import Web3
import os
import time
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Define RPC URLs for different networks
RPC_URLS = {
"ethereum":...
1
vote
0
answers
40
views
"ImportError: Cannot Import 'solcx' Despite Manual Installation and Virtual Environment Setup"
ImportError: Cannot Import 'solcx' - Library Not Found
I'm facing persistent issues importing the solcx library in my Python script, and I'm receiving an error indicating that the library is not found ...
1
vote
1
answer
238
views
Calling a smart contract without the ABI in Web3.py
I need to call a function of an implementation contract. The problem is I'm not the creator of the contract and it's source code hasn't been verified on ethersan, hence I don't have the ABI.
I ...
0
votes
1
answer
123
views
Get Detail transaction info
I encountered an issue and need help. I want a simple Python script that accepts a transaction hash and prints detailed information for transactions on the BSC blockchain. This includes the ...
0
votes
2
answers
852
views
I have this error when requesting quicenode: "{'error': {'code': -32602, 'message': 'non-array args'}, 'id': 0, 'jsonrpc': '2.0'}"
The following code is related to Ethereum network logs, which I am trying to extract with qouick node api. My code was working until a few days ago, but today when I visited it, I encountered this ...
0
votes
1
answer
129
views
Can't send transaction using web3.py (send_raw_transaction method)
I'm testing web3.py trying to send eth from one account to another using "send_raw_transaction" method.
I'm using Ganache for testing purposes.
Acutally, I'm just following the steps ...
-1
votes
1
answer
82
views
Transaction won't occur on Sepolia-Ethereum using ESP-8266 Microcontroller using Micropython
I'm trying to execute "transfer" function of an ERC-20 token with my ESP8266 Microcontroller using Micropython. The problem is Micropython doesn't have libraries like web3.py so i have to ...
0
votes
1
answer
149
views
How to check if one wallet address have already called a method on an EVM contract (PYTHON)
Introduction
I have a list of wallets and I want to ensure that a contract function is called only once. To achieve this, I iterate through the wallets, check if each wallet has already called that ...
0
votes
1
answer
91
views
Web3 Python async request for get_all_entries are failing
async_w3 = AsyncWeb3(AsyncWeb3.AsyncHTTPProvider(rpc))
async_contract = async_w3.eth.contract(address=ADDRESS, abi=ENV.TOKEN_ABI)
async_contract.events.Transfer().create_filter(fromBlock=crawl_block-...
0
votes
1
answer
962
views
Blockchain - Raydium - Python - Matching Transactions cross wallet
I have been trying to create a program in python to analyze my Pnl of trades subcategorized by wallets that I am copy trading on Raydium. I have tried out two code bases so far and the first returns 0 ...
1
vote
0
answers
132
views
Decoding Transaction Input Using ABI. Web3 py
I am correctly grabbing the ABI as I have confirmed it is the same on etherscan. I am also getting the transaction[input].hex() correctly which displays the hex of the input I am trying to decode. Can ...
0
votes
1
answer
867
views
How to decode web3 py transaction object input variable using ABI
I have a transaction in which I know the hash of. It was a swap to sell a token using Uniswap. I am trying to find the amount the wallet received in ETH within the transaction object. To my knowledge, ...
0
votes
0
answers
143
views
Ethereum: how to call Smart Contract functions directly with JSON-RPC method?
I need to execute and call http JSON-RPC ethereum node to get results without web3py or web3js. How to do that? I have read there is eth_call method, but I didn't find any examples with ABI how to use....
0
votes
1
answer
110
views
Decoding input data from BSC transaction causes OverflowError: Python int too large to convert to C ssize_t
import requests
from web3 import Web3
from eth_abi import decode
def get_transaction_input_data(tx_hash):
apikey = "xxx"
url = f"https://api.bscscan.com/api?module=proxy&...
0
votes
1
answer
225
views
Web3py: can not find ABI function after decoded
Here is transaction https://etherscan.io/tx/0x6465187a7bb43a6db42ee63e5f5cc30fb094393957a7f1ce6c08b5afddf3e0bc
I don't know why my script can not find ABI Transfer() function after decoded on ...
1
vote
0
answers
116
views
Web3 Contract Deployment Error: VM Exception 'Revert' during Transaction Processing
Web3 Contract Deployment Error - Execution Reverted
I am encountering an issue while deploying a smart contract using Web3. The deployment process triggers an error leading to contract execution being ...
-1
votes
1
answer
247
views
Download part of ethereum blockchain
Is it possible to download the full version of the Ethereum blockchain for the last 30 days? I'm interested in accessing logs of all transactions during this period. If direct download isn't viable, ...
1
vote
0
answers
91
views
How to decode int256 from tx data?
I am looking at a transaction's data:
Swap (index_topic_1 address sender, index_topic_2 address recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick)
and the ...
1
vote
0
answers
643
views
web3.py query for Uniswap V3 Factory contract events on Arbitrum, getting all pools created since block 0, but it's missing multiple token pairs
I'm using web3.py to parse through all liquidity pools created since block 0 on Uniswap V3 Arbitrum. Atm, about 486 different pools a returned, but none of them are pool I'm expecting. Is there some ...
1
vote
1
answer
499
views
transaction type not supported. Arbitrum getBlockByNumber. Golang
Please help me, this method works well in Binance Smart Chain, but not in Arbitrum.
func (bn *BlockManager) getTrxByBlockNumber() *types.Transactions {
op := "decoder.tx....
0
votes
0
answers
347
views
Websocket connection closed. An error occurred: object of type 'NoneType' has no len()
I'm trying to receive pending transactions from the eth mempool, for which I use a wss connection to the node.
The problem is that when normally receiving messages from the node, no errors occur and ...
1
vote
0
answers
73
views
Calculating Memory Positions in Solidity Diamond EIP-2535 AppStorage
I'm trying to calculate the memory positions of a smart contract which uses the Diamond pattern so I can use w3.getStorageAt, but I'm having some issues with finding the correct positions.
This is my ...
0
votes
1
answer
53
views
Calling functions of a member variable of a deployed smart contract using web3
I have a smart contract deployed (Setup.sol), and it imports another smart contract "Model.sol" which has some functions that I need to call. Now, I only have contract address of the ...
2
votes
1
answer
1k
views
How to pass tuples and structs using web3.py or blockchain explorers
How should I pass the following arguments to sendOFT function in
This smart smart contract using python web3.py and block explorer?
Here are the data types:
I get an error when I pass elements like ...
1
vote
1
answer
3k
views
AttributeError: 'Web3' object has no attribute 'fromWei'
I have been receiving this error how do I solve it
AttributeError: 'Web3' object has no attribute 'fromWei'
I have tried toWei and plenty of other stuffs but nothing seem to work what do I do I really ...
1
vote
1
answer
749
views
AttributeError: 'LocalAccount' object has no attribute 'privateKey'
def register(update: Update, context: CallbackContext):
"""Register the user and generate a ETH address."""
user_id = update.message.from_user.id
if update....
0
votes
1
answer
73
views
Discord.py and Heroku, @commands.slash_command(), how to fix?
# scripts/creation.py
import discord
from discord.ext import commands
from role_selection import RoleSelectionView
from data import load_embed, save_data
class Creation(commands.Cog):
def ...
0
votes
1
answer
81
views
Can't list metamask accounts using web3py eth.accounts
I've already installed and created metamask accounts and signed in on my browser chrome. I'm trying to list those accounts following ChatGPT tutorial to connect a HTTPProvider, then call function eth....
1
vote
0
answers
123
views
Incorrect Byte Representation in eth_abi
I am in the process of familiarizing myself with Uniswap v3, albeit with limited success thus far. I am attempting to obtain a quote by invoking the function: quoteExactInput(pathBytes, ...
1
vote
0
answers
79
views
Web3.py: parsimonious.exceptions.VisitationError: TypeError
hope someone can help me.
i want to read the nonce (transaction count) and balance for a polygon wallet with web3 package 6.10 and phyton 3.11. get_transaction_count isnt working but the other simple ...
1
vote
1
answer
287
views
Can i append the ethereum transaction's data input when generating a QR Code? Is there a better way to track transactions?
My application manages sales with local payment methods and Ethereum/Bitcoin.
When using crypto payments a QR Code will be displayed for the customer, with the wallet's address and amount.
The issue I'...
-1
votes
2
answers
798
views
How to build transaction payload for signed EIP-1559 transaction
I am trying to construct the raw transaction data based on a signed EIP-1559 transaction according to the EIP-1559 spec. However, it is not matching the value returned by web3py when signing a ...
0
votes
1
answer
678
views
get Friend.tech X (Twitter) account by their wallet address
I am currently trying to fetch new users that register on Friend.tech. I do that by looking at every buyShares transaction with the buy value = 0 as new accounts are "free" for the first one ...
1
vote
2
answers
631
views
Web3.py TypeError: Transaction had invalid fields: {'value': Decimal
Wondering if anyone knows how I can send the max amount of ether or my entire eth balance through web3.py? here the chunk of code that ive been kind of working with. In 'value' I can only send an ...
1
vote
2
answers
4k
views
How to bundle multiple transactions in one on Ethereum using web3.py?
I'm trying to use Python to make multiple swaps in one transaction on Uniswap (swaping ETH against the token).
I successfully wrote a Python function that does just that, using swapExactETHForTokens ...
-1
votes
2
answers
369
views
How to resolve "not Authorized 401" when accessing Geth using web3 package?
I have this code in Python
from web3 import Web3
from lxml import html
import requests
import random
from colorama import Fore, Style
from hdwallet import HDWallet
from hdwallet.symbols import ETH as ...
-2
votes
1
answer
141
views
web3.py blockchain : why the nonce should be equal to transaction count?
I am using web3.py and ganache to tranfer Ether between two account. In the tutorial that I'm learning from a part of code is like below:
nonce=wb3.eth.get_transaction_count(account_1)
tx={
'nonce'...
0
votes
0
answers
77
views
Web3 event showing error and application is unable to continue
def listenForTokens(lastRunTime):
try:
event_filter = contract.events.PairCreated.createFilter(fromBlock='latest')
except:
print("Error skipped")
pass
...
0
votes
2
answers
676
views
I cannot import Web3 in python in colab.research.google.com
I am trying to use Web3 library in colab.research.google.com/ using the following code
from web3 import Web3 after I installed it using the following code !pip install web3 but I am getting the error ...
2
votes
0
answers
56
views
Fail with error 'hasFee'. web3.py, depositToken
I can't execute the transaction, I get the error
'Fail with error 'hasFee''
Code:
client.py
import logging
import traceback
from eth_account.signers.local import LocalAccount
from web3 import Web3
...