Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/reference/clarity/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ perform such modifications. This is enforced both during type checks and during
the execution of the function. Public read-only functions may
be invoked by other contracts via `contract-call?`.

The reserved-name exception described under `define-public` applies to read-only functions as well.
Beginning in Epoch 4.1, the reserved-name exception described under `define-public` applies to read-only functions as well.

**example:**

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

Starting in Stacks 4.1, a buffer containing a contract principal whose name is
longer than 40 characters fails to deserialize, and the method returns `none`.

**example:**

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

Starting in Stacks 4.1, if the contract name is longer than 40 characters, this function
aborts the transaction with a runtime error. Such principals can only have been created
before Stacks 4.1.

Note: This function is only available starting with Stacks 2.1.

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

## tuple

{% hint style="info" %}
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.
{% endhint %}

Introduced in: **Clarity 1**

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