Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:19
    dbfreem commented #2479
  • 02:06
    dbfreem synchronize #2479
  • May 17 22:10
    fselmo synchronize #2457
  • May 17 20:04
    fselmo commented #2457
  • May 17 16:32
    fselmo commented #2457
  • May 17 16:08
    fselmo commented #2457
  • May 17 16:07
    fselmo commented #2457
  • May 17 15:48
    fselmo synchronize #2457
  • May 17 15:35
    pacrob commented #2478
  • May 17 15:35

    pacrob on master

    removed verison check in __init… (compare)

  • May 17 15:35
    pacrob closed #2478
  • May 17 15:25
    pacrob synchronize #2478
  • May 17 15:01
    fselmo commented #2441
  • May 17 09:48
    dbfreem edited #2479
  • May 17 09:48
    dbfreem synchronize #2479
  • May 17 09:46
    dbfreem opened #2479
  • May 17 09:34
    dbfreem opened #2478
  • May 16 21:35

    kclowes on master

    Increase cache size (#2477) * … (compare)

  • May 16 21:35
    kclowes closed #2477
  • May 16 21:16
    kclowes review_requested #2477
mintblock
@mintblock
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
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