Skip to content

Releases

v1.8.2

Choose a tag to compare

@turbolent turbolent released this 23 Oct 22:01

What's Changed

⭐ Features

  • Add JSON-CDC support for TypeValue of AttachmentType in #4286

🛠 Improvements

  • Improve error message for field initialization attempts in #4283
  • Fix pretty printer to avoid unnecessary parentheses with force-unwrap in #4284

🐞 Bug Fixes

📖 Documentation

  • Fix typos in documentation and comments in #4298

Other Changes

  • Merge release/v1.7.1 to v1.7 by @github-actions[bot] in #4254
  • Merge release/v1.8.1 to master by @github-actions[bot] in #4281
  • Fix job name for get contracts action by @turbolent in #4303

Full Changelog: v1.8.1...v1.8.2

v1.7.2

Choose a tag to compare

@turbolent turbolent released this 22 Oct 18:53

What's Changed

🐞 Bug Fixes

Other Changes

  • Merge release/v1.7.1 to v1.7 by @github-actions[bot] in #4254

Full Changelog: v1.7.1...v1.7.2

v1.8.1

Choose a tag to compare

@turbolent turbolent released this 10 Oct 21:42

What's Changed

🐞 Bug Fixes

Other Changes

  • Merge release/v1.8.0 to master by @github-actions[bot] in #4278

Full Changelog: v1.8.0...v1.8.1

v1.8.0

Choose a tag to compare

@turbolent turbolent released this 10 Oct 17:22

What's Changed

⭐ Features

🛠 Improvements

🐞 Bug Fixes

  • [Compiler] Initialize all variable of all imports by @SupunS in #4222
  • Fix tracing of function invocations by @turbolent in #4224
  • [Compiler] Fix invokeMethodDynamic by @turbolent in #4225
  • [Compiler] Use global's index instead of array index during linking by @SupunS in #4227
  • [Compiler] Fix result variable transfer by @turbolent in #4236
  • [Compiler] Fix Account.contracts.borrow by @turbolent in #4241
  • [Compiler] Fix function types for capability value methods by @turbolent in #4243
  • [Compiler] Ensure program is initialized whenever type-info is requested by @SupunS in #4242
  • Fix 128-bit fixed-point code by @turbolent in #4252
  • [Compiler] Fix and improve compiler/VM benchmarks and tests, fix CI by @turbolent in #4257

🧪 Testing

  • [Compiler] Add control flow basic block visualization to program printer. by @RZhang05 in #4197
  • [Compiler] Add tests for importing same program from multiple paths by @SupunS in #4228

Other Changes

New Contributors

Full Changelog: v1.7.0...v1.8.0

v1.7.1

Choose a tag to compare

@turbolent turbolent released this 03 Oct 17:19

What's Changed

🐞 Bug Fixes

Full Changelog: v1.7.0...v1.7.1

v1.7.0

Choose a tag to compare

@turbolent turbolent released this 08 Sep 20:13

The Cadence v1.7.0 release marks a major step forward for Cadence. This upgrade delivers powerful new features that make Cadence more precise, more consistent, and more approachable for both developers and AI agents. With improvements ranging from higher-precision numeric types to more descriptive, AI-friendly error messages, Cadence v1.7.0 strengthens its position as the most developer-friendly smart contract language in Web3.

The upgrade advances the Cadence roadmap across three key dimensions: developer experience, consistency and precision in financial workloads, and AI-powered autonomy. Together, these improvements ensure that building on Flow with Cadence is faster, safer, and more aligned with the future of agent-assisted development.

Introducing Fix128 and UFix128 for high-precision math

Cadence extends its fixed-point number system with Fix128 and UFix128, 128-bit fixed-point types that support precision up to 24 decimal places. Until now, developers relied on Fix64/UFix64, which are limited to eight decimal places. For many financial workloads such as interest accrual, risk modeling, and per-second rate calculations, this level of precision could fall short and force developers to manually convert values into scaled integers, which could introduce errors. The new 128-bit types expand numeric range while dramatically increasing fractional precision (24 decimal places vs eight), enabling accurate, high-resolution financial computations without custom math scaffolding. All values from Fix64/UFix64 convert losslessly to their 128-bit counterparts. Converting in the other direction can result in a range error, which will abort the transaction, and/or lost precision, which developers must handle explicitly, hence errors cannot go unnoticed.

This is the implementation of FLIP 341: Add 128-bit fixed-point types to Cadence.

On Ethereum, tokens and DeFi protocols typically represent fractional values by storing large integers alongside a decimals field (e.g. 18), leaving rounding and precision management to application code. Cadence eliminates this burden by providing fixed-point types natively at both 64-bit and 128-bit precision, significantly reducing rounding-related errors in application code.

Example:

Solidity (integer math with decimals)

// ERC-20 token with 18 decimals
uint8 public constant decimals = 18;  

// Balance stored as integer with scaling
uint256 public balance = 1500 * (10 ** decimals);  
// balance represents "1500.000000000000000000"

// Annual interest rate, represented as integer with scaling
// 5% = 0.05, so store 0.05 * 1e18
uint256 public yearlyRate = 5 * (10 ** 16);  

// Seconds in a year
uint256 public constant SECONDS_PER_YEAR = 31_536_000;  

// Per-second interest rate, using integer division
uint256 public perSecondRate = yearlyRate / SECONDS_PER_YEAR;  

// Updated balance after one second (simplified)
uint256 public updated = balance * (10**18 + perSecondRate) / 10**18;

Cadence (native fixed-point types)

let preciseBalance: UFix128 = 1500.0

let yearlyRate: UFix128 = 0.05   // 5% interest
let perSecondRate = yearlyRate / 31536000.0  // seconds in a year

let updated = preciseBalance * (1.0 + perSecondRate)

Fix numeric type rounding inconsistency

In the same vein as introducing higher-precision fixed-point numbers, Cadence has also unified the rounding behavior of its numeric types to remove inconsistencies. Previously, Fix64 and large integer types like Int128 and Int256 used Euclidean division semantics, which produced different results for negative values compared to smaller integer types. With this change, all numeric types, including Fix64, now consistently use truncation when handling division of negative numbers. This ensures predictable and uniform arithmetic across the language, reducing surprises for developers.

This is the implementation of FLIP 342: Fix numeric type rounding inconsistency

Example

Before:

Fix64(-0.00000005) / Fix64(2.0) == Fix64(-0.00000003)

Now:

Fix64(-0.00000005) / Fix64(2.0) == Fix64(-0.00000002)

Descriptive, AI- and human-friendly Cadence errors

Cadence already lends itself well to AI assistance, and this release strengthens that foundation by making compiler and linter errors far more descriptive and actionable. In the past, many errors such as those triggered by deprecated pre-1.0 keywords like pub only stated what was invalid, without suggesting how to fix it or linking to migration notes. This left both developers and AI agents without enough context to resolve issues automatically.

Error messages have now been rewritten to explain the cause, suggest concrete fixes, and link directly to reference documentation. For example:

Before:

pub fun foo() {}
// error: 'pub' is no longer a valid access keyword

Now:

pub fun foo() {}
// error: 'pub' is no longer a valid access keyword
// note: replace with 'access(all)' for the same effect
// see: https://developers.flow.com/cadence/migration-guide

These enriched messages are also exposed through the Cadence language server, so IDEs and agent-based tools like Cursor can automatically apply the recommended fix, follow the link, and validate the change. The result is faster feedback, fewer trips to documentation, and a smoother path for both humans and AI agents working with Cadence.

Import Aliasing

Previously, developers could not import two contracts with the same name in the same scope, which led to conflicts and forced duplication of code when working with multiple contracts such as different token implementations. To address this, Cadence now supports import aliasing, allowing developers to assign custom names to imported contracts. For example,

import FUSD as FUSD1 from 0x02
import FUSD as FUSD2 from 0x03

This reduces code duplication, prevents naming conflicts, and improves readability. It is the implementation of FLIP 314: Import Aliasing.

Cadence Runtime Transition: Interpreter → Compiler & VM

Cadence is progressing from its current interpreter to a new compiler and virtual machine. Historically, programs were executed by an interpreter that traverses the Abstract Syntax Tree (AST), which enabled rapid language evolution but limited runtime performance. With the compiler, Cadence programs are translated into a lower-level bytecode executed by a dedicated VM. This reduces AST overhead for improved performance and establishes a unified runtime that simplifies backward compatibility, since contracts from different Cadence versions compile to a common instruction set. Existing smart contracts continue to function without modification as the language evolves. See here for more information.

Once complete, the new compiler/VM backend will be deployed in an upcoming release, opening the door to performance gains and a more flexible path to long-term language evolution. Developers do not need to change how they write or deploy contracts. Compilation occurs automatically within the Cadence execution runtime.

Key updates in this release:

Full compiler and VM implementation

Implementation of all Cadence language features in the compiler and VM is now complete.

Compatibility verification

Key book-keeping functions have been validated, including fee deduction, account storage limit checks, and minimum account balance checks. Executing these paths with the compiler and VM yields results identical to the interpreter. Significant progress has also been made on the correctness of user transaction execution, which remains the primary focus going forward.

Performance improvements

Early benchmarks already show meaningful performance gains, establishing a solid foundation for further optimization.


Commit List

⭐ Features

Implemented FLIP 341: Add 128-bit fixed-point types to Cadence

  • Add Fix128 and UFix128 types to Cadence by @SupunS in #4131
  • Add more tests for Fix128 type/value by @SupunS in #4140
  • Add UFix128 type to Cadence by @SupunS in #4147
  • Improve fixedpoint conversions by @SupunS in #4151
  • Test least-significant decimal point truncation by @SupunS in #4155
  • Support Fix128 and UFix128 types in compiler by @SupunS in #4164
  • Handle external overflow/underflow errors from library by @SupunS in #4170
  • Update to latest fixed-point version by @SupunS in #4194

Implemented FLIP 343: Fix numeric type rounding inconsistency

  • Use truncation instead of rounding for big.Int division by @SupunS in #4184

Implemented FLIP 314: Import Aliasing

Improved Cadence Errors to Support LLM Efficiency

  • Update Cadence Errors with rec...
Read more

v1.7.0-preview.3

v1.7.0-preview.3 Pre-release
Pre-release

Choose a tag to compare

@turbolent turbolent released this 03 Sep 21:12

What's Changed

⭐ Features

  • Add UFix128 type to Cadence by @SupunS in #4147
  • [Compiler] Support Fix128 and UFix128 types in compiler by @SupunS in #4164
  • Add Fix128 and UFix128 types to Cadence by @SupunS in #4131

🛠 Improvements

  • Improve fixedpoint conversions by @SupunS in #4151
  • Handle external overflow/underflow errors from library by @SupunS in #4170
  • Update to latest fixed-point version by @SupunS in #4194

🐞 Bug Fixes

🧪 Testing

  • Add more tests for Fix128 type/value by @SupunS in #4140
  • Test least-significant decimal point truncation by @SupunS in #4155

📖 Documentation

Other Changes

  • Merge release/v1.7.0-preview.2 to master by @github-actions[bot] in #4188
  • Bump fixed-point version to v0.1.1 by @SupunS in #4196

New Contributors

Full Changelog: v1.7.0-preview.2...v1.7.0-preview.3

v1.7.0-preview.2

v1.7.0-preview.2 Pre-release
Pre-release

Choose a tag to compare

@turbolent turbolent released this 02 Sep 16:53

What's Changed

💥 Language Breaking Changes

  • Revert "revert "Remove support for account storage format V1""" by @turbolent in #4086

⭐ Features

🛠 Improvements

🐞 Bug Fixes

📖 Documentation

Other Changes

New Contributors

Full Changelog: v1.7.0-preview.1...v1.7.0-preview.2

v1.7.0-preview.1

v1.7.0-preview.1 Pre-release
Pre-release

Choose a tag to compare

@turbolent turbolent released this 14 Aug 21:04

What's Changed

💥 Go API Breaking Chance

⭐ Features

  • [Compiler] Support inherited functions and conditions through delegation by @SupunS in #3734
  • [Compiler] Compile if-let by @turbolent in #3756
  • [Compiler] Compile switch by @turbolent in #3757
  • [Compiler] Support accessing result variable inside post conditions by @SupunS in #3741
  • [Compiler] Compile and execute emit statement by @turbolent in #3768
  • [Compiler] Support basic casting operations in VM by @SupunS in #3767
  • [Compiler] Support compilation for before statements by @SupunS in #3763
  • [Compiler] Implement scoping by @turbolent in #3789
  • [Compiler] Compile fixed-point literals and add UFix64 to VM by @turbolent in #3791
  • [Compiler] Compile for-loops by @SupunS in #3793
  • [Compiler] Compile conditional expression by @turbolent in #3795
  • [Compiler] Compile boolean operators by @turbolent in #3796
  • [Compiler] Compile bitwise operators, add bitwise instructions by @turbolent in #3797
  • [Compiler] Compile remaining unary operators by @turbolent in #3799
  • [Compiler] Compile remaining unary operators by @turbolent in #3800
  • [Compiler] Compile transaction pre/post conditions by @SupunS in #3801
  • [Compiler] Compile force expression by @turbolent in #3803
  • [Compiler] Add type construction and conversion standard-library functions by @SupunS in #3829
  • [Compiler] Add stdlib functions for Account.Capabilities and Account.StorageCapabilities by @SupunS in #3832
  • [Compiler] Support compilation for conditional returns by @SupunS in #3816
  • [Compiler] Compile simple function expressions by @turbolent in #3834
  • [Compiler] Compile simple inner functions by @turbolent in #3839
  • [Compiler] Compile upvalues by @turbolent in #3842
  • [Compiler] Implement unclosed upvalues in VM by @turbolent in #3843
  • [Compiler] Implement closed upvalues in VM by @turbolent in #3846
  • [Compiler] Add UUID to resources by @turbolent in #3850
  • [Compiler] Support builtin methods for user-defined types by @SupunS in #3872
  • [Compiler] Enable access to last instruction, test codegens by @turbolent in #3874
  • [Compiler] Support use of member-functions as function-pointers by @SupunS in #3886
  • [Compiler] Implement Compiler/VM-based environment, enable for contract invocations by @turbolent in #3894
  • [Compiler] Implement saturating arithmetic functions in VM by @turbolent in #3911
  • [Compiler] Unify emission of event value and event fields, enable event emission in VM environment by @turbolent in #3916
  • [Compiler] Compile global variables by @SupunS in #3920
  • [Compiler] Implement Number types' methods and static functions by @turbolent in #3982
  • [Compiler] Implement built-in methods and functions for Address by @turbolent in #3983
  • [Compiler] Support optional chaining in compiler by @SupunS in #3984
  • [Compiler] Improve native functions by @turbolent in #3986
  • [Compiler] Compile second value assignment by @SupunS in #3987
  • [Compiler] Check resource loss in assignments by @SupunS in #3988
  • [Compiler] Compile enums by @turbolent in #3989
  • [Compiler] Computation metering by @turbolent in #3998
  • [Compiler] Enable execution of scripts with VM by @turbolent in #4000
  • [Compiler] Enable execution of transactions with VM by @turbolent in #4001
  • [Compiler] Test optional arguments by @RZhang05 in #3997
  • [Compiler] Compile swap statements by @turbolent in #4003
  • [Compiler] Emit default destroyed events when resources are destroyed by @SupunS in #4004
  • [Compiler] Implement storage and container mutation prevention by @turbolent in #4007
  • [Compiler] Improve scripts by @turbolent in #4013
  • [Compiler] Implement Capability.check function, fix Capability.borrow by @turbolent in #4017
  • [Compiler] Implement String Templates by @RZhang05 in #4019
  • [Compiler] Close upvalues for locals of for loops by @turbolent in #4020
  • [Compiler] Compile void expressions by @turbolent in #4023
  • [Compiler] Implement more stdlib functions by @turbolent in #4031
  • [Compiler] Implement Account.Keys functions for VM by @turbolent in #4032
  • [Compiler] Implement Account.Inbox and Account.AccountCapabilities functions for VM by @turbolent in #4034
  • [Compiler] Implement RLP and BLS functions for VM by @turbolent in #4035
  • [Compiler] Implement StorageCapabilityController and AccountCapabilityController functions for VM by @turbolent in #4036
  • [Compiler] Implement HashAlgorithm and SignatureAlgorithm for VM by @turbolent in #4037
  • [Compiler] Implement PublicKey constructor for VM by @turbolent in #4038
  • [Compiler] Allow loading of flow.* types in VM environment by @turbolent in #4039
  • [Compiler] Implement some Account.Contracts and DeployedContract functions by @turbolent in #4044
  • Merge compiler feature branch by @turbolent in #4049
  • [Compiler] Add support for injected values and types in VM environment by @turbolent in #4055
  • [Compiler] Implement contract deployment and update in VM environment by @turbolent in #4060
  • [Compiler] Implement contract removal and recoverable contract update for VM environment by @turbolent in #4061
  • [Compiler] Add call stack depth limit to VM by @turbolent in #4067
  • [Compiler] Implement getting contract value in VM by @turbolent in #4069
  • Add a tool to generate a CSV file of all parser and semantic errors by @turbolent in #4064
  • [Compiler] Implement InclusiveRange by @turbolent in #4081
  • Add a new tool to decode a single slab by @turbolent in #4119
  • [Compiler] Improve tracing in interpreter, add support for tracing to VM by @turbolent in #4122
  • Validate documentation links of errors by @turbolent in #4132
  • Add a tool which allows applying changes to a Go expression by @turbolent in #4145

🛠 Improvements

  • [Compiler] Optimize function calls by @SupunS in #3704
  • [Custom VM] Improve and test instruction printer by @turbolent in #3706
  • [Compiler+VM PoC] Refactor bytecode encoding by @turbolent in #3713
  • [Compiler+VM PoC] Refactor instruction encoding/decoding by @turbolent in #3714
  • [Compiler+VM PoC] Allow compiler to generate instructions, retarget VM to use instructions by @turbolent in #3715
  • [Compiler+VM POC] Generate the code for the instructions by @turbolent in #3716
  • [Compiler+VM POC] Improve the custom instructions set by @SupunS in #3718
  • [Compiler+VM POC] Document effects of instructions on value stack and control stack by @turbolent in #3719
  • [Compiler] Fix linter warnings by @SupunS in https:...
Read more

v1.6.5

Choose a tag to compare

@turbolent turbolent released this 14 Aug 20:48

What's Changed

🐞 Bug Fixes

Other Changes

  • Merge release/v1.6.1 to v1.6 by @github-actions[bot] in #4025
  • [v1.6] Merge v1.6.3 by @turbolent in #4136

Full Changelog: v1.6.3...v1.6.5

⌂ 换网址