Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Oct 17 21:37
    fselmo commented #2175
  • Oct 17 15:39
    Harmouch101 commented #2175
  • Oct 17 13:07
    akcelero commented #2175
  • Oct 17 12:48
    its5Q commented #1087
  • Oct 16 14:35
    kommalyskb edited #2184
  • Oct 16 13:53
    kommalyskb commented #2184
  • Oct 16 13:48
    kommalyskb opened #2184
  • Oct 15 16:26
    EddyDomingo commented #2183
  • Oct 15 15:36
    kclowes commented #2181
  • Oct 15 15:34
    hotbroker commented #2181
  • Oct 15 15:29
    kclowes closed #2181
  • Oct 15 15:29
    kclowes commented #2181
  • Oct 15 15:11

    kclowes on master

    Clean up `elif` statement (#217… (compare)

  • Oct 15 15:11
    kclowes closed #2179
  • Oct 15 15:10
    kclowes edited #2179
  • Oct 15 15:09
    kclowes closed #2183
  • Oct 15 15:09
    kclowes commented #2183
  • Oct 15 09:51
    liusirsir commented #1928
  • Oct 15 01:40
    minhvutnt commented #2056
  • Oct 15 00:36
    sammiee5311 commented #2179
Popoola Boluwatife
hi guys, if a contract is deployed on a testnet like ropsten, can it use the interface of another contract on say kovan?
@Prometheo as far as i know both are different blockchain are theres no crosschain between them, i think you will need to deploy that contract on ropsten
@mxito3 牛啊,电子科大的
when call function "kswap_txn = contractbuy.functions.swapExactTokensForTokens(
(int(time.time()) + 10000)
I got this error info:Found 1 function(s) with the name swapExactTokensForTokens: ['swapExactTokensForTokens(uint256,uint256,address[],address,uint256)']
how can i handle this , please help me out
Is it possible to sign txes with a forked version of mainnet?
Alexei Panin
hi, I am quite a newby in crypto development, can anyone share with me a macro flow of how do I get a list of newly published contracts on BSC? Ex. How poocoin lists this: https://poocoin.app/ape
if there is any snipet of code, it would really help.
@AlexeiPanin_twitter i've never done that but you could somehow track bscscan verified contracts (there's a section where all the new contracts are shown) , if that's not enough you may download geth or openethereum and run a local node to track transactions inside blocks and check for contract creation
Justin C Presley

Hey, new to crypto development like Alexei. Information about Ethereum blocks are made publicly available to everyone right? Just not the contents unless you have relevant keys for it?

How could I see the most recent block that was posted using web3.py? I looked at the examples. Are there general publicly-available providers?

Felipe Selmo
@justincpresley connecting to something like Infura, atm, is a decent way to do this... rather than running your own node
once you have that instance, you can use the eth module and get the latest block: web3.eth.get_block('latest')
Justin C Presley
Has someone mapped out (formed an equation) relating to how long a block is going to take to mine? (using the block number / difficulty/ etc)? From the graphs Ive seen, it looks like there are 'events' that cause a drop in block time... Do you think the average block time will stay around 13 seconds? even after 2.0?
Ben Larson
@ismaventuras do you have a topic hash for contract creation?
Hey, I just started playing around with web3.py and seeing I need to sign a transaction with my private key in order to write to the contract. Im using an Infura URL. Is this a safe way to do this? Can someone else see the private key being signed and then have access to my wallet?
1 reply
having a heck of a time with eip-1559 gas updates and trying to "zero out" a wallet. I have a bunch of addresses in my app (each object/instance gets assigned a unique address generated via hdwallet - I want to essentially sweep all the funds out but I can't figure out how to configure things so that balance is 0
there's always some dust left over
been searching and reading threads via "london", "eip-1559", and "maxPriorityFeePerGas"/"maxFeePerGas" - not a whole lot of info so far
anyone know how to do this? (sweep all the funds without leaving dust behind)
1 reply so far was that this isn't possible with eip-1559
cest la vie....back to legacy until that's sorted
i have installed web3 using pip but when I am importing it using from web3 import Web3; It was throwing error ImportError: cannot import name 'Web3' from 'web3'. Can i help me? pls
1 reply
<carver> Right, a web3/ folder or a web3.py file would cause that problem.
Yash Shah
Hey everyone,
Is there an equivalent of callStatic in web3.py?
@yashnaman You can do an w3.eth.call with a state override, that I think is similar. The web3 docs are here: https://web3py.readthedocs.io/en/stable/web3.eth.html#web3.eth.Eth.call and the geth docs are here: https://geth.ethereum.org/docs/rpc/ns-eth#3-object---state-override-set
And here's a periodic reminder that there's a discord channel that is more frequently monitored: https://discord.gg/GHryRvPB84
hey, I saw it should be possible to sign EIP-1559 transactions but somehow I cant get it to work, still getting "Transaction must include these fields: {'gasPrice'}" for w3.eth.account.sign_transaction(). I'm on 5.23.1
Felipe Selmo
hey @5fiftyseven7. We are working on making this user experience better very soon but for now you need to pass in an explicit type: 2 or type: '0x2' (either one works) for the transaction. This should be in the documentation.
iam sending the following trx
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://data-seed-prebsc-1-s1.binance.org:8545/'))
owner_address = '0xblabla'
contract_address = '0xblabla'
with open('Staking.abi', 'r') as file:
    abi = file.read()
contract_instance = w3.eth.contract(address=contract_address, abi=abi)
nonce = w3.eth.get_transaction_count(owner_address) 
'chainId': 97,
'gas': 70000,
'maxFeePerGas': w3.toWei('5', 'gwei'),
'maxPriorityFeePerGas': w3.toWei('1', 'gwei'),
'nonce': nonce,

private_key = "0xblablablablabla"

signed_txn = w3.eth.account.sign_transaction(txn, private_key=private_key)



but i keep getting "ValueError: {'code': -32000, 'message': 'transaction type not supported'}"
any idea what im doing wrong
<Keri Clowes (kclowes)> Unless you're using the latest version of web3 (v5.24.0) you'll need to pass in type: '0x2' with the transaction params

for connecting to ganache

ganache_url = ""
web3 = Web3(Web3.HTTPProvider("ganache_url")) 
chain_id = 5777
my_address = "0x81B71104edd0838a0fcB47ea02d377c41BA764Af"
private_key = os.getenv("PRIVATE_KEY")

# Create the contract in python
SimpleStorage = web3.eth.contract(abi=abi, bytecode=bytecode)

# Get latest transaction
nonce = w3.eth.getTransactionCount(my_address)
web3.exception.CannotHandleRequest: could not discover provider while making request: method:eth_getTransactionCount
Can someone assist with following error when attempting to return nonce
Looks like you have a typo: w3.eth should be web3.eth for the nonce line
1 reply
i can't install web3
I need help

but i keep getting "ValueError: {'code': -32000, 'message': 'transaction type not supported'}"
any idea what im doing wrong

any thoughts?

<Felipe Selmo (fselmo)> That message is coming from your client. Have you tried adding type: '0x2' as was suggested above? Beyond that I would check your provider's expectations for building transactions.
Carlos Feliciano
Question: What tools are you currently using to monitor dapp performance or just monitor general blockchain metrics for your dapp? If any at all?
I’m interested in building out a small monitoring suite tool for dapps and wanted to get feedback from devs :)

but i keep getting "ValueError: {'code': -32000, 'message': 'transaction type not supported'}"
any idea what im doing wrong

How do i diagnose this issue

Rocky Chen

Given an address (e.g., 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8), what is the optimal way to get its contract name (UniswapV3Pool) and the associated tokens' ticker symbols (USDC and WETH)?

I'm able to get WETH using the token1 address (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2), but I don't see a symbol attribute for the token0 address. Also had no luck with getting the contract name (UniswapV3Pool)

^fwiw, I was able to easily get the same information (contract name and associated token tickers) from UniswapV2 contract address (https://etherscan.io/address/0x94b0a3d511b6ecdb17ebf877278ab030acb0a878#readContract)
Eshin Kunishima
Hello, can I retrieve the address from the private key with web3py?
4 replies
hi guys, i am pretty new with web3. I want to know if is possible to interact a contract which we dont have abi. But we now the method ID and only 1 argument as uint 256