Skip to main content

Questions tagged [python]

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

274 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
2k views

How to fix a web3.py HTTPConnectionPool read timeout error

I have a web3.py program running and everything was seemingly working. I was connecting to my local server via the automatic connection offered in web3.py. I am now getting the following error: ...
mypythonquestions's user avatar
6 votes
0 answers
1k views

How to install the Python bitcoin module on windows for presale wallet import?

I've been holding Ethereum since the pre-sale. I want to continue to just hold my presale wallet because its safe as cold storage (rather than importing into my wallet). However, I want to be able to ...
inthepixels's user avatar
5 votes
0 answers
1k views

Using Web3.py to monitor a contract/address for pending transactions

I am currently trying to build a script to automatically interact with a smart contract once a certain transaction has been sent. I have the interaction part down but am having difficulties actually ...
seiba's user avatar
  • 51
5 votes
1 answer
2k views

How can I sign EIP712 message from Python code

My goal is to sign a message according to EIP712 from python code using an imported private key. To construct the message to sign I am using: https://github.com/ConsenSys/py-eip712-structs After ...
mKoeppelmann's user avatar
  • 7,626
5 votes
0 answers
3k views

How to convert my metamask private key into 32 bytes hexa

How to convert my metamask private key into 32 bytes hexa ? i am using web3 to start trading on pancake but when i try to convert my bsc metamask phrase keys into hexa is like 150 bytes but require ...
Usama Khan's user avatar
4 votes
0 answers
75 views

Is this an easter egg in the Etherscan Api?

Ethereum (and so, the etherscan.io API), operate with 160-bit addresses. However, I unintentionally requested the max address (0xFF...FF) and I padded it with leading zeros (to become 0x00..00FF...FF),...
Albert Hendriks's user avatar
4 votes
0 answers
3k views

How to encode data payload in ETH transaction

I'm using python to sign and send ETH transactions, and would like to do the same for ERC-20 token transactions as well. I'm having trouble correctly encoding the data payload to invoke the transfer ...
Achia's user avatar
  • 161
4 votes
1 answer
782 views

How to use the hashimoto light algorithm in pyethash?

I have a problem with using the hashimoto light algorithm in pyethash. I am using pyethash version 23.1 and comparing the results with ethash.run (ethashjs 0.0.7). Using the same inputs the result ...
Donavan Theodor's user avatar
3 votes
1 answer
17 views

How do I make a blanket statement to be notified if certain wallets mint?

I've been trying to come up with a way to track wallets and be notified when they 'mint'. The way i'm doing it now seems like it will only catch around 50% of all transactions due to the nature of the ...
oyxf's user avatar
  • 41
3 votes
0 answers
721 views

Brownie INFO: Could not find files for the given pattern(s)

I installed Brownie succefully, and also am able to make a init project from it. But every time I run brownie I get INFO: Could not find files for the given pattern(s) I've installed ganache-cli, ...
Jaydeep Dholakia's user avatar
3 votes
1 answer
1k views

pip install ethereum failed

I run pip install ethereum to install the package named ethereum for python. Yet I got following error: Requirement already satisfied: ethereum in c:\users\wenbo\anaconda3\lib\site-packages\ethereum-...
bo wen's user avatar
  • 45
3 votes
0 answers
203 views

Simple hello packet

I am trying to generate a simple hello packet for handshaking with a remote Ethereum client using the encode method from the rlp library. from rlp import encode hello = bytearray(encode([0x00, 4, "...
polerto's user avatar
  • 131
3 votes
0 answers
69 views

Effectively debugging pyethapp

I have also asked the technical details of pyethapp's use of gevents here. I'm trying to run a transaction step by step in a debugger and see how it is being signed and added to the blockchain. I am ...
Sebi's user avatar
  • 5,284
2 votes
0 answers
124 views

Split a private key into shares for mpc wallet with tinysig

I'm trying to split a private key into shares using tinysig but am having difficulty. I.e. I'm trying to create an MPC wallet. Ultimately I want to generate a private key, split it into two shares, A ...
Ryan's user avatar
  • 92
2 votes
1 answer
169 views

Tool to re-create state of smart contract locally

I would like to be able to simulate transactions with smart contracts based on their solidity source code. The process should be entirely automated. While I am aware that some tools allow forking the ...
davidsawyer's user avatar
2 votes
2 answers
479 views

How to send a 'write as proxy' transaction using the ABI for the implementation contract?

i am trying to call the function requestL2Transaction of the contract 0x32400084C286CF3E17e7B677ea9583e60a000324 The ABI is located at 0xc796a402e1b26ecd2cd38f23e05a2f904504ec89 But I am getting this ...
Jonghi's user avatar
  • 21
2 votes
0 answers
111 views

Use Brownie to send ERC20 tokens to a payable function with the amount of tokens as an argument to the function

I have the following AlgoToken contract: interface StableCoin { function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external ...
Steven Hochstadt's user avatar
2 votes
0 answers
159 views

How to send 3 transactions to 3 different testnets in brownie

I'm trying send 3 transactions on python (using brownie as api) to 3 different testnets (kovan, rinkeby and goerli), and i'm doing this using 3 differents threads. I have already import inside of ...
1manonearth's user avatar
2 votes
2 answers
403 views

how to deploy the smart contract in brownie

Error: Final argument must be a dict of transaction parameters that includes a `from` field specifying the address to deploy from Terminating local RPC client... smart contract: pragma solidity ^0.5....
Abed ja'fari's user avatar
2 votes
1 answer
178 views

Is it possible to connect metamask in a Jupyter notebook?

I would like to use my wallet to sign transactions using an api in a Jupyter notebook. To do this, I currently have to store the private key either in the notebook itself or in another file. It would ...
gradascender's user avatar
2 votes
0 answers
584 views

Help. I have reached an issue that is preventing me from installing Brownie

I can't for the life of me install Brownie completely through Pipx, Septuptools, or anything. Because my python command doesn't seem to work as normal. Preface: So I installed everything that I was ...
Helpfusali's user avatar
2 votes
1 answer
311 views

Need help for extracting historical prices using chainlink api

This is my first time i am using a api call for implementing on project for predicting the avalanche price feed for machine learning to get the historical data for 2 years. I want api call from ...
Mohammed Shakeeb's user avatar
2 votes
0 answers
4k views

A Status code indicating if the top-level call succeeded or failed (applicable for Post BYZANTIUM blocks only)

When i try to swap from bnb to busd its working fine but when i try to swap between other coins is giving me error , also i try to swap from busd to other coins same error A Status code indicating if ...
Usama Khan's user avatar
2 votes
4 answers
5k views

deploying a contract private key error

I am following tutorial entitled "DApp Development for Python Programmers" by levelup.gitconnected. The url is https://levelup.gitconnected.com/dapps-development-for-python-developers-...
Benjamin Hall's user avatar
2 votes
0 answers
725 views

Losing connection on Geth websocket subscription

I am trying to keep multiple WebSocket connections to my Geth node open at the same time (around 200 connections). My issue is that they keep closing with a timeout error. I can't seem to know if it's ...
Kaki Master Of Time's user avatar
2 votes
0 answers
936 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/...
Valentin Garreau's user avatar
2 votes
0 answers
979 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 ...
tintinthong's user avatar
2 votes
0 answers
718 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://...
tomtomg0's user avatar
2 votes
1 answer
3k views

How to get event log Web3.py?

I am using solidity 0.7.4, web3.py 5.12.2, and python 3.7. I am working with Windows 10. My goal is to emit an event inside a solidity function, in order to retrieve the log after the function is ...
Marcello Feroce's user avatar
2 votes
2 answers
4k views

Perform an automated transaction using 1inch API

To perform an automated 1 inch transaction I use these two functions. It works well at first. Unfortunately, in the last few days I have always had the same errors: Fail with error 'Return amount is ...
Laurent's user avatar
  • 31
2 votes
0 answers
380 views

Can not run more than 1 event in Infura

I am trying to listening to many events from infura but it is not working. Only one filter work, when I add the second filter, this message appear: RuntimeError: cannot call recv while another ...
Yamjan's user avatar
  • 21
2 votes
1 answer
2k views

Verify ethereum signed message using python

Is there any way to verify signed message using python? Google do not provide any useful info. I don't believe that there are no any lib which can do it. Any suggestions? Many thanks!!!
user58331's user avatar
2 votes
0 answers
192 views

Web3.py transfer call failing, not sure why

I am trying to learn how to work with ethereum and ERC20 tokens. I have managed to setup ganache and deploy my contract. I can see it on ganache and I can connect and read the balance of the token on ...
Ryan-Neal Mes's user avatar
2 votes
0 answers
1k views

How w3.eth.filter('latest').get_new_entries() works exactly?

I try to monitor new transactions. from web3.auto import w3 import time l = w3.eth.filter('latest') while True: ts = time.time() ll = l.get_new_entries() for i in ll: print('===== Block ...
Alex's user avatar
  • 105
2 votes
1 answer
786 views

Error whilst running solidity with python(py-solc)

I have been running my code which involves deployment of smart contract to Ethereum Ropsten network. I ran this successfully for some time but last week did installed another software after which ...
Tabz's user avatar
  • 81
2 votes
0 answers
242 views

Merkle-Patricia-Trie-Root is wrong. How to get transaction proof? in Python3

I am trying to calculate proof that a specific Transaction is mined with a specific difficulty. So far I got the Block via JSON_RPC and all its Transactions. I am Using the trie Library for Python 3....
SimonSchuler's user avatar
2 votes
1 answer
897 views

What is the best practice of a Dapp development mixed with Python/Django?

I've written and tested the Smart Contracts in Truffle, and now want to develop a front-end and a small back-end for my Dapp. So far, I preferred MVP frameworks, particularly Django. Therefore, what ...
Ruham's user avatar
  • 963
2 votes
0 answers
544 views

eth_sendTransaction for function with address type parameters

I'm interacting with my local private blockchain created using geth. I'm able to use eth_call, but now I have some problems with eth_sendTransaction. The signature of the function is this: function ...
gatb27's user avatar
  • 350
2 votes
0 answers
153 views

pretty_compile in pyethereum

I am learning Serpent with pyethereum in Spyder (so I have a running log of what I have tried and learned), but I am stuck in translating standard features of Serpent (such as pretty_compile) from ...
rastapavel's user avatar
2 votes
0 answers
260 views

Is the DAG the same for all (private/main/test) nets?

Reading about the proof of work, I got to the data generation part (mainly the DAG) and found it in: ~/.ethash/full-R23-0000000000000000 In the ethash it is mentioned that the DAG is generated from ...
Sebi's user avatar
  • 5,284
1 vote
0 answers
29 views

eth_call late for one block

I am making a token sniper by simulating buying erc314 token def calculate_tax(self): try: self.client.eth.call({ 'nonce': self.client.eth.get_transaction_count(...
Neverwin's user avatar
1 vote
0 answers
17 views

How is the address of an Base contract computed?

I'm curious when i see some fantastic projects, so I'm doing some experiments to find out the method which used by Base to generate the contract address. Tried with two different methods, and I've ...
Spencer's user avatar
  • 11
1 vote
1 answer
34 views

Contract.functions "not found" in Web3.py

Testing this python code on UBUNTU : import requests import json from eth_account import Account from web3 import Web3, HTTPProvider caller = "0xb9****f832860DBD" private_key = "...
Thierry Grandjean's user avatar
1 vote
0 answers
35 views

Optimism Swap problem in Web3.py

Error in code when trying to swap from Optimism to usdt or usdc via Web3.py library I have code that swap successfully to Arbitrum, Polygon but error in Optimism. I am using MetaAggregationRouterV2 ...
patifon's user avatar
  • 11
1 vote
2 answers
19 views

What is the typical convention when referring to items on the top of the stack?

Question: I've been working a lot with op codes recently, writing explainer content primarily. I've been finding it awkward to refer to the top and second from the top item in the stack. Is it ...
Equious's user avatar
  • 11
1 vote
0 answers
48 views

how to buy bsc tokens with high tax using web3.py

heres the function i have to try and buy a token with 15% tax on a bsc tokenToBuy = web3.to_checksum_address(tokenAddress) spend = web3.to_checksum_address("...
blockchainhelpneeded's user avatar
1 vote
1 answer
58 views

Fixing programatically trx intrinsic gas too low on Arbitrum

I am trying to simply approve spending of a token by uni router like that: MAX_APPROVAL_HEX = "0x" + "f" * 64 MAX_APPROVAL_INT = int(MAX_APPROVAL_HEX, 16) params = { 'from': ...
Nicolas Rey's user avatar
1 vote
0 answers
122 views

Decoding Result Struct from tryAggregate3 Multicall3 with web3.py

Hello Ethereum StackExchange community, I'm currently working with the Multicall3 contract's tryAggregate3 function which returns an array of Result structs with the following format: struct Result { ...
Baraa's user avatar
  • 11
1 vote
0 answers
123 views

Can we rely on 1inch Swap API price feeds

It is not clear to me how 1inch swagger API is getting the prices from different dexes. Can we rely on them? As they are not open-sourced. I tried using the aggregator but faced this issue RPC timeout ...
Saikat Karmakar's user avatar
1 vote
0 answers
275 views

Function invocation failed due to no matching argument types web3 python

I am trying to access smart contract but its returns Could not identify the intended function with name createEscrowOrder, positional arguments with type(s) int,address,float and keyword arguments ...
Hassan ALi's user avatar

1
2 3 4 5 6