New answers tagged

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....
user avatar
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
user avatar
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 ...
user avatar
  • 314
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,...
user avatar
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 ...
user avatar
  • 775
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
user avatar
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 ...
user avatar
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( "...
user avatar
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 ...
user avatar
  • 386
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
user avatar
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 ...
user avatar
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 ...
user avatar
  • 386
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":[{"...
user avatar
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 ...
user avatar
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.
user avatar
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 ...
user avatar
  • 1
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(...
user avatar
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 ...
user avatar

Top 50 recent answers are included