Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:00
    ytrezq opened #2492
  • May 27 21:37
    carver opened #2491
  • May 27 16:46
    kclowes commented #2489
  • May 27 15:45
    pacrob closed #2490
  • May 27 15:45
    pacrob commented #2490
  • May 27 10:34
    DevTenset opened #2490
  • May 27 00:20
    cwelton opened #2489
  • May 26 20:48
    carver commented #2482
  • May 26 18:16
    pacrob review_requested #2488
  • May 26 18:16
    pacrob review_request_removed #2488
  • May 26 18:16
    pacrob review_requested #2488
  • May 26 18:16
    pacrob review_requested #2488
  • May 26 18:14
    pacrob edited #2488
  • May 26 18:07
    pacrob synchronize #2488
  • May 26 17:53
    pacrob synchronize #2488
  • May 26 17:51
    pacrob opened #2488
  • May 26 03:21
    ChiHangChen edited #2481
  • May 26 03:20
    ChiHangChen edited #2481
  • May 26 00:54
    pacrob commented #2482
  • May 26 00:52
    0xRadiant opened #2487
Mikko Ohtamaa
@miohtama
@marcgarreau @MatthiasLohr excellent work, thank you sirs
Marc Garreau
@marcgarreau
and thank you @miohtama for helping to answer questions around here :smile:
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<Christoph> @iamajmalhassan what in particular? You sign a transaction before you propagate it through the network.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> @iamajmalhassan are you using a node with hosted keys, or do you have local private keys? If you're using hosted keys, you don't have to worry about signing a transaction at all. Some more background: https://web3py.readthedocs.io/en/stable/web3.eth.account.html#local-vs-hosted-nodes
Voith
@voith

thanks for jumping back in! no issue yet, feel free to create one if you want to solicit more thoughts from the team.

I have some working code, I’ll create a PR tomorrow. However, the are some issues with ganache and its best to show these through code rather than creating an issue.

Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<Marc Garreau (wolovim)> Thats great! Look forward to it.
LIZHOUYI
@LIZHOUYI
taiyi
manuthema-rodriguez
@manuthema-rodriguez
Hello!! thanks @marcgarreau !
mintblock
@mintblock
hi - can someone point me in the right direction. I am coding in python and web3. does anyone know of any examples to swap tokens on kyber or uniswap?
thanks
Marc Garreau
@marcgarreau
I dont know if they have python tooling, but I would start by going to the kyber or uniswap documenation, @mintblock. All you need to interact with the contracts in web3.py is the contract address and ABI, though.
mintblock
@mintblock
thank you
I am using the abi and contract address but looking for an example to reference
Raphael Lullis
@lullis
Hello! I am wondering if there is any way that I can get the value of a transfer using only the information provided by a transaction receipt, or at least if there is any rule besides gasUsed == 21000 to indicate that a transaction is a ETH transfer?
Mikko Ohtamaa
@miohtama
@lullis no. Only for very simple cases. The receipt does not have any information about ETH or token transfers then happen between the smart contracts, on contract to contract calls. For these you need a full transaction trace. Ben Hauser, author of Brownie, can give tips on this one.
Ben Hauser
@iamdefinitelyahuman
thanks @miohtama :)
@lullis Brownie provides an object TransactionReceipt that can show you the return value from a broadcasted transaction.. it's available as TransactionReceipt.return_value - https://eth-brownie.readthedocs.io/en/stable/api-network.html#TransactionReceipt.return_value
for a more general overview of what you can do with TransactionReceipt - https://eth-brownie.readthedocs.io/en/stable/core-transactions.html
Raphael Lullis
@lullis
Thank you. It looks interesting, but it might be too much for what my immediate needs. I am building a a web app to work as a payment gateway, so at the moment all I care about is keeping track of ETH and ERC20 transfers.
Raphael Lullis
@lullis
I do have access to the transaction data along with the receipt already. I was just wondering if I could have my function that tracks transfers relying only on the receipt, but if I have to reconcile data from tx_data and tx_receipt, it's okay...
El De-dog-lo
@fubuloubu
web3py handles the stateMutability field in ABI, right?
mintblock
@mintblock
I am trying to submit a transaction to a smart contract. does anyone know what this error means? I googled, raised my gas amount and limit but no change. your help is appreciated... line 153, in request_blocking
raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'gas required exceeds allowance (11964883) or always failing transaction'}
Mikko Ohtamaa
@miohtama
@mintblock It means there is an exception thrown by Solidity code - most likely require
if there is an error then the all available gas is consumed
El De-dog-lo
@fubuloubu
Is there any plans in v6 to properly implement handling for structs? (perhaps handling them as creating an ad-hoc NamedTuple for output, and then just querying attributes of any given input object)
debugged a pretty insidious issue with the ABI decoder in web3py
Mikko Ohtamaa
@miohtama
@fubuloubu diving in the deep end!
Daniel Tong
@DanielTongAwesome
hi guys ~ just some questions about web3.py. I have a simple test contract, and I want to have a script locally to test out the interaction with smart contract
how do I set up the default account by using the private key
image.png
its pretty simple, but i am new to web3.py
Daniel Tong
@DanielTongAwesome
can someone show me how to link this transact with an account ?
Daniel Tong
@DanielTongAwesome
my assumption is i need to set up eth.defaultAccount = my private key account
how should i do that
Marc Garreau
@marcgarreau
@DanielTongAwesome w3.eth.defaultAccount = w3.eth.accounts[0], for example. its just the public address.
Daniel Tong
@DanielTongAwesome
oh but i am not using ganache
if I want to transact from my test wallet
how should i do that
Marc Garreau
@marcgarreau
Daniel Tong
@DanielTongAwesome
thanks @marcgarreau
Marc Garreau
@marcgarreau
:+1:
Daniel Tong
@DanielTongAwesome
I made a contract transact through web3.py
but I encountered an error
how to findout the reason why I got reverted
17 replies
Daniel Tong
@DanielTongAwesome
etherscan did not show detailed reason why it failed
image.png
Daniel Tong
@DanielTongAwesome
buildTransaction({
'chainId': 3,
'gas': 1000000,
'gasPrice': web3.toWei(30, 'gwei'),
'nonce': nonce,
})
here is how I set my gas and gasprice