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

Can't run multiple async loops in parrallel

I have an async loop defined as follows and running on a poll intervall: async def log_loop(event_filter, poll_interval): while True: for Transfer in event_filter.get_new_entries(): ...
user avatar
0 votes
0 answers
15 views

How to run a multithread and async loop in Web3.py to monitor the same event on multiple smart contracts?

I am trying to monitor similar events on different (>=2) Ethereum contracts in web3.py. In the code below I try to monitor the Transfer event on wETH and wBTC smart contracts. Since create filter ...
user avatar
0 votes
0 answers
9 views

On swapExactTokensForTokens getting execution reverted: Pancake: K

I try to do a cyclic swap on Pancakeswap and get the following error execution reverted: Pancake: K I am not sure what is happening here. Basically I try to do the following swap path ['WBNB', 'USDC', ...
user avatar
  • 101
0 votes
0 answers
5 views

Get Limit Price from thegraph limit price order

Trying to get price from limit order that was been summited to contract but when call theGraph query: https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-fantom-ii/graphql, I getting ...
user avatar
  • 101
0 votes
1 answer
24 views

swapExactTokensForTokens estimateGas fails with execution reverted

I'm trying to swap a pair not having wbnb on pancakeswap. For ex. BUSD -> LUNA. As far as the pair doesn't have wbnb I use swapExactTokensForTokens (meanwhile WBNB -> BUSD with ...
user avatar
0 votes
0 answers
17 views

How to create using Mnemonic in Web3.js? [duplicate]

I want to create an account with mnemonic in WEB3.JS I tried using web3.eth.accounts.create() but the only argument is entropy and it returns only { address: "", privateKey: "&...
user avatar
0 votes
1 answer
12 views

Is it possible to buy NFTs on opensea using web3py

Is it possible to buy NFTs on opensea using web3py, if so is there any good resources ? I would imagine it would be interacting with opensea's smart contract right ?
user avatar
0 votes
0 answers
5 views

Error While trying to deploy smartcontract via ganache-cli

How do I solve error concern timeout, I tried all. I closed and restarted my system but I'm still getting Timeout error, below is the error: at Timeout._onTimeout (C:\\Users\\USER\\AppData\\Roaming\\...
user avatar
1 vote
1 answer
11 views

What `to` should be set when deploying contracts?

I'm deploying contract using eth_sendTransaction and compiled bytecode. So for example my transaction is: { from: "0x0000123...", data: "0x6000...", gas: "0x9999"...
user avatar
  • 81
0 votes
1 answer
21 views

Get the 'from' address of a transaction from the smart contract event log?

I want the address of the wallet interacting with the smart contract (the 'from' address in the tx receipt). I can get the smart contract event and parse the event log in the below code but ideally I ...
user avatar
  • 11
0 votes
1 answer
11 views

Get Transaction details using Python

I'm trying to get details of a given transaction (Datetime, Sender, Receiver, Name of Token Transerref, quantity). This is an example. I don't know any API or method can allow me to get these data. I ...
user avatar
0 votes
1 answer
21 views

Force two transactions in the same block to pay fees from another account [duplicate]

I got two wallets on the BSC. The first one (walletA) is empty of BNB but has access to another token, say TOKENX, and the second one (walletB) has BNB. What I want to do, is tranfer some TOKENX from ...
user avatar
0 votes
0 answers
17 views

How to get the minimum and maximum int value from web3.py?

I'm developing in brownie and would like to pass the max/min int{n} where n = i*8 and 1 < i < 32 to my function calls. How do I get those values using web3 or another python library that is ...
user avatar
  • 170
1 vote
0 answers
29 views

How to listen for multiple smart contract events?

Using Web3.py I understand that I can create a new smart contract event filter with: Contract.events.your_event_name.createFilter(fromBlock=block, toBlock=block, argument_filters={'arg1': 'value'}, ...
user avatar
  • 11
0 votes
1 answer
21 views

How to get ERC standard of tokens in a transaction from transaction hash?

Is it possible to get the ERC standard of tokens in a transaction from transaction hash? Etherscan provides the list of tokens and the token standards as shown in the image when we search using ...
user avatar
  • 101
0 votes
1 answer
152 views

web3.py get_transaction status, amounts in/out, sender/receiver address, transaction_type (Swap? Mint? Burn?), gasUsed etc

I am having trouble interpreting transaction from web3.py w3.eth.get_transaction Take this as example, it's a Swap transaction for example: Swapping USDT for USDC, then USDC for SINGLE https://cronos....
user avatar
0 votes
1 answer
119 views

web3 + Liquidity Pool on CRONOS chain: How to you fetch all transactions (swap, mint, burn) of a Liquidity Pool?

How to you fetch all transactions (swap, mint, burn) of a Liquidity Pool? I searched up and down found this. However, it's making a REST call to Polygon API. Is there a way to do this strictly using ...
user avatar
0 votes
1 answer
59 views

How to call certain solidity function based on python function parameter

I was wonder if it's possible to call a smart contract function based on a parameter sent to my function caller. From some research I did, i was able to find a function called getattr(). I was ...
user avatar
0 votes
0 answers
12 views

Is it possible to buy and sell token in same transaction on 0x

Is it possible to buy and sell token in same transaction on 0x . please show us example code phyton or json
user avatar
  • 1
0 votes
0 answers
38 views

Failed to sell tokens (probably scam but want to make sure)

I was writing a bot to monitor new liquidity pools that open up in pancakeswap and to test it I took already 4 of them and bought it. all of them I couldn't sell, not via code and also not manually. ...
user avatar
0 votes
0 answers
8 views

Interacting with Markets Tomb Pool (Rari) Contract to display balance in Python

I am looking to interact with the Markets (xyz) Tomb Pool (0) to identify the current balance and the available liquidity in the market (so I can subsequently withdraw my funds). This is the code I ...
user avatar
0 votes
1 answer
19 views

Is it possible to retrieve events later on?

The scenario is : There are two participants A and B. A sends a transaction to a Smart Contract and an event (X) is emitted as a result of the transaction. The event is caught (listened to ? ) by B ...
user avatar
1 vote
1 answer
28 views

How can I call a deployed smart contract on Kovan using Python?

The smart contract was written and deployed on Kovan using Remix IDE and injected Metamask Kovan test network account. However, I'll need python to deal with large input of a function in the smart ...
user avatar
0 votes
0 answers
15 views

How do other nodes / devices call methods in a smart contract without knowing ABI?

I am working with web3.py and i realize that i need to supply ABI every time i need to call a method from a smart contract But, if i am not mistaken, on the Ethereum network, most devices can call ...
user avatar
0 votes
0 answers
32 views

How can i convert event data to string?

I am working in a ethereum project and i want to retrieve some data from an event. Let me show the details of what i am trying to do ; event fooev( address indexed sender, address indexed ...
user avatar
0 votes
0 answers
95 views

Error while running pip install web3

This is the error I get every time I run pip install web3 Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ ...
user avatar
0 votes
1 answer
72 views

decodeParameters function python web3?

Is there a function like "decodeParameters" for web3 python? Regards
user avatar
0 votes
0 answers
20 views

Deploy Multiple Smart Contract using web3.py

I am working on a project that has more than one contract in different files. Some of the contracts are dependent on another contract. How to deploy all contracts using web3.py in one go?
user avatar
0 votes
0 answers
5 views

Hyperledger Fabric

I am new to golang and I want to learn and the main reason I am learning golang is for web3 I realized most tools are created using golang. I need to know where to start learning and which tools is ...
user avatar
0 votes
2 answers
32 views

How can I configure Index position of Transaction in the block?

How can I configure Index position of Transaction in the block? web3.py
user avatar
0 votes
1 answer
37 views

Smart Contract - approve function: wad

In context of "Approve" function in smart contract https://cronos.org/explorer/address/0x66e428c3f67a68878562e79A0234c1F83c208770/contracts function approve(address guy, uint wad) public ...
user avatar
0 votes
0 answers
21 views

Retrieving Data from a Mapping Using Web3.py

I am having trouble accessing data from a mapping that I have created on the client-side. My smart contract has 2 functions 1 that sets the values for the mapping. The second one retrieves the values ...
user avatar
0 votes
1 answer
27 views

I am prepared permit EIP712, but tx "Reverted", function selector 'Reverted 0x08c379a

I'm trying to send a permit for a transaction, but I get a function call mismatch return if I call through the smartcontract token function. If I call via encodeABI and add the same arguments, I don't ...
user avatar
0 votes
0 answers
11 views

addLiquidity() to Pool - Calculate Amount0 and Amount1 correct

Hey i want to add Liquidy to a Pool on QuickSwap, but for that i need the correct amount for token0 and token1. How can i calculate this? Iam using javascript and web3 at the moment. This is the ...
user avatar
0 votes
1 answer
18 views

contractLogicError on Web3 but working on Remix

I have this contract code, which works fine on remix, but I cannot run with web3 in python, getting a contractLogicError. // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IERC20 { ...
user avatar
0 votes
0 answers
24 views

What are the input parameters for keccak256?

I'm trying to interact with a smart contract in python. With Metamask i can see, that there is a signature trasferred to verify my wallet. Now the point is how to calculate this signature to use a ...
user avatar
0 votes
0 answers
19 views

Zokrates code not compiling in Remix

I am trying to work on Zokrates in Remix IDE I am trying this code : import "hashes/sha3/512bit" as sha256packed def main(private field value, private field before, field valueHash, field ...
user avatar
0 votes
0 answers
26 views

TimeExhausted Error when calling contract

When I am calling upload_data, everything passes smoothly, but w3.eth.wait_for_transaction_receipt takes forever, and shows following error. def upload_data(self, api_key, api_data): nonce = self....
user avatar
  • 1
0 votes
0 answers
46 views

Tracking token holders and transactions of Ethereum ERC-20 token using Web3.py

I have the following code to get information on an ERC-20 token on Ethereum using Web3.py: from web3 import Web3 infura_url = "https://mainnet.infura.io/v3/" + INFURA_ID web3 = Web3(Web3....
user avatar
0 votes
2 answers
72 views

Web3.py : Eth.estimate_gas method returns always the error when checking two address are equal

Following is the smart contract code, setMessage method always fail with revert while estimating gas using web3.py, even when the address user is same as msg.sender. when the contract is deployed on ...
user avatar
0 votes
1 answer
40 views

i am getting list out of index error while trying to run my lottery smart contract with brownie

PS E:\lottery-smartcontract> brownie run scripts/deploy_lottery.py INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum ...
user avatar
0 votes
1 answer
22 views

Which gets executed faster, a Solidity function or a Web2 backend function?

I have a Solidity function which requires an argument which value should be calculated from a value that I retrieve from my Ethereum node via a Web3 call. Once I have the value I have to pass it to a ...
user avatar
  • 63
0 votes
1 answer
34 views

How to Buy with WBNB instead of BNB

I wish to buy with WBNB. Instead of BNB on selling to WBNB I use swapExactTokensForTokensSupportingFeeOnTransferTokens and it works fine. How can I buy with WBNB? Here is a TX hash with O BNB value ...
user avatar
0 votes
1 answer
85 views

Can't install web3. Following a solidity course

I'm making a course in freeCodeCamp about solidity and blockchain. I came to an issue trying to install web3 and can't figure out why. I've followed some of the steps but as I read on the messages on ...
user avatar
  • 1
0 votes
2 answers
98 views

How to import private key in web3.py

I have the requirement to convert my private key to address and please don't devote me I have searched already I come to across many solution but all are outdate example and really many more but it ...
user avatar
  • 107
0 votes
0 answers
11 views

Does anyone know how to get all the ethereum transaction hashes for a specific year (e.g. 2017) in web3.py and put them into CSV?

Does anyone know how to get all the ethereum transaction hashes for a specific year (e.g. 2017) in web3.py and put them into CSV? <I've tried> ∙ I ran geth locally and synced all the mainnet ...
user avatar
0 votes
0 answers
40 views

How to know the current liquidity of a token in BNB using web3py

How can I know the current liquidity pool value in BNB, My idea to do this is get the total amount of tokens available in the pancakeswap reserve and then equate that amount to BNB. Any help to ...
user avatar
0 votes
1 answer
73 views

web3.py to send a withdrawal in currency other than ETH

How do you send a withdrawal transaction (i.e. transfer from one wallet to another) in currency other than ETH? I been following this youtube from Dapp University here, which is awesome. Example 3 ...
user avatar
0 votes
0 answers
265 views

web3.exceptions.ContractLogicError: execution reverted

Contract #1 is a functioning contract (runs with no issues) Contract #2 is a modified version of Contract #1 with the following changes: Modified exchangeRouterAddress from being hardcoded to being ...
user avatar
0 votes
2 answers
40 views

Can I get more specific metadata for a certain transaction hash from a basic RPC connection (e.g. Infura)

I am trying to deploy a "verifyTx(tx_hash){}" function that takes a hash and tells me the state (succ vs. fail vs. pending), but I was hoping to get more advanced information on the hash if ...
user avatar
  • 101

1
2 3 4 5
16