-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbasic.yml
154 lines (132 loc) · 7.95 KB
/
basic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
###
## test (fixtures) for the abi coder
# single_integer test from ethereum abitests
# see https://github.com/ethereum/tests/blob/develop/ABITests/basic_abi_tests.json
- types: ['uint256']
args: [98127491]
data: '0000000000000000000000000000000000000000000000000000000005d94e83'
## integer_and_address sample test from ethereum abitests
## note: address gets decoded as a hex(adecimal string) without leading 0x
## e.g. 'cd2a3d9f938e13cd947ec05abc7fe734df8dd826'
- types: [ 'uint256', 'address' ]
args: [ 324124, 'cd2a3d9f938e13cd947ec05abc7fe734df8dd826' ]
data: '000000000000000000000000000000000000000000000000000000000004f21c
000000000000000000000000cd2a3d9f938e13cd947ec05abc7fe734df8dd826'
## githubwiki sample test from ethereum abitests
- types: ['uint256','uint32[]','bytes10','bytes' ]
args: [291, [1110,1929], '1234567890', 'Hello, world!']
data: '0000000000000000000000000000000000000000000000000000000000000123
0000000000000000000000000000000000000000000000000000000000000080
3132333435363738393000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000e0
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000456
0000000000000000000000000000000000000000000000000000000000000789
000000000000000000000000000000000000000000000000000000000000000d
48656c6c6f2c20776f726c642100000000000000000000000000000000000000'
## sample teest from ethers.js abicoder docu
- types: [ 'uint256', 'string' ]
args: [1234, 'Hello World']
data: '00000000000000000000000000000000000000000000000000000000000004d2
0000000000000000000000000000000000000000000000000000000000000040
000000000000000000000000000000000000000000000000000000000000000b
48656c6c6f20576f726c64000000000000000000000000000000000000000000'
## sample teest from ethers.js abicoder docu
- types: [ 'uint256[]', 'string' ]
args: [ [1234, 5678] , 'Hello World' ]
data: '0000000000000000000000000000000000000000000000000000000000000040
00000000000000000000000000000000000000000000000000000000000000a0
0000000000000000000000000000000000000000000000000000000000000002
00000000000000000000000000000000000000000000000000000000000004d2
000000000000000000000000000000000000000000000000000000000000162e
000000000000000000000000000000000000000000000000000000000000000b
48656c6c6f20576f726c64000000000000000000000000000000000000000000'
####
### tuples
## sample from ethers.js abicoder docu
- types: [ 'uint256', '(uint256,string)']
args: [1234, [5678, 'Hello World']]
data: '00000000000000000000000000000000000000000000000000000000000004d2
0000000000000000000000000000000000000000000000000000000000000040
000000000000000000000000000000000000000000000000000000000000162e
0000000000000000000000000000000000000000000000000000000000000040
000000000000000000000000000000000000000000000000000000000000000b
48656c6c6f20576f726c64000000000000000000000000000000000000000000'
## reported encoding bug from eth.rb
## see https://github.com/q9f/eth.rb/issues/102#
- types: ['uint256', '(address,uint256)[]', 'string']
args: [66, [['18a475d6741215709ed6cc5f4d064732379b5a58', 1]],
'QmWBiSE9ByR6vrx4hvrjqS3SG5r6wE4SRq7CP2RVpafZWV']
data: '0000000000000000000000000000000000000000000000000000000000000042
0000000000000000000000000000000000000000000000000000000000000060
00000000000000000000000000000000000000000000000000000000000000c0
0000000000000000000000000000000000000000000000000000000000000001
00000000000000000000000018a475d6741215709ed6cc5f4d064732379b5a58
0000000000000000000000000000000000000000000000000000000000000001
000000000000000000000000000000000000000000000000000000000000002e
516d57426953453942795236767278346876726a715333534735723677453453
52713743503252567061665a5756000000000000000000000000000000000000'
#################
# try the examples from the official abi spec
# see https://docs.soliditylang.org/en/develop/abi-spec.html
## baz(uint32,bool)
- types: ['uint32', 'bool']
args: [69,true]
data: '0000000000000000000000000000000000000000000000000000000000000045
0000000000000000000000000000000000000000000000000000000000000001'
## bar(bytes3[2])
- types: ['bytes3[2]']
args: [['abc','def']]
data: '6162630000000000000000000000000000000000000000000000000000000000
6465660000000000000000000000000000000000000000000000000000000000'
## sam(bytes,bool,uint256[])
- types: ['bytes','bool','uint256[]']
args: ['dave', true, [1,2,3]]
data: '0000000000000000000000000000000000000000000000000000000000000060
0000000000000000000000000000000000000000000000000000000000000001
00000000000000000000000000000000000000000000000000000000000000a0
0000000000000000000000000000000000000000000000000000000000000004
6461766500000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000003
0000000000000000000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000003'
## f(uint256,uint32[],bytes10,bytes)
- types: ['uint256','uint32[]','bytes10','bytes']
args: [0x123,
[0x456, 0x789],
'1234567890',
'Hello, world!']
data: '0000000000000000000000000000000000000000000000000000000000000123
0000000000000000000000000000000000000000000000000000000000000080
3132333435363738393000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000e0
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000456
0000000000000000000000000000000000000000000000000000000000000789
000000000000000000000000000000000000000000000000000000000000000d
48656c6c6f2c20776f726c642100000000000000000000000000000000000000'
## g(uint256[][],string[])
- types: ['uint256[][]','string[]']
args: [[[1, 2], [3]],
['one', 'two', 'three']]
data: '0000000000000000000000000000000000000000000000000000000000000040
0000000000000000000000000000000000000000000000000000000000000140
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000040
00000000000000000000000000000000000000000000000000000000000000a0
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000000000000000000003
0000000000000000000000000000000000000000000000000000000000000003
0000000000000000000000000000000000000000000000000000000000000060
00000000000000000000000000000000000000000000000000000000000000a0
00000000000000000000000000000000000000000000000000000000000000e0
0000000000000000000000000000000000000000000000000000000000000003
6f6e650000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000003
74776f0000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000005
7468726565000000000000000000000000000000000000000000000000000000'