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
{{ message }}
Repository navigation
Commit d7e23e5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/reference/clarity/functions.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1024,7 +1024,7 @@ perform such modifications. This is enforced both during type checks and during
1024
1024
the execution of the function. Public read-only functions may
1025
1025
be invoked by other contracts via `contract-call?`.
1026
1026
1027
-
The reserved-name exception described under `define-public` applies to read-only functions as well.
1027
+
Beginning in Epoch 4.1, the reserved-name exception described under `define-public` applies to read-only functions as well.
1028
1028
1029
1029
**example:**
1030
1030
@@ -1269,6 +1269,9 @@ Clarity value. The type that `from-consensus-buff?` tries to deserialize
1269
1269
into is provided by the first parameter to the function. If it fails
1270
1270
to deserialize the type, the method returns `none`.
1271
1271
1272
+
Starting in Stacks 4.1, a buffer containing a contract principal whose name is
1273
+
longer than 40 characters fails to deserialize, and the method returns `none`.
1274
+
1272
1275
**example:**
1273
1276
1274
1277
```clarity
@@ -2636,6 +2639,10 @@ In both cases, the value itself is a tuple containing three fields: a `version`
2636
2639
a `hash-bytes` value as a `(buff 20)`, and a `name` value as an `(optional (string-ascii 40))`. The `name`
2637
2640
field will only be `(some ..)` if the principal is a contract principal.
2638
2641
2642
+
Starting in Stacks 4.1, if the contract name is longer than 40 characters, this function
2643
+
aborts the transaction with a runtime error. Such principals can only have been created
2644
+
before Stacks 4.1.
2645
+
2639
2646
Note: This function is only available starting with Stacks 2.1.
2640
2647
2641
2648
**example:**
@@ -3322,6 +3329,10 @@ option. If the argument is a response type, and the argument is an `(ok ...)` re
3322
3329
3323
3330
## tuple
3324
3331
3332
+
{% hint style="info" %}
3333
+
As of Epoch 4.1, tuples that must share one type, such as the two branches of `if`, the arguments of `is-eq` or the elements of a `list`, must have the same fields. Earlier epochs could drop fields that only one of the tuples had.
0 commit comments