Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:23
    dbfreem commented #2446
  • May 18 21:22
    pacrob synchronize #2441
  • May 18 21:22

    pacrob on asyncify-contract

    Resolve Typo in documentation. … Add sync chain_id to simple cac… Compile release notes and 23 more (compare)

  • May 18 21:13
    kclowes commented #2446
  • May 18 20:03
    pacrob edited #2441
  • May 18 19:42
    kclowes synchronize #2441
  • May 18 19:42

    kclowes on asyncify-contract

    Remove un-needed chain_id (compare)

  • May 18 19:29
    kclowes synchronize #2441
  • May 18 19:29

    kclowes on asyncify-contract

    Fix tests (compare)

  • May 18 17:30
    kclowes synchronize #2441
  • May 18 17:30

    kclowes on asyncify-contract

    Add missing await in async buil… Merge branch 'asyncify-contract… (compare)

  • May 18 17:16
    pacrob synchronize #2441
  • May 18 17:16

    pacrob on asyncify-contract

    add newsfragment (compare)

  • May 18 14:53

    kclowes on master

    Bump resource class (#2471) * … (compare)

  • May 18 14:53
    kclowes closed #2471
  • May 18 09:55
    dbfreem commented #1416
  • May 18 09:52
    dbfreem opened #2480
  • May 18 02:19
    dbfreem commented #2479
  • May 18 02:06
    dbfreem synchronize #2479
  • May 17 22:10
    fselmo synchronize #2457
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
Daniel Tong
@DanielTongAwesome
image.png
is that because of the uint256 ? cos I have one require uint 256
and when I call transact, i just put 1 there
Daniel Tong
@DanielTongAwesome
can anyone share me how to convert python integer to uint256?
I tried numpy -> np.uint32(1)
since uint256 -> 256 bits -> 32bytes
Marc Garreau
@marcgarreau
web3.py doesnt yet support parsing the revert reason, though there is some work in progress there. In general, though, this isn’t the best place to get help with debugging solidity contracts. (I’m not actually sure where the best place for that is — suggestions from the peanut gallery are welcome.) What I will recommend is writing some unit tests for your contract, so you can rapidly try out your ideas and have more confidence in the inputs and outputs. Brownie might be a good tool to guide you there.
Daniel Tong
@DanielTongAwesome
thanks ~ i already had some unit test code, but its my first time to try web3.py
I mostly do it with js
thanks for ur help
the unit test in python looks cool I will try that as well