You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/index.adoc
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1414,6 +1414,11 @@ Expressions allow for condition checking of function arguments, event parameters
1414
1414
| `contains`, `==`, `!=`
1415
1415
| Behavior of `contains` and `==` differs based on whether the value is CSV or a JSON array string. See "Operations on Complex Types" for details.
1416
1416
1417
+
| `*Tuple (EVM)*`
1418
+
| Ordered list represented as a JSON array string (e.g., `'["Alice", 0x1234..., 25, true, [12,34]]'`).
1419
+
| `contains`, `==`, `!=`
1420
+
| The `contains` operation performs a case-insensitive deep search through all tuple elements. `==` and `!=` perform comparisons against the entire tuple values. See "Operations on Complex Types" for details.
1421
+
1417
1422
|===
1418
1423
1419
1424
@@ -1509,6 +1514,28 @@ When an EVM parameter is an array (often represented internally or configured wi
1509
1514
- `array_param != '["raw_json_array_string"]'` the negation of the above
1510
1515
- `array_param[0]` indexed access
1511
1516
1517
+
*Tuple Operations (`kind: "tuple"`)*
1518
+
1519
+
- `tuple_param contains 'value'` checks if the string `'value'` exists within the tuple.
1520
+
- `tuple_param == (12, "hello", "testing", 34)` checks if the tuple is equal.
1521
+
- `tuple_param != (12, "hello", "testing", 34)` checks if the tuple is not equal.
1522
+
1523
+
Where `tuple_param` is the name of tuple param (we should have only one param for tuples).
1524
+
1525
+
*Note on Solidity Structs:* When working with Solidity smart contracts, struct types are automatically converted to tuples during ABI encoding/decoding. For example, a Solidity struct like:
1526
+
1527
+
[source,solidity]
1528
+
----
1529
+
struct User {
1530
+
uint256 id;
1531
+
string name;
1532
+
string email;
1533
+
uint256 age;
1534
+
}
1535
+
----
1536
+
1537
+
Will be represented as a tuple `*(12, "user_name", "user_email", 34)*` where the values correspond to the struct fields in their declaration order. This conversion is handled transparently by the Solidity compiler and Web3 libraries, allowing you to use the tuple operations above to work with struct data returned from smart contract calls.
0 commit comments