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
0 answers
25 views

Etherscan API doesn't return internal transaction (although it has)

Here is transaction https://etherscan.io/tx/0x33e0dab83aa27ba8b2a08b3c69d61a34911a4adb6e7a35dd30cf11383f43fcc3 with simple Transfer() some GALA tokens. Etherscan shows 1 internal transaction: But it'...
sirjay's user avatar
  • 111
0 votes
1 answer
37 views

Why Etherscan's API missing ABI functions?

Here is transaction https://etherscan.io/tx/0x0db6f8036ca7ea58bf4a8799bbf62bb30e3431d644d37d4030c27ac0d22f7542#eventlog In logs we can see 3rd function SendToInjectiveEvent(). It is interaction with ...
sirjay's user avatar
  • 111
1 vote
1 answer
49 views

Ethereum transactions: how decode already decoded input data?

Here is transaction https://etherscan.io/tx/0x1a70dafba58e5cbc10adecb18e2489613b298a4aab0ecb2cbbbfd2ba184cdc39 It makes Swap 0.095 ETH for 1,125.066 VDO on Uniswap V2. If to scroll down, press More ...
sirjay's user avatar
  • 111
1 vote
0 answers
31 views

How do I derive public key from mnemonic (StarkNet)

I have some problem with that, since StarkNet is so different from evm. I be gratefull for any docks or article about this.
big-fat-rat's user avatar
1 vote
0 answers
34 views

Transaction stuck and blocking any new transactions, but changing node provider solved it. Why?

Can someone please help me understand what just happened, so I and others can account for this in error handling? I was using web3.py to swap USDC for WMATIC through the UniswapV3 Router on Polygon ...
Skeppet's user avatar
  • 111
0 votes
0 answers
13 views

Could not transact with/call contract function, is contract deployed correctly and chain synced [closed]

# from medilcal import contract_abi,contract_bytecode from web3 import Web3, HTTPProvider import web3 import json from eth_account import Account from web3.contract import Contract import json from ...
Ankit Pathak's user avatar
2 votes
0 answers
22 views

1inch spot price aggregator fails for some historic blocks but not others

I am trying to price arbitrary ERC-20 tokens at past blocks, and it turns out this is a challenging problem. Currently, I query the Uniswap v3 subgraph at a past block, but this doesn't always return ...
Cooper Maira's user avatar
0 votes
1 answer
70 views

Disconnected from ETH websocket after timeout error [Python]

i'm trying to listen to eth websocket using python's web3 library, particularly listening to log events. async def ws_v2_subscription_context_manager_example(): while True: try: async with ...
germor197's user avatar
0 votes
1 answer
52 views

Token Balance not changing after simulating swap on uniswap v2

Hi I am trying to mock the process of buying and selling token through uniswap v2 router. I start with a local network fork anvil --fork-url https://mainnet.infura.io/xxx Then I have to do 2 things ...
newbiesolidty's user avatar
0 votes
2 answers
32 views

MethodUnavailable(error) when shifting from Ganache to Sepolia Testnet

I previously used Ganche to deploy a solidity contract in python with web3py and it worked with given http provider & account details. But now I want to deploy the flask application that connects ...
Anushka.N12's user avatar
1 vote
1 answer
37 views

Uniswap web3 py buy token fails with execution reverted

I have been trying to buy tokens on uniswap V2 with we3 py with swapExactETHForTokens function. Every time, I try to execute this method it fails with execution reverted message. Can somebody please ...
user130198's user avatar
0 votes
2 answers
65 views

Token swap not working on uniswap v2

I am trying to use web3 to swap tokens in uniswap. My swap ( ETH -> Token) is working correctly, but for some reason the reverse swap ( Token -> ETH) does not seem to work. I am not able to find ...
user130198's user avatar
2 votes
0 answers
21 views

How to create a "Transaction history" part of a Wallet App?

guys! Right now I am working on web3 project, which has a wallet as it's one parts. Can you give me advices on how to create this Transaction History for user, because I am kind of stuck on it. First ...
Kind_Man's user avatar
0 votes
1 answer
49 views

How to get raw transaction from v, r, s signature

My question is what would convert transaction fields r, s, v to rawTransaction. Can I see a transaction in the mempool and get its signature and raw? here is an example vrs: raw = ...
404's user avatar
  • 33
0 votes
1 answer
36 views

web3py Force send eth transaction at the same block without conformation or any errors

My question is how to force send a transaction via web3 or any other way without paying attention to errors. I know that I will pay for the commission if I am not successful and that will suit me. I'm ...
404's user avatar
  • 33
1 vote
0 answers
28 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
0 votes
0 answers
20 views

how to connect wallet to dapp using python [duplicate]

I'm looking for example code to connect a wallet to the dapp website, but I can't find it. I want to use Metamask to implement the process of pressing “connect wallet” on a dapp and signing with ...
정승원's user avatar
0 votes
1 answer
65 views

How is signing a hash different from signing a message?

I've got an Arduino microcontroller (ATmega328P) where I can use the following code (borrowed from here) snippet to sign an arbitrary message . First, I take the keccak256 hash of the message, and ...
Ryan's user avatar
  • 92
2 votes
0 answers
97 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
0 votes
0 answers
54 views

getting all addresses for active lenders in aave v3

specifically right now im looking at avax liquidity pool, heres what i've tried so far from using the avax address in https://docs.aave.com/developers/deployed-contracts/v3-mainnet/avalanche: from ...
adiligentlearner's user avatar
0 votes
1 answer
64 views

Trouble making UniV2 swap on Sepolia with web3py

I'm using the below code to try and make a swap on Sepolia. I've got ETH in my wallet and have found a token that has had liquidity added. Depending what I set the minOutput to I get 'Fail with error '...
stooks's user avatar
  • 11
0 votes
1 answer
26 views

Place a Bear Bet via Pancakeswap Predictions

I'm pretty new to using Python to interact with smart contracts. I've been trying to make a short and simple python script that will interact with Pancakeswap's prediction market contract and place a ...
dbakathaillist's user avatar
1 vote
1 answer
126 views

Good resource for web3 developer [duplicate]

I'm new to Web3, basically just started by yesterday. As a new web3 developer, I'm finding really hard to start. The document from Ethereum or any are not easy to follow. I wonder do you have any good ...
Phill Jonny's user avatar
1 vote
2 answers
73 views

Sign a transaction without loading full private key

It is possible to sign a transaction by doing: from eth_account import Account import web3 as Web3 web3 = Web3() my_private_key = Account.from_key('0x...') signed = web3.eth.account.sign_transaction(...
Ryan's user avatar
  • 92
0 votes
1 answer
53 views

Web3. 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 ...
404's user avatar
  • 33
0 votes
0 answers
24 views

web3 python exactInputSingle keeps failling

I Am trying to make a swap on uniswap using its routerV3's exactInputSingle function like this: from web3 import Web3, HTTPProvider from web3.gas_strategies.time_based import fast_gas_price_strategy #♦...
Nicolas Rey's user avatar
0 votes
1 answer
15 views

getting error nonce too low while using web3.py with an aws lambda function

I have quite an issue here. I have a web3 py script for integration. It works perfectly on my local machine and also interacting with the smart contract directly from testnet. The problem is, on AWS ...
thewebplug's user avatar
0 votes
1 answer
26 views

Ganache doesn't return tx.origin

web3 6.12.0 solc-v0.8.23 Python 3.12.1 Ganache v2.7.1 I've deployed this contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract TestContract { address public myAddress; ...
bordolot's user avatar
0 votes
0 answers
25 views

How to check if an ens name is valid or not

How can I check if an ENS domain name is correct or not? I would like to know how they are being calculated. I mean what are the standard rules. Here is web3.py output. In [1]: from ens.utils import ...
Saikat Karmakar's user avatar
1 vote
0 answers
10 views

Is brownie supporting OpenZeppelin/[email protected]?

I got the following answer after runing brownie pm install OpenZeppelin/[email protected] WARNING: Unable to compile OpenZeppelin/[email protected] due to a AttributeError - you ...
Lalo's user avatar
  • 11
1 vote
1 answer
60 views

Cannot create the same ECDSA signature with Web3.py and ethers.js

I have the following (simplified) contract that uses ECDSA to validate message authenticity: pragma solidity ^0.8.18; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; ...
Sebastian Dine's user avatar
0 votes
0 answers
19 views

Can't call a function from a contract, even though I'm transferring all the data correctly

I Was trying to interact with a smart contract named https://etherscan.io/address/0x609c690e8f7d68a59885c9132e812eebdaaf0c9e and use the function "swapAndBridge", I went ahead and matched ...
StasFQ's user avatar
  • 1
0 votes
1 answer
37 views

TypeError in Nonce [Web3, Python, FlashBot]

Here is the code. When I wrote the private key of sender's address without string, it showed me provide sender's key as string. When I wrote the private key of sender's address in string, it showed me ...
Axaansh Dholiya's user avatar
0 votes
0 answers
16 views

What is the importance of `message Hash` generated from signing using private key

when we are signing a message using our private key what's the use case of the message hash ? Take the example from the eth_accounts module from python. >>> msg = "I♥SF" >>>...
Saikat Karmakar's user avatar
2 votes
0 answers
71 views

web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function

I deployed simple helloworld code and want to call contract function. It must return "Hello World!" My contract is pragma solidity >=0.5.16; contract HelloWorld { ...
IRE's user avatar
  • 21
1 vote
2 answers
75 views

Read Solidity struct with Web3.py

I can use Python to read from contracts using functions like: tx = mySolidityContract.functions.x().call() to read a variable x on mySolidityContract Say I have a struct in my solidity contract, like ...
Eric Falkenstein's user avatar
4 votes
2 answers
1k views

Getting Uniswap v2 latest price and interpreting values using Python

When interacting with functions price0CumulativeLast and price1CumulativeLast of any smart contract on Uniswap V2 I keep getting incomprehensive values. I am not able to figure out how to extract the ...
Aniss Itaoui's user avatar
0 votes
1 answer
93 views

Solidity Event String parameter decoding

The value of aggregatorId in the event emitted by the below tx is not equal to value “oneInchV5FeeDynamic” in the tx? Also, I can’t decode the value emitted in the event “...
Waiz Khan's user avatar
1 vote
0 answers
22 views

Are there any good tools, specifically code packages to checksum eth validator addresses?

Are there any good tools, specifically code packages to checksum eth validator addresses? They are longer than normal Ethereum addresses, and because of that I find the Web3 python library refuses to ...
Bruce's user avatar
  • 937
1 vote
1 answer
189 views

Is there any way to get historical pool data by interacting with the pool smart contract?

I am wondering if there is a function in smart contract pools to get historical data (just last 100 bars for example). thanks guys!
Aniss Itaoui's user avatar
0 votes
1 answer
90 views

can eth_call simulate approve and transfer?

I have a solidity contract that contains a logic to approve and transfer balance, swap and flashloan. But when i use eth_call to call my function that perform swap, it reverts. I tried by ...
Biruk Damte's user avatar
0 votes
2 answers
138 views

Warning! Error encountered during contract execution [execution reverted] when doing a swap using pancakeswap router on bsc testnet

I am unable to do a simple swap, a little help here will be very appreciated : from web3 import Web3 # Binance Smart Chain Testnet node endpoint (e.g., Infura) bsc_testnet_node_url = "https://...
Aniss Itaoui's user avatar
0 votes
0 answers
78 views

Transaction reverts when using custom router contract while swapping tokens to ETH on Uniswap

I am in the process of setting up my own smart contract on the Ethereum network for executing transactions through Uniswap v2. I've come across an issue where all transactions get reverted when the ...
MikeMik's user avatar
0 votes
0 answers
63 views

Swap token directly with UniswapV3 pool

I've researched previous questions, however it does not seems to work out for me, therefore I am asking. I want to swap WETH to USDT on UniswapV3 directly via the pool of both pairs, not through the ...
carlo711's user avatar
  • 101
0 votes
1 answer
35 views

Best way to call Gnosis Safe execTransaction from Vyper / web3.py?

I would like to interface the Gnosis safe execTransaction method in my contract (which is written in Vyper). From what I've understood the execTransaction takes the following arguments (based on a ...
Christian Papathanasiou's user avatar
0 votes
1 answer
69 views

How to make contract transactions with Web3.py

I am getting error while deploying smart contracts with web3.py. The error says "web3.exceptions.ContractLogicError: execution reverted: VM Exception while processing transaction: invalid opcode&...
Narayan Khatri's user avatar
0 votes
1 answer
71 views

Sign_transaction and send_raw_transaction error in Web3.py

I would like to sign_transaction and send raw transaction with custom transaction fields. But I could not do it. Any help will be appreciated. Thanks
Narayan Khatri's user avatar
0 votes
0 answers
121 views

Web3.py exception contract logic error; execution reverted: VM exception

I would like to contract the transactions to solidity compiler and got the following error; raise ContractLogicError(f"execution reverted: {message}", data=data) web3.exceptions....
Narayan Khatri's user avatar
0 votes
1 answer
71 views

In either web3 or ethers, how do I monitor an address' transactions calling specific methods?

I'm trying to monitor an address each time it calls "Transfer" or "Notify Reward Amount". And if there is a match, print the info of said transaction. Both interact with ERC20s. ...
htschvl's user avatar
0 votes
1 answer
30 views

I can´t create a new folder [closed]

I am very busy because I can´t create a simple folder. Remix, I created a new folder but No make anything, and Remix is in no function. I am a new student of remix, can you help me?
Henry's user avatar
  • 11

1
2 3 4 5
19