Questions tagged [web3py]

Web3.py is a library for interacting with EVM based blockchains and smart contracts in Python.

For more information see Web3.py documentation.

Web3.py is maintained by Ethereum Foundation.

578 questions
2
votes
1 answer

how to listen for buy events of my bsc token?

I was just trying to create something which will listen to buy(pancakeswap) events of a specific token like SafeMoon & notify me when someone buys it on pancakeswap. My progress so far. The Way I Am Doing Now Is Finding Pancakeswap Pair Address Of A…
Mr. AdityaYT
  • 51
  • 1
  • 6
2
votes
1 answer

Web3py send_raw_transaction ValueError: {'message': 'invalid remainder', 'code': -32000}

I`m trying to start working with ethereum platfrom and web3py. I want to call smart contract, build transaction, sign and send it. Solidity code: pragma solidity ^0.5.0; contract UselessWorker { int public successfullyExecutedIterations = 0; …
2
votes
0 answers

Flashbots "X-Flashbots-Signature" header 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 goerli endpoint. My python code looks like this: import requests import json import secrets from eth_account import Account,…
2
votes
2 answers

web3py maxPriorityFeePerGas doesn't work?

I'm trying to setup gas price properly (BSC blockchain) using maxPriorityFeePerGas, maxFeePerGas but I always receive an error: ValueError: {'code': -32601, 'message': 'the method eth_maxPriorityFeePerGas does not exist/is not available'} It works…
2
votes
1 answer

ERROR: Failed building wheel for cytoolz when installing web3.py on macOS

while trying to do pip install web3 I am always getting the following error Building wheel for cytoolz (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3…
TheNewGuy
  • 45
  • 3
2
votes
0 answers

Best way to get the Revert Reason for a historical failed transaction

What's the best way to get the revert reason for a historical failed transaction using Web3.py and an Erigon archive node? The method shown in a recent article doesn't seem to work reliably. So for example transaction…
pintail
  • 21
  • 1
2
votes
0 answers

web3.exceptions.ContractLogicError: execution reverted

Hello! Help me please. I have just created own tokens on bsc testnet via PancakeFactory. Then I created liquidity pool with these tokens. I minted tokens and I want approve this tokens to PancakeRouter and add liquidity in this pool. You see my code…
Ivan
  • 303
  • 3
  • 13
2
votes
0 answers

the method eth_maxPriorityFeePerGas does not exist/is not available

Help me, please! I don't understand, why i can't do approve from my token contract. I do so always and this code worked. But now I've got error. My code: def approves(w3, token_contract, router_contract, my_account, my_pk): allowance_value =…
Ivan
  • 303
  • 3
  • 13
2
votes
2 answers

BSC websocket endpoint lantency

I'm recently trying to monitor transactions of a contract address on BSC chain for my dex limit order and I finally found a stable solution to monitor the log event -- 'using web sockect connection'. bsc =…
Yu Wan
  • 63
  • 2
  • 5
2
votes
1 answer

Web3py Transaction being reverted when using swapExactETHForTokens()

I am initiating a transaction using the following function. contract = web3.eth.contract(address=router_address, abi=PancakeABI) nonce = web3.eth.get_transaction_count(sender_address) amountIn = (web3.toWei(0.0001, 'ether')) start =…
Muneeb
  • 55
  • 4
2
votes
1 answer
2
votes
1 answer

How to solve $pip install web3 error using Termux?

I tried installing web3 on termux by calling $ pip install web3 But I keep having these errors Preparing metadata (setup.py) ... error ERROR: Command errored out with exit status 1: command: /data/data/com.termux/files/usr/bin/python -c 'import…
Suhail
  • 21
  • 2
2
votes
1 answer

Obtaining details about a token from an ERC-20 token address

I am really new to development with Web3 and was wondering if there was a way to get more information about a token from a token address found in a smart contract (i.e. I have a token address but have no idea what kind of token it is until I look up…
Matg
  • 91
  • 6
2
votes
2 answers

'code': -32603, 'message': 'Error: Transaction reverted without a reason string' while i'm trying to use swapExactTokensForTokens UNISWAP

I have read documentation on this function. I'm using Hardhat to visualize Blockchain at a particular moment. I deposit() ETH to WETH, then I approve() WETH to router. Everything looks fine. But when i try to call swapExactTokensForTokens(), it do…
uit_2018
  • 23
  • 3
2
votes
7 answers

ImportError: No module named solcx

I installed py-solc-x via pip3 install py-solc-x in the terminal but when I run the program, I still get an importerror. What's going on here? My code: from solcx import compile_standard with open("./SimpleStorage.sol", "r") as file: …
Alditrus
  • 87
  • 1
  • 5