PackageTrack

Go modules · #2413

github.com/onflow/cadence

v1.10.6onflow/cadence

Release timeline

7504 releases since 2020
202120222023202420252026

Releases

  1. v1.10.4-0.20260518170520-ebe5de4aadee18 May 2026pre-release

    Nothing published for this version

  2. v1.10.318 May 2026
    Release notes

    What's Changed

    This update mainly focuses on improving safety and consistency in Cadence. As part of this effort, several changes have been introduced to prevent accidental foot-guns by users.

    Changed function signature for filter and map array-functions

    A breaking change was introduced for filter and map to make them consistent with for-in loops and indexed array access.
    If filter or map is used on an array reference whose element type is itself a container type (e.g. struct, resource, array, or dictionary), then the callback parameter must now also be a reference type.

    For example, assume S is a struct type and arrayRef is a reference to an array of S structs as shown below.

    access(all) struct S {}
    
    var array: [S] = [S()]
    var arrayRef: &[S] = &array

    Then, previously, using the filter function on this array-reference required a callback of type fun(S): Bool:

    var filteredArray = arrayRef.filter(
        // Note the parameter type used to be `S`
        view fun(element: S): Bool {
            return true
        },
    )

    From this release onwards, the filter method was changed to require a callback of type fun(&S): Bool:

    var filteredArray = arrayRef.filter(
        // Note the parameter type is now a reference type `&S`
        view fun(element: &S): Bool {
            return true
        },
    )

    Similarly, for map method,  the callback that needs to be passed-in must have a reference type (&S) parameter.

    var mappedArray = arrayRef.map(
        // Note the parameter type is now a reference type `&S`
        view fun(element: &S): Int {
            return 1
        },
    )

    Erase entitlements when assigned to AnyStruct

    Previously, authorized references retained their entitlements when upcast to AnyStruct.

    var authRef: auth(E) &T = ...
    
    // Assign to `AnyStruct`
    var any: AnyStruct = authRef
    
    // Can get the auth-ref back by down-casting
    var downCastedAuthRef = any as! auth(E) &T

    However, this behaviour was inconsistent with normal reference upcasting, where entitlements are stripped to match the target type.
    This inconsistency could lead developers to incorrectly assume that upcasting to AnyStruct also strips entitlements.

    From this release onward, upcasting to AnyStruct behaves the same as other reference upcasts and strips entitlements during the cast.

    var authRef: auth(E) &T = ...
    
    // Assign to `AnyStruct`
    var any: AnyStruct = authRef
    
    // This would panic at runtime, since the entitlements were stripped during the up-cast in the previous step.
    var downCastedAuthRef = any as! auth(E) &T

    Run conditions of inherited default functions

    Previously, when an interface default function also defines conditions, and the concrete type overrides the default function as shown below, then the conditions also get overridden.

    resource interface Receiver {
        // Default function also defines a condition.
        fun log(_ message: String) {
            pre{ message != "" }
            log(message.append("from Receiver"))
        }
    }
    
    resource Vault: Receiver {}
        // `log` function is overridden.
        // This also overrides the condition (i.e: ignores conditions from `Receiver` interface).
        fun log(_ message: String) {
            log(message)
        }
    }

    This has been a foot-gun because the author of the interface might not be aware that the conditions are getting ignored/overridden too.

    Therefore, to avoid that, the behaviour was changed such that the conditions are always run, regardless of whether the concrete type implements/override the default implementation or not.

    resource Vault: Receiver {}
        // `log` function is overridden.
        // However, the conditions won't get overridden.
        // The condition defined on the interface would still be applicable.
        fun log(_ message: String) {
            log(message)
        }
    }

    Intersect authorizations for nested references

    When a nested authorized reference is accessed via an unauthorized reference (e.g: an array reference of type &[auth(E) &T] and then accessing the element refs[0]), the inner authorized reference auth(E) &T was returned as is. However, this behaviour was not well defined in the member-access semantics proposal FLIP 89, and was not very intuitive, leaving potential of accidental foot-guns.

    var arrayRef: &[auth(E) &T] = ...
    
    // The resulting type used to be the entitled-type `auth(E) &T`
    var element: auth(E) &T  = arrayRef[0]

    Therefore, this was changed such that the result's authorization would now be the intersection of the outer (container) reference's authorization and the inner (element) reference's authorization.

    var arrayRef: &[auth(E) &T] = ...
    
    // The resulting type now is the un-entitled type `&T`
    var element: &T = arrayRef[0]

    The intersection is computed as follows:

    • Index Access (arrays, dictionaries)

      Container Type Old Result New Result
      auth(E) &[&T] &T &T (no change — inner is already unauthorized)
      &[auth(E) &T] auth(E) &T &T (outer unauthorized strips inner)
      auth(E) &[auth(E) &T] auth(E) &T auth(E) &T (no change — intersection preserves matching auth)
      auth(E,F) &[auth(F,G) &T] auth(F,G) &T auth(F) &T (only F is in both)
      auth(E) &[auth(F) &T] auth(F) &T &T (E and F are disjoint, empty intersection)

      For dictionaries, the same rules apply, e.g., auth(E) &{String: auth(E) &T} gives (auth(E) &T)?. Unauthorized outer strips inner auth, same as arrays.

    • Member Access (composites)

      The outer authorization for intersection is the raw outer reference's authorization (not mapped, since access(mapping M) fields cannot have reference types).

      Container Type Old Result New Result
      &S with field let x: auth(E) &T auth(E) &T &T (outer unauthorized strips inner)
      auth(E) &S with field let x: auth(E) &T auth(E) &T auth(E) &T (matching auth preserved)
      auth(E,F) &S with field let x: auth(F,G) &T auth(F,G) &T auth(F) &T (partial intersection)
      auth(E) &S with field let x: auth(F) &T auth(F) &T &T (disjoint, empty intersection)

    Complete List of Changes:

    ⭐ Features

    🛠 Improvements

    🐞 Bug Fixes

    🧪 Testing

    📖 Documentation

    • docs: add TL;DR, FAQ, and GEO enhancements for discoverability by @Aliserag in #4480
    • docs: followup SEO/GEO audit fixes by @Aliserag in #4481

    Other Changes

    New Contributors

    Full Changelog: v1.10.2...v1.10.3

    Open source →
    Additional notes

    v1.10.3

    Compare

    Choose a tag to compare

    Open source →
  3. v1.10.3-rc.3.0.20260518162305-34a78447529c18 May 2026pre-release

    Nothing published for this version

  4. v1.10.3-rc.3.0.20260518162223-7c9eb8354d0618 May 2026pre-release

    Nothing published for this version

  5. v1.10.3-rc.3.0.20260518160617-ca3720c9ae1c18 May 2026pre-release

    Nothing published for this version

  6. v1.10.3-rc.3.0.20260518160021-e8bfb061caff18 May 2026pre-release

    Nothing published for this version

  7. v1.10.3-rc.3.0.20260518155518-93bf80d2361118 May 2026pre-release

    Nothing published for this version

  8. v1.10.3-rc.3.0.20260518154026-862adce1a94818 May 2026pre-release

    Nothing published for this version

  9. v1.10.3-rc.313 May 2026pre-release

    Nothing published for this version

  10. v1.10.3-0.20260515201326-5ec72a9b829415 May 2026pre-release

    Nothing published for this version

  11. v1.10.3-0.20260515191215-52b61191059915 May 2026pre-release

    Nothing published for this version

  12. v1.10.3-0.20260514214859-d021e337778f14 May 2026pre-release

    Nothing published for this version

  13. v1.10.3-0.20260514204403-461ace9eb71b14 May 2026pre-release

    Nothing published for this version

  14. v1.10.3-0.20260507000928-bdbec2d0adbb7 May 2026pre-release

    Nothing published for this version

  15. v1.10.3-0.20260507000024-30fbe44200f17 May 2026pre-release

    Nothing published for this version

  16. v1.10.3-0.20260506173159-69dd3081a8ef6 May 2026pre-release

    Nothing published for this version

  17. v1.10.3-0.20260430082153-048f0af284ae30 Apr 2026pre-release

    Nothing published for this version

  18. v1.10.3-0.20260429190448-e93ac0133a5229 Apr 2026pre-release

    Nothing published for this version

  19. v1.10.3-0.20260424204014-500e8d9300c424 Apr 2026pre-release

    Nothing published for this version

  20. v1.10.3-0.20260424192329-2e081b4b30fa24 Apr 2026pre-release

    Nothing published for this version

  21. v1.10.3-0.20260424154159-95d26d9c693c24 Apr 2026pre-release

    Nothing published for this version

  22. v1.10.3-0.20260424152556-239ea78d4b5b24 Apr 2026pre-release

    Nothing published for this version

  23. v1.10.3-0.20260423231547-6c59d39b110023 Apr 2026pre-release

    Nothing published for this version

  24. v1.10.3-0.20260423203646-6d9959ad290823 Apr 2026pre-release

    Nothing published for this version

  25. v1.10.3-0.20260423162946-f2a0f41f78b623 Apr 2026pre-release

    Nothing published for this version

  26. v1.10.3-0.20260423162853-60141a9246a923 Apr 2026pre-release

    Nothing published for this version

  27. v1.10.3-0.20260423015123-07b26b41135923 Apr 2026pre-release

    Nothing published for this version

  28. v1.10.3-0.20260423001109-22938ed00c8c23 Apr 2026pre-release

    Nothing published for this version

  29. v1.10.3-0.20260422231533-344a5af580e122 Apr 2026pre-release

    Nothing published for this version

  30. v1.10.3-0.20260422230351-020f61872c0422 Apr 2026pre-release

    Nothing published for this version

  31. v1.10.3-0.20260422221435-b51b36eb602d22 Apr 2026pre-release

    Nothing published for this version

  32. v1.10.3-0.20260422165243-faff11c5c28022 Apr 2026pre-release

    Nothing published for this version

  33. v1.10.3-0.20260420202556-95b8688cecf020 Apr 2026pre-release

    Nothing published for this version

  34. v1.10.3-0.20260420193020-e1027e0c374c20 Apr 2026pre-release

    Nothing published for this version

  35. v1.10.3-0.20260420192918-591e55d028f220 Apr 2026pre-release

    Nothing published for this version

  36. v1.10.3-0.20260420174040-82ed5b07c01b20 Apr 2026pre-release

    Nothing published for this version

  37. v1.10.3-0.20260420173243-3024cfeddd4620 Apr 2026pre-release

    Nothing published for this version

  38. v1.10.3-0.20260420172759-bc9c8c252ae820 Apr 2026pre-release

    Nothing published for this version

  39. v1.10.3-0.20260420171826-7bd57e8fa45920 Apr 2026pre-release

    Nothing published for this version

  40. v1.10.3-0.20260420170944-d08870ad0a9720 Apr 2026pre-release

    Nothing published for this version

  41. v1.10.3-0.20260418001658-cade23af6f5e18 Apr 2026pre-release

    Nothing published for this version

  42. v1.10.3-0.20260418000926-aece6f240d9918 Apr 2026pre-release

    Nothing published for this version

  43. v1.10.3-0.20260418000041-79cf2404b7ca18 Apr 2026pre-release

    Nothing published for this version

  44. v1.10.3-0.20260417212405-4e61b60052a417 Apr 2026pre-release

    Nothing published for this version

  45. v1.10.3-0.20260416181305-e8fe69bc408a16 Apr 2026pre-release

    Nothing published for this version

  46. v1.10.3-0.20260416174815-dec1365ca31b16 Apr 2026pre-release

    Nothing published for this version

  47. v1.10.3-0.20260416173631-67004e55700316 Apr 2026pre-release

    Nothing published for this version

  48. v1.10.3-0.20260416170004-7e6bdb95b1b716 Apr 2026pre-release

    Nothing published for this version

  49. v1.10.3-0.20260416165524-3e1981cad5f316 Apr 2026pre-release

    Nothing published for this version

  50. v1.10.3-0.20260416163308-c5052d7d064416 Apr 2026pre-release

    Nothing published for this version

  51. v1.10.3-0.20260416084951-8c25bbd272cc16 Apr 2026pre-release

    Nothing published for this version

  52. v1.10.3-0.20260415174419-c35ce67994c615 Apr 2026pre-release

    Nothing published for this version

  53. v1.10.215 Apr 2026
    Release notes

    What's Changed

    ⭐ Features

    🛠 Improvements

    📖 Documentation

    • docs: clarify ContractUpdateValidator scope and threat model by @j1010001 in #4465

    Other Changes

    • Merge release/v1.10.1 to master by @github-actions[bot] in #4462
    • Update to atree v0.16.0 by @turbolent in #4464

    New Contributors

    Full Changelog: v1.10.1...v1.10.2

    Open source →
    Additional notes

    v1.10.2

    Compare

    Choose a tag to compare

    Open source →
  54. v1.10.2-0.20260414162145-85cdbbcd9b7c14 Apr 2026pre-release

    Nothing published for this version

  55. v1.10.2-0.20260414145041-affdce366bf514 Apr 2026pre-release

    Nothing published for this version

  56. v1.10.2-0.20260414144253-b2dea8545c2614 Apr 2026pre-release

    Nothing published for this version

  57. v1.10.2-0.20260410161229-e09b4b72489a10 Apr 2026pre-release

    Nothing published for this version

  58. v1.10.2-0.20260410160246-f7d46c05e32810 Apr 2026pre-release

    Nothing published for this version

  59. v1.10.2-0.20260409234757-c8125152c7b39 Apr 2026pre-release

    Nothing published for this version

  60. v1.10.2-0.20260409230623-355ad16379239 Apr 2026pre-release

    Nothing published for this version