diff --git a/docs/reference/clarity/functions.md b/docs/reference/clarity/functions.md index 9b5049f2b3..3c3e0073fb 100644 --- a/docs/reference/clarity/functions.md +++ b/docs/reference/clarity/functions.md @@ -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:** @@ -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 @@ -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:** @@ -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), ...`\