New answers tagged web3.py
0
votes
Error: Transaction's maxFeePerGas (0) is less than the block's baseFeePerGas (527514873)
Extending on GitHub20292's answer. You need to add maxFeePerGas (JS) or max_fee_per_gas (Python) whenever you're sending or signing a transaction.
Example (for Web.js)
const block = await web3.eth....
0
votes
What is the best practice of a Dapp development mixed with Python/Django?
You can use web3.py to connect your smart contract to your backend.
web3.py quick start: Link
and also you can check this walk through article to create a Python Dapp: Link
0
votes
How to differenciated between ERC20 transactions and normal transaqctions when getting raw transactions using web3
Etherscan and other block explorers rely on the events that contract emit to categorise transactions as token transfers like ERC20/721/1155.
In your case, you can do the same. Check the logs of ...
0
votes
Block Timestamps vs. Received Timestamp
I also found it doing precisely the same analysis,
I think the reason is:
Taking the next blocks as an example:
Block #, Received Timestamp, Block Timestamp
7452987,1553721232,1553721231
7452988,...
1
vote
Accepted
How to Multicall a non contract function in web3 python?
I will give you an example.
Imagine you want to get balances of 100 addresses.
There are two general options:
Your Backend/Frontend calls blockchain a 100 times.
You write a SmartContract function ...
0
votes
How do I call functions from 'Read as proxy' on smart contracts?
You have to use the address of main contract and ABi of proxy contract to use main functions of these kind of smart contracts
0
votes
Accepted
What should I do to see the number of outgoing tokens in the transaction hash?
I'm sorry this is not an answer per-se, but I do not have enough reputation to comment.
To see such information, you can check the transaction on a block explorer like bscscan or etherscan depending ...
0
votes
How do I get the implementation contract address from the proxy contract address?
When using Hardhat to deploy an upgradable contract, we could use erc1967 to get the implementation and admint contract.
const UpgradeableFactory = await ethers.getContractFactory(
"...
0
votes
Web3.py Transaction Keeps Timing Out
This is the code I use for transfers, I just tested it and it works on Goerli.
I already put your addresses in "sender" and "receiver", just missing the private key that you can ...
0
votes
How to get the contract binary using web3.py?
You can do so by using the following method: web3.eth.get_code('0x6C8f2A135f6ed072DE4503Bd7C4999a1a17F824B')
Ref: https://web3py.readthedocs.io/en/stable/web3.eth.html#web3.eth.Eth.get_code
0
votes
Wait for a transaction to be mined ends too soon
All is working perfectly, but when I poll my wallet (a metamask wallet) just after the reception of the receipt, the balance is unchanged and it causes me some headaches. Do you know why the account ...
0
votes
Failed token purchase transactions on uniswap with web3.py
I think the problem is that you are using the factory contract instead of the router. Take a look at this code, with comments!
Note that I did not specify the token to buy, and this is based on ...
0
votes
web3.py: contract.events.Transfer().processReceipt - Buy vs Sell?
This cracked the case:
from web3 import Web3
from web3.logs import DISCARD
EIP20_ABI = '[{"constant":true,"inputs":[],"name":"name","outputs":[{"...
0
votes
web3.py: contract.events.Transfer().processReceipt - Buy vs Sell?
There is no concept of buy and sell on trade level. Both of the below are equivalent:
Buying SIMPLE with USDC
Selling USDC for SIMPLE
For the human readable buy and sell labels, you need to come up ...
0
votes
How the centralized exchanges handle deposits?
I guess using CREATE2 opcode and using selfdestruct() after every deposit is more cost efficient than creating a bulk of contracts when gas price is low.
0
votes
Failed token purchase transactions on uniswap with web3.py
Try this code :
Contract_Address = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
from web3 import Web3
import json
from dotenv import load_dotenv
import time
import os
from web3.middleware import ...
0
votes
Send different values of eth to multiple different addresses
I fixed your script abit.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract PayMultiple {
function pay(address[] memory payees, uint[] memory values) public payable{
require(...
1
vote
Accepted
How to find a pancake pair creation date using web3 library?
PancakeSwap, like other Uniswap v2 clones, posts PairCreated event every time a new pair is added. The creation date is the timestamp when the block containing this event, and its transaction, was is ...
Top 50 recent answers are included
Related Tags
web3.py × 816python × 245
solidity × 149
web3js × 142
go-ethereum × 88
transactions × 69
etherscan × 42
brownie × 39
infura × 38
blockchain × 36
events × 34
ganache × 31
pancakeswap × 31
erc-20 × 28
uniswap × 26
contract-development × 25
bsc × 25
tokens × 23
ether × 23
contract-invocation × 21
abi × 17
web3-providers × 16
polygon × 16
remix × 15
metamask × 14