Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:16
    dshehbaj commented #2052
  • 04:15
    dshehbaj commented #2052
  • 04:14
    dshehbaj commented #2040
  • 04:13
    dshehbaj commented #2052
  • 03:59
    dshehbaj edited #2052
  • 03:59
    dshehbaj edited #2052
  • 03:59
    dshehbaj edited #2052
  • 03:59
    dshehbaj edited #2052
  • 03:57
    dshehbaj edited #2052
  • 03:57
    dshehbaj edited #2052
  • 03:57
    dshehbaj edited #2052
  • 03:56
    dshehbaj edited #2052
  • 03:50
    dshehbaj synchronize #2052
  • 03:46
    KingCreate commented #2043
  • 03:45
    dshehbaj synchronize #2052
  • 03:10
    dshehbaj synchronize #2052
  • 02:45
    dshehbaj opened #2052
  • 02:19
    KingCreate commented #2043
  • Jun 24 17:38
    Moras-del edited #2051
  • Jun 24 17:37
    Moras-del opened #2051
Peteris Erins
@Pet3ris
thanks!
Stefano
@BrokedTV
Hello there, I have been trying to setup a swaptoken for pancake/uniswap for the few hours without success, been getting the following error.
Could not identify the intended function with name `swapExactETHForTokensSupportingFeeOnTransferTokens`, positional argument(s) of type `(<class 'int'>, <class 'list'>, <class 'str'>, <class 'int'>)` and keyword argument(s) of type `{}`. Found 1 function(s) with the name `swapExactETHForTokensSupportingFeeOnTransferTokens`: ['swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)'] Function invocation failed due to no matching argument types.
And i have not been able to found example code to learn from, if anyone has some usefull resouce i would appreciate it a lot.
Marc Garreau
@marcgarreau
@notooth1 web3py requires knowledge of the address and abi. looks like etherscan has an API for verified contracts: https://etherscan.io/apis#contracts

PSA

This channel is infrequently monitored. Please join us in the Ethereum Python Discord server instead: https://discord.gg/GHryRvPB84
notooth1
@notooth1
Can anyone give me a simple example of using web3py to get the contract detail of 0x111111125434b319222cdbf8c261674adb56f3ae?
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<marc> @notooth1 dont like discord huh? 😅 when you say contract detail, what do you want exactly?
Ilyas EL BANI
@ilyasELBANI
anyone knows how to use swapETHForExactTokens ?
notooth1
@notooth1

<marc> @notooth1 dont like discord huh? 😅 when you say contract detail, what do you want exactly?

I want to get the transactions in the contract. I asked this question in discord, but I didn't get the answer.

Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<marc> @notooth1 re: discord, you mightve forgotten to hit 'send', because a server search shows you entering and no further activity. re: pending txs of a specific contract, there's no native web3 api for this; youll need to filter through pending txs for items you care about. there may be a 3rd party API that can do this for you, not sure.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<marc> @notooth1 ah, if youve updated the question to be for all transactions, not pending, there's still a similar answer: no native api. its up to you parse each block for txs you care about. typically ppl will store what they need in some local db to avoid requerying, picking up from their most recent block queried. another typical way to get this sort of data is to filter for specific events you're interested in. a contributor recently added a robust example of a token transfer scanner here: https://web3py.readthedocs.io/en/latest/examples.html#advanced-example-fetching-all-token-transfer-events
t-anyu
@t-anyu
Aargh! How should I decode transaction receipt logs? Especially when there's multiple log entries associated with different contracts and call functions. I can get each log entries ABI by address, and then reconstruct it from topics, etc. etc. But there s gots to be an easier way! Any tips? Thanks
On Web3js they have access to solidity decoders, but I think there's no such option in Web3py
Pi
@p-i-
@BrokedTV That's a function signature mismatch. Look at the signature it requires, and the params you are actually sending in.
billu14
@billu14
hi, first time user here. i am getting following error ('str' object has no attribute 'request_func'), when trying to create an event filter (contract.events.Borrow.createFilter(fromBlock="latest")). Any tips? (let me know if need any more detail, thanks)
Pi
@p-i-
@ilyasELBANI
        2021-06-07 Buy Token on pancake
            https://www.youtube.com/watch?v=4fRAuWHPCPE&t=192s&ab_channel=CodeWithJoeCodeWithJoe
            https://github.com/CodeWithJoe2020/pancakeswapBot/blob/main/cakebot.py

        https://github.com/CodeWithJoe2020/pancakeswapBot/blob/main/cakebot.py


        2021-06-09 Sell Token on pancake
            https://www.youtube.com/watch?v=ehWDvw0jMzo&ab_channel=CodeWithJoeCodeWithJoe
            https://github.com/CodeWithJoe2020/sellTokenPancakeSwap/blob/main/sell.py

        https://github.com/CodeWithJoe2020/sellTokenPancakeSwap/blob/main/sell.py
Pi
@p-i-
I noticed a push to Discord
One SUPER useful feature of gitter is that it is google-indexed.
I am frequently finding tremendously valuable information in this channel log from Google searches.
romeoo29
@romeoo29
Alex Weber
@alexweber:matrix.org
[m]
Hello, How are you? I have some ask. Could you have to ask? I am using web3py to get the pending transactions. But I have an error like this. "Transaction with hash: {transaction_hash!r} not found." What does the main reason for this error?
Alex
@hbcg0323
@Eric and @Jason Carver
I have some asks.
I am using web3py to get the pending transactions. But I have an error. Transaction with hash {transaction_hash} not found. @Eric and @Jason Carver ! Help me! I can't this an error. What does mean?
Pi
@p-i-
@hbcg0323 You'd need to post some code, no? That error seems to speak for itself... did you look up transaction_hash on bscscan to check it exists?
Alex
@hbcg0323
I got transaction hash, But I cant found on ethersscan.io
Pi
@p-i-
@hbcg0323 What blockchain? If it's BSC you need bscscan...
Alex
@hbcg0323
I am working on ethereum. So I can't on BSC.
Alex
@hbcg0323
I need to swap for uniswap. I can make transactions. But I can't transaction. I am using sendRawTransaction or sendSignedTransaction. But I have errors. Attribute error. What reason?
Pi
@p-i-
@hbcg0323 One of the things you passed in isn't right.
You need to look at the ABI & check the expected func-sig.
Alex
@hbcg0323
Thank you for your response. ABI isn't right, You are right. Thank you very much. If I have some problem, I will be looking for you. How about it?
KaiRo
@kairo:mozilla.org
[m]
I just realized that with London, as transaction semantics change, this may break existing code dealing with transaction data - is Web3.py ready for London transactions?
Marc Garreau
@marcgarreau
@KaiRo close; theres now a london branch up thats most of the way there. please feel free to build from source and use the repo to test it out when london is live on testnets. feedback/bug reports appreciated.
2 replies
KaiRo
@kairo:mozilla.org
[m]
ah, ok.. good to hear that there's great progress for sure!
mintblock
@mintblock
hi - Is there a small library I can install and use to listen for events or query for account balance. Something small and light weight that I can use in MicroPython for a micro controller board?
thank you
looking for a library I can use on an ESP32 board
I tried installing web3.py but it did not work. I think it is too big for the arduino board
Alex
@hbcg0323
How to get a pair to swap two tokens in uniswap using python?
@p-i-
KaiRo
@kairo:mozilla.org
[m]
Oh, hrm, one thing I did not expect is that all contract interactions on Ropsten are now broken due to London
on any .call() I get ValueError: {'code': -32015, 'message': 'Transaction execution error.', 'data': 'GasPriceLowerThanBaseFee { gas_price: 0, base_fee: 151416558155 }'}
Do I need a build from the london branch to get this to work?
KaiRo
@kairo:mozilla.org
[m]
I guess there is no way to get london from pip so far, so I will need to figure out building manually? That surely will be even harder for our docker containers, but I need a solution today as we need to be able to continue doing some testing with Ropsten (and right now basically nothing works due to that error stated above)
KaiRo
@kairo:mozilla.org
[m]
OK, that problem seems to be OpenEthereum as it works with Infura
Marc Garreau
@marcgarreau
correct, no web3.py london via pip yet. i dont have much experience with docker, but cant you just build a branch by tacking on #branch-nameto the build source? also all dev was done against Geth since OE is getting sunset after london
KaiRo
@kairo:mozilla.org
[m]
I know it's going to be sunset, I hope Erigon will be ready enough once we need to actually switch. That said, I found my code works fine against Infura or Geth even with current web3.py that has no specific London support yet.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<Marc Garreau (wolovim)> Great; if you send transactions without a gasPrice, maxFeePerGas or maxPriorityFeePerGas, theoretically Geth will find reasonable values for those, and web3 will add additional configurability
KaiRo
@kairo:mozilla.org
[m]
where we send them, ourselves, we send a gas price - but on Ropsten, blocks are usually not full and it shouldn't matter much if we send legacy or 1559 transactions
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<Marc Garreau (wolovim)> glad to hear. for future optimization, you can expect legacy transactions to be the more expensive of the two.
KaiRo
@kairo:mozilla.org
[m]
sure
Marc Garreau
@marcgarreau
oh @KairRo, forgot this was a thing:
$ pip install https://github.com/ethereum/web3.py/archive/london.zip
KaiRo
@kairo:mozilla.org
[m]
oh, that sounds interesting if I need it :)