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
7 views

Decoding TX input (contract isn't verified at BSCscan and ABI is unknown)

I tied to decode transaction's input for the specific contract Contract source code is unknown and ABI is unknown too. At BSCscan contract isn't verified and built-in decompiling returns a mess ...
0
votes
0answers
13 views

Transaction / call that fails to be parsed with the correct ABI

This OpenSea sale fails to parsed with the standard ABI: https://etherscan.io/tx/0x4499dc75facb4cd27894196aac00bcb0ffbe3d64de87105878451d5637662f90 Here is sample script to show this: const ethers = ...
1
vote
1answer
20 views

How to add back default Rinkeby Testnet network in brownie networks list back?

I accidentally deleted the default rinkeby network that comes with brownie and wanted to know how to add it back? I tried with the below cmd by creating an infura project but I'm getting the ...
0
votes
0answers
13 views

web3.py swapExactTokensForTokens failing transaction: Fail with error 'PancakeRouter: INSUFFICIENT_OUTPUT_AMOUNT'

I am trying to call swapExactTokensForTokens of a router contract, I need to swap USDT to tokenB. Here is the code of the transaction: router = '0x0000000' abi = '[{"inputs":[{"...
1
vote
0answers
39 views
+100

Sending a transaction despite ContractLogicError

I have my own private keys for an account and I'm using web3py to invoke a smart contract function. The way things are right now as per the docs, I first need to build the transaction, sign with my ...
0
votes
1answer
29 views

How to call any smart contract functions without getting their ABI?

I make python bots for smart contracts, but I'm not too much of an expert. What I usually do is download the ABI from the block explorers. However, what if I want to call a function from any random ...
1
vote
2answers
46 views

Error publishing source code

Here's my deploy.py: from brownie import FundMe from scripts.helpful_scripts import get_account def deploy_fund_me(): account = get_account() fund_me = FundMe.deploy({"from": ...
0
votes
0answers
33 views

decode atomic match method Ethereum transaction by using ABI

Hello experts i used the following code and it works well for decoding all methods like mint,transfer,transferfrom and etc, but when i try to decode this transaction "https://etherscan.io/tx/...
0
votes
0answers
13 views

Inconsistent availability of older transaction receipts on Polygon

I am trying to access transaction receipts on the Polygon blockchain with Python web3.py. I discovered that the function web3.eth.get_transaction_receipt(tx) sometimes throws an TransactionNotFound ...
0
votes
1answer
11 views

How to know what coin has been exchanged through Web3 Api

Is there a way to know what coin and how much of it has been exchanged when getting a transaction history through the Web3 API?
0
votes
0answers
19 views

send_raw_transaction threading with python?

I'm kinda freaking out here. I'm trying to use send_raw_transaction function (web3 python library) using threading to be able to send multiple transactions at the same time (of course with multiple ...
0
votes
1answer
15 views

ValueError: {'code': -32000, 'message': 'filter not found'}

I am tring to get all holders of a particular contract through web3.py library.For RPC I am using infura. the code is: contract = web3.eth.contract(address=address,abi=abi) name = contract.functions....
0
votes
0answers
11 views

couldn't send transaction to smart contract with local private key

type is not supported from eth_keys.datatypes import PrivateKey from web3 import Web3, eth from web3.middleware import geth_poa_middleware from web3.middleware import ...
0
votes
0answers
11 views

How can I delay some Blocks By using Web3.py

For now, I'm creating some bots by using Web3.py. And I have to delay some blocks to send transaction for this bot. In web3.js, I know provider.waitForTransaction(hash, confirmation). and it can help ...
0
votes
0answers
14 views

How to get this example of ABI?

I was analyzing codes and in this example ( https://github.com/CodeWithJoe2020/sellTokenPancakeSwap/blob/main/sell.py#L39 ) they placed in SellAbi variable an ABI different from what i've seen in a ...
0
votes
0answers
5 views

Analogue to ecsign in python

How can i use ecsing in python, i need do same code in python: async function createSignature(message, pk){ message = toBuffer(message); var privateKey = new Buffer.from(pk, "hex") ...
1
vote
0answers
16 views

How can i create uint40 in python?

I need to create a uint40 number for sign message. random_hex = hex(random.getrandbits(256)) reveal = int(random_hex, base=16) commit_hash = w3.toHex(w3.sha3(encode_single('uint256', reveal))) commit =...
0
votes
1answer
34 views

Web3py - Getting pending TX's?

Is there any way to get pending transaction for a specified address? I can get all pending transactions for current pending block but I can't filter them. I can do: txHashPending = w3.eth.filter('...
1
vote
1answer
19 views

Do you know where to find a library or example of a script to be able to see how much liquidity there is in a contract?

I need to see in a new listed contract in BSC, through python, how much liquidity has been added or possess. I can't find a library and a script as an applied example that can help me see that ...
0
votes
0answers
37 views

How to Buy/Sell tokens using Uniswap V3 Multicall function?

I used to create programs to buy and sell tokens by interacting directly with Uniswap V2 router functions (SwapExactEthForTokens, and others). It was fairly simple because all I needed to do was to ...
0
votes
0answers
32 views

Error: insufficient funds for gas * price + value when swap USDT to another token - python web3

I am trying to swap USDT to another token on pancakeswap. When I use contract tokenToBuy as WBNB it works normally, but when I replace it with contract of USDT, it gives error ": ValueError: {'...
0
votes
0answers
24 views

How the centralized exchanges handle deposits?

'Greetings! I am wondering if anyone is aware of the structure that is used by centralized exchanges like Binance, Coinbase, KuCoin, etc. to handle their ETH/ERC20 Tokens deposits. I started to ...
0
votes
0answers
38 views

How can I fix a ValueError revert transaction on a sniper bot that reverts only when triggered by an event(PairCreated)..otherwise swap goes through?

THIS IS A BOT TO SWAP ON UNISWAP WHEN NEW PAIR IS CREATED BUT WHEN BUY FUNCTION IS TRIGGERED BY AN EVENT THE TRANSACTION REVERTS BUT BUY FUNCTION GOES THROUGH WHEN TESTING JUST THE buy() ...
1
vote
0answers
30 views

Web3.py Transaction with hash ХХХ not found

I have a issues. I need to receive a receipt for transaction "0x7a695820b6491b767308c45776e1da5445c7a2edac29aa14d916bda834d47c31" on Polygon, in which the Klima Token contract was created. ...
1
vote
1answer
41 views

How to create Bitcoin-like wallet structure for Ethereum?

'Hi everyone! Any suggestions for an architecture to reach to Bitcoin's wallet structure for Ethereum? Appreciate any help, R. Geth version: 1.10.12-stable Geth's web3 api version: 0.20.1 OS: Windows ...
0
votes
1answer
36 views

What is web3's wallet definition and usage?

'Hi everyone! Is web3's wallet definition and usage, the same as in Bitcoin's? Appreciate any clarification, R. Geth version: 1.10.12-stable Geth's web3 api version: 0.20.1 OS: Windows web3.py ...
0
votes
1answer
61 views

How to create a wallet?

'Hi everyone! I'm wondering if anyone has trouble using web3's create wallet method? I do not have access to web3.eth.accounts.wallet command through my Geth's console. Appreciate any help, R. Geth ...
0
votes
1answer
24 views

How do I get information on pending transactions of a wallet/contract?

I have tried so many API such as Etherscan, Moralis, and Blockcypher but they all only display completed transactions. Is there a way to scan a wallets' pending transaction and get information out of ...
0
votes
0answers
20 views

web3.py No matching entries for 'tuple' in decoder registry

Version: master (6a90a26ea12e5a789834c9cd6a7ae6d302648f88) Python: 3.9 OS: osx pip freeze https://gist.github.com/Th0rgal/bb866886af6224af5e89bd64ba0b99bf What was wrong? It seems I am not able to ...
0
votes
0answers
31 views

How to find which fields in an event are indexed?-or How to get topics & data fields together in receipt in the order they appear in event signature?

Consider the first log in this transaction. We see that etherscan is unable to parse the topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. I am able to find this topic on ...
1
vote
1answer
38 views

Why computed number of confirmations is a lot larger than value from the block explorer?

As it has been explained here, here and even here I proceed with computing number of confirmations for a given txid. It works but gives weird results which are not consistent with the block explorer. ...
0
votes
1answer
59 views

Why does the call() method from web3.py cause a revert when combined with transfer()?

I have deployed a contract for my custom ERC20 token. I am trying to send tokens using web3.py contract.functions.transfer(address, 20000000000000000000).call() Above code is giving error raise ...
0
votes
1answer
21 views

python-dotenv fails to import PRIVATE_KEY from .env file: "Cannot convert None of type <class 'NoneType'> to bytes"

I am learning solidity and when I use python-dotenv to import my PRIVATE_KEY from a .env file, export PRIVATE_KEY = 0xd6a5ea3d2c97b1dd03fd1b9c447e36791522135136665f23b0c08c6395f66d7a it imports it as ...
0
votes
1answer
33 views

Why doesn't MetaMask pop up when my web3.py script successfully establishes a connection with Infura?

from web3 import Web3 infura_url="https://ropsten.infura.io/v3/my_key" w3=Web3(Web3.HTTPProvider(infura_url)) print(w3.isConnected()) It is giving output as True. But still, it is not ...
0
votes
1answer
47 views

How to get MethodID of a function in a smart contract?

If I look in the past transactions of a smart contract that called a function, I can see the MethodID being used. If the function was never used in the past, I would never know what was the method ID....
0
votes
0answers
15 views

Listening for exchange events using brownie

I'm trying to find a way to listen for uniswap pricing 'infinitely' then code some logic to possibly arbitrage between different exchanges. Please link me to any relevant projects if possible. I used ...
0
votes
1answer
47 views

encode_abi encode function call

I am trying to convert Javascript code to Python and believe the equivalent "web3.eth.abi.encodeFunctionSignature" function in JS to encode ABI in Python is with the "encode_abi" ...
0
votes
0answers
18 views

i am getting unicode decode error while trying to compile my brownie file

brownie compile INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum File "C:\Users\scs\AppData\Local\Programs\Python\Python310\lib\...
1
vote
1answer
26 views

Error when calling a function from smart contract

I was trying to call the balanceOf function in web3.py and I ran into a problem. I started getting this: "web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is ...
0
votes
1answer
18 views

msg.sender not work parallel with metamask

I am working with django project that is empowered with blockchain. I want to create an authentication system using blockchain technology. I write a smart contract and deploy it in ganache. In here I ...
0
votes
1answer
37 views

How to define private key variable using config library?

i am trying to interpret a code for buying tokens through Pancakeswap using Python. I got stuck at the Private Key where the variable is "config.private" in the code. But I have seen other ...
0
votes
0answers
47 views

web3.py geth txpool help

I need to help accessing the geth.txpool API namespace in web3.py. Heres what I do (for example): from web3 import Web3 web3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/MY_KEY')) txPool = ...
0
votes
0answers
31 views

How to track transaction by token address with web3.py?

I'm just starting explore web3 and I wanna track transaction by token address with web3.py. Is this possible?
0
votes
0answers
23 views

i am getting file not found error while compiling my file desipte importing files correctly

brownie compile INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum New compatible solc version available: 0.8.10 Compiling contracts... ...
0
votes
0answers
79 views

MintTo contract from web3 gives error - ERC721: transfer to non ERC721Receiver implementer

I am new to blockchain technology. I am trying to create a contract and then mint a token to contract using web3 python library. I could create an contract. This is the link to contract in rinkeby ...
0
votes
0answers
49 views

How to properly use web3.py with BSC archive node?

I use the web3 python library and Moralis archive node to interact with BSC. I've got a few failed transactions on PancakeSwap a few days ago and am trying to replay them with different parameters ...
0
votes
0answers
106 views

EIP 1559 transaction for and swapExactTokensForTokens (Web3.py)

path = [TETHER, wAVAX, TIME] contract_txn = contract_TJ_ROUTER.functions.swapExactTokensForTokens( Web3.toWei(380.27, 'ether'), Web3.toWei(0, 'ether'), path , address_wallet, block['timestamp']+30 )....
0
votes
1answer
87 views

Which package or library does the code ".functions.swapExactETHforTokens" correspond to?

i am newbie in Python. I am deciphering some lines of code using the Web3.py package and I came across some lines that do not have said package or do not locate it on the web page. I interpret that it ...
1
vote
0answers
58 views

I am getting virtual machine error while running my brownie fundme contract

PS E:\brownie_fund_me> brownie run scripts/fund_and_withdraw.py --network ganache-local INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for ...
1
vote
1answer
51 views

AttributeError: type object 'Web3' has no attribute 'eth'

I am working on a smart contract integrated Django project. But When I try to check the account using Web3.eth.accounts get an error, AttributeError: type object 'Web3' has no attribute 'eth' Other ...

1
2 3 4 5
14