No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Luiserebii ee9307365d
Change of ABIPointer to pass by reference in order to selectively keep track of our position; and now, more test cases are passinggit diff --cached! All except for the [3][] and [][3] cases are passing... those are being tricky
1 year ago
README.md Create README.md 1 year ago
compile.sh Adding prototype C++ Multidimensional ABI parser, along with a small compiling script for convenience 1 year ago
decode.txt First post 1 year ago
main.cpp Change of ABIPointer to pass by reference in order to selectively keep track of our position; and now, more test cases are passinggit diff --cached! All except for the [3][] and [][3] cases are passing... those are being tricky 1 year ago

README.md

#
# Each group of three lines below contains:
#	1. A solidity function declaration
#	2. An example of the 'input' data field (RLP) from a call to that function
#	3. That same data decoded
#
# Your goal:
#	Simple, straight forward C++ code that parses the RLP correctly and prints out the desired result.
#
# You do not have to worry about clean code. We will be re-editing it entirely. The only requirement is that
# the code works in a generic way.
#
# The main entry point to your solution will have this interface:
#
#	std::string decode(const std::string& function, const std::string& input);
#
# All the code included in your delivery must be licensed with the broadest, least
# restrictive license availble. The project will not complete sucessully if the 
# license restricts our use of the code in any way.
#

function baz(int8)
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe
-2

function baz(int80)
0x0000000000000000000000000000000000000000000000000000b29c26f344fe
196383738119422

function baz(uint32)
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe
4294967294

function baz(string)
0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20776f726c64000000000000000000000000000000000000000000
hello world

function baz(bytes[] a, bytes32 b)
0x0000000000000000000000000000000000000000000000000000000000000040cb93e7ddea88eb37f5419784b399cf13f7df44079d05905006044dd14bb898110000000000000000000000000000000000000000000000000000000000000003000bf9f2adc93a1da7b9e61f44ee6504f99c467a2812b354d70a07f0b3cdc58c0007cc5734453f8d7bbacd4b3a8e753250dc4a432aaa5be5b048c59e0b5ac5fc00120aa407bdbff1d93ea98dafc5f1da56b589b427167ec414bccbe0cfdfd573
[0x000bf9f2adc93a1da7b9e61f44ee6504f99c467a2812b354d70a07f0b3cdc58c, 0x0007cc5734453f8d7bbacd4b3a8e753250dc4a432aaa5be5b048c59e0b5ac5fc, 0x00120aa407bdbff1d93ea98dafc5f1da56b589b427167ec414bccbe0cfdfd573], 0xcb93e7ddea88eb37f5419784b399cf13f7df44079d05905006044dd14bb89811

function baz(int[3])
0x000000000000000000000000000000000000000000000000000000000000002afffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb
[42, -3, -5]

function baz(uint128[2][3], uint)
0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a
[[1, 2, 3], [4, 5, 6]], 10

function baz(uint128[2][3][2], uint)
0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a
[[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], 10

function baz(uint[3][], uint)
0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006
[[1, 2], [3, 4], [5, 6]], 10

decode|decoding (uint[][3], uint)|function baz(uint[][3],uint)
0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006
[[1, 2], [3, 4], [5, 6]], 10

function baz(uint256[] a,uint[] b,uint256[] c)
0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000015af1d78b58c400000000000000000000000000000000000000000000000000015af1d78b58c4000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000001bc16d674ec80000
[6, 5], [25000000000000000000, 25000000000000000000], [2000000000000000000, 2000000000000000000]