GithubHelp home page GithubHelp logo

Comments (2)

fselmo avatar fselmo commented on August 26, 2024 1

@kigawas The inner tuple type is actually a list of tuple types, tuple[], which means it should be (uint256,address)[].

>>> from eth_utils import to_bytes
>>> from eth_abi import abi

>>> hex_data = (
...    "0x0000000000000000000000000000000000000000000000000000000000000020"
...    "000000000000000000000000000000000000000000000000000000000000000000"
...    "000000000000000000000000000000000000000000000000000000000000000000"
...    "00000000000000000000000000000000000000000003b53d9d99ecb80000000000"
...    "0000000000000000001850dd8fb9323b01c340d0eb1da1ec16cc8ee1a200000000"
...    "0000000000000000004c00500000ad104d7dbd00e3ae0a5c00560c000000000000"
...    "00000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d000000000000"
...    "000000000000000000000000000000000000000000000000056100000000000000"
...    "000000000000000000000000000000000000000000000000010000000000000000"
...    "000000000000000000000000000000000000000000000002000000000000000000"
...    "000000000000000000000000000000000000006346e1d200000000000000000000"
...    "000000000000000000000000000000000000636fadcd0000000000000000000000"
...    "000000000000000000000000000000000000000000360c6ebe0000000000000000"
...    "0000000000000000000000000589c7ee474bc5850000007b02230091a7ed012300"
...    "72f7006a004d60a8d4e71d599b8104250f00000000007b02230091a7ed01230072"
...    "f7006a004d60a8d4e71d599b8104250f0000000000000000000000000000000000"
...    "000000000000000000000000000000000200000000000000000000000000000000"
...    "000000000000000000000000000002400000000000000000000000000000000000"
...    "0000000000000000000000000002e0000000000000000000000000000000000000"
...    "000000000000000000000000000200000000000000000000000000000000000000"
...    "000000000018fae27693b400000000000000000000000000000000a26b00c1f0df"
...    "003000390027140000faa719000000000000000000000000000000000000000000"
...    "00000018fae27693b40000000000000000000000000000a858ddc0445d8131dac4"
...    "d1de01f834ffcba52ef10000000000000000000000000000000000000000000000"
...    "000000000000000041046bd0fda5b934a96ef4700da1b64e03e7451e6a6ee45a50"
...    "04b93823ff3baae34b9f1c4f667781b5fedd27dc67339d4fd3e4ae2a873b315090"
...    "e6312853732f9a1c00000000000000000000000000000000000000000000000000"
...    "000000000000360c6ebe"
... )

>>> abi.decode(
...     ["(address,uint256,uint256,address,address,address,uint256,uint256,uint8,uint256,uint256,bytes32,uint256,bytes32,bytes32,uint256,(uint256,address)[],bytes)"],
...     to_bytes(hexstr=hex_data),
... )

(('0x0000000000000000000000000000000000000000',
  0,
  68400000000000000000,
  '0x1850dd8fb9323b01c340d0eb1da1ec16cc8ee1a2',
  '0x004c00500000ad104d7dbd00e3ae0a5c00560c00',
  '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
  1377,
  1,
  2,
  1665589714,
  1668263373,
  b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
  24446860302761739304752683030156737591518664810215442929800781758303463785861,
  b'\x00\x00\x00{\x02#\x00\x91\xa7\xed\x01#\x00r\xf7\x00j\x00M`\xa8\xd4\xe7\x1dY\x9b\x81\x04%\x0f\x00\x00',
  b'\x00\x00\x00{\x02#\x00\x91\xa7\xed\x01#\x00r\xf7\x00j\x00M`\xa8\xd4\xe7\x1dY\x9b\x81\x04%\x0f\x00\x00',
  2,
  ((1800000000000000000, '0x0000a26b00c1f0df003000390027140000faa719'),
   (1800000000000000000, '0xa858ddc0445d8131dac4d1de01f834ffcba52ef1')),
  b"\x04k\xd0\xfd\xa5\xb94\xa9n\xf4p\r\xa1\xb6N\x03\xe7E\x1ejn\xe4ZP\x04\xb98#\xff;\xaa\xe3K\x9f\x1cOfw\x81\xb5\xfe\xdd'\xdcg3\x9dO\xd3\xe4\xae*\x87;1P\x90\xe61(Ss/\x9a\x1c"),)

from eth-abi.

kigawas avatar kigawas commented on August 26, 2024

Thanks for explanation!

from eth-abi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.