Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
@Prometheo
hi guys, if a contract is deployed on a testnet like ropsten, can it use the interface of another contract on say kovan?
ismaventuras
@ismaventuras
@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
giftedchen
@giftedchen
@mxito3 牛啊,电子科大的
giftedchen
@giftedchen
when call function "kswap_txn = contractbuy.functions.swapExactTokensForTokens(
int(amountIn),
int(amountOutMin),
[fromToken,toToken],
sender_address,
(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
Darruma
@Darruma
Is it possible to sign txes with a forked version of mainnet?
Alexei Panin
@AlexeiPanin_twitter
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.
ismaventuras
@ismaventuras
@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
@justincpresley

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
@fselmo
@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
@justincpresley
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
@Benerman_gitlab
@ismaventuras do you have a topic hash for contract creation?
D34thSt4lker
@D34thSt4lker_twitter
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
lza_menace
@lza_menace_twitter
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)
lza_menace
@lza_menace_twitter
1 reply so far was that this isn't possible with eip-1559
cest la vie....back to legacy until that's sorted
kuro
@trikoemon_kuro_twitter
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
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> Right, a web3/ folder or a web3.py file would cause that problem.
Yash Shah
@yashnaman
Hey everyone,
Is there an equivalent of callStatic in web3.py?
https://docs.ethers.io/v5/api/contract/contract/#contract-callStatic
kclowes
@kclowes
@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
5fiftyseven7
@5fiftyseven7
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
@fselmo
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.
iamashwin99
@iamashwin99
iam sending the following trx
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://data-seed-prebsc-1-s1.binance.org:8545/'))
w3.isConnected()
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) 
txn=contract_instance.functions.updateAllocation(50).buildTransaction({
'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)

signed_txn.hash

signed_txn.rawTransaction

w3.eth.send_raw_transaction(signed_txn.rawTransaction)
but i keep getting "ValueError: {'code': -32000, 'message': 'transaction type not supported'}"
any idea what im doing wrong
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<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
Astrobitch
@Astrobitch

for connecting to ganache

ganache_url = "http://127.0.0.1:7545"
web3 = Web3(Web3.HTTPProvider("ganache_url")) 
chain_id = 5777
my_address = "0x81B71104edd0838a0fcB47ea02d377c41BA764Af"
private_key = os.getenv("PRIVATE_KEY")
print(private_key)

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

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

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

any thoughts?

Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<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
@gtlpanda
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 :)
iamashwin99
@iamashwin99

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

How do i diagnose this issue

image.png
Rocky Chen
@chenrocky

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
@mikoim
Hello, can I retrieve the address from the private key with web3py?
4 replies
xia4991
@xia4991
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