Skip to content

Commit d7e23e5

Browse files
chore: sync Clarity reference from stacks-core
1 parent 882ac92 commit d7e23e5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎docs/reference/clarity/functions.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ perform such modifications. This is enforced both during type checks and during
10241024
the execution of the function. Public read-only functions may
10251025
be invoked by other contracts via `contract-call?`.
10261026

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.
10281028

10291029
**example:**
10301030

@@ -1269,6 +1269,9 @@ Clarity value. The type that `from-consensus-buff?` tries to deserialize
12691269
into is provided by the first parameter to the function. If it fails
12701270
to deserialize the type, the method returns `none`.
12711271

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+
12721275
**example:**
12731276

12741277
```clarity
@@ -2636,6 +2639,10 @@ In both cases, the value itself is a tuple containing three fields: a `version`
26362639
a `hash-bytes` value as a `(buff 20)`, and a `name` value as an `(optional (string-ascii 40))`. The `name`
26372640
field will only be `(some ..)` if the principal is a contract principal.
26382641

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+
26392646
Note: This function is only available starting with Stacks 2.1.
26402647

26412648
**example:**
@@ -3322,6 +3329,10 @@ option. If the argument is a response type, and the argument is an `(ok ...)` re
33223329

33233330
## tuple
33243331

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.
3334+
{% endhint %}
3335+
33253336
Introduced in: **Clarity 1**
33263337

33273338
**input:** `(key-name A), (key-name-2 B), ...`\

0 commit comments

Comments
 (0)