ethereum

Sending entire Ethereum address balance in post EIP-1559 world

Sending entire Ethereum address balance in post EIP-1559 world Question: I’m trying to figure out how to send an entire address balance in a post EIP-1559 transaction (essentially emptying the wallet). Before the London fork, I could get the actual value as Total balance – (gasPrice * gas), but now it’s impossible to know the …

Total answers: 1

How can i make this web3 python script faster?

How can i make this web3 python script faster? Question: I want to make a python script (for BSC) which keeps track of the balance of that particular token in the wallet. I need the python script to be very fast. Currently with the below code, it takes about 6 seconds for the script to …

Total answers: 2

How to continuously keep track of balance of a particular token in my wallet

How to continuously keep track of balance of a particular token in my wallet Question: I’m trying to create a bot which keeps a track of a particular token in my wallet. As soon as it detects the token, it should send the token to another address. I’ve written the code but i don’t know …

Total answers: 1

web3 python ethereum raw transaction

web3 python ethereum raw transaction Question: im getting this error while trying to send ethereum using my local geth node. ValueError: {‘code’: -32000, ‘message’: ‘insufficient funds for gas * price + value’} here is how i build the tx from web3 import Web3 w3 = Web3(Web3.HTTPProvider("http://localhost:8545")) amount = 0.01 from_address = "0xF2………" private_key = "cf………." …

Total answers: 1

Verify Metamask signature (ethereum) using Python

Verify Metamask signature (ethereum) using Python Question: I would like to verify an ethereum (ETH) signature made in MetaMask using python. I’m developing a website using flask as backend. Javascript code send a POST requests to the back end containing the 3 following variables: {‘signature’: ‘0x0293cc0d4eb416ca95349b7e63dc9d1c9a7aab4865b5cd6d6f2c36fb1dce12d34a05039aedf0bc64931a439def451bcf313abbcc72e9172f7fd51ecca30b41dd1b’, ‘nonce’: ‘6875972781’, ‘adress’: ‘0x3a806c439805d6e0fdd88a4c98682f86a7111789’} My goal is to verify …

Total answers: 3

How do I get ethereum transactions?

How do I get ethereum transactions? Question: I’m getting started to Ethereum and Web3py and I would like to get transactions happening whenever they happen on a specific address. In order to do this, I signed up to infura and got my project ID. So here is what I tried: from web3 import Web3 import …

Total answers: 1

ValidationError on smart contract function call for no apparent reason?

ValidationError on smart contract function call for no apparent reason? Question: I am trying to call Uniswap’s Router’s function swapExactTokensForETHSupportingFeeOnTransferTokens(). When I enter the values manually on etherscan, it goes through. However, when I do it via python code it gives me a validation error. The error looks like this: web3.exceptions.ValidationError: Could not identify the …

Total answers: 2

Send signed transaction from Trezor hardware wallet

Send signed transaction from Trezor hardware wallet Question: I’ve been trying to code a simple web3.py program to send a transaction from my Trezor. I’m able to sign the transaction on my Trezor, and the function that does that (ethereum.sign_tx()) returns a tuple of the V, R, and S signatures of the transaction, which looks …

Total answers: 1

How to listen for events in Python with Infura (2019 year end)?

How to listen for events in Python with Infura (2019 year end)? Question: web3py 5.3.0 latest doc gives example of eventFilter — https://web3py.readthedocs.io/en/latest/contracts.html#event-log-object transfer_filter = my_token_contract.eventFilter(‘Transfer’, {‘filter’: {‘_from’: ‘0xDc3A9Db694BCdd55EBaE4A89B22aC6D12b3F0c24’}}) which results in error — *** AttributeError: ‘Contract’ object has no attribute ‘ContractEvents’ While I have raised this issue to web3.py on github — https://github.com/ethereum/web3.py/issues/1508 Can …

Total answers: 1

web3.py: sending ether to a smart contract

web3.py: sending ether to a smart contract Question: I’m using web3.py to interact with a private Ethereum blockchain. I’d like to call the following function in a smart contract: uint256 public cookiePrice; function feed(string memory message) public payable { require(cookiePrice <= msg.value); applyFeeding(msg.sender, message); } I am trying to call it like so: price = …

Total answers: 2