Repository navigation
Releases
v1.8.2
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
- [v1.7] Fix 128-bit fixed-point code by @turbolent in #4253
- Port v1.7.2-rc.1 by @turbolent in #4310
📖 Documentation
- Fix typos in documentation and comments in #4298
Other Changes
- Merge
release/v1.7.1tov1.7by @github-actions[bot] in #4254 - Merge
release/v1.8.1tomasterby @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
What's Changed
🐞 Bug Fixes
- [v1.7] Port v1.7.2-rc.1 by @turbolent in #4309
Other Changes
- Merge
release/v1.7.1tov1.7by @github-actions[bot] in #4254
Full Changelog: v1.7.1...v1.7.2
v1.8.1
What's Changed
🐞 Bug Fixes
- Improve computation profiling by @turbolent in #4279
Other Changes
- Merge
release/v1.8.0tomasterby @github-actions[bot] in #4278
Full Changelog: v1.8.0...v1.8.1
v1.8.0
What's Changed
⭐ Features
- [Compiler] Attachments #1/3 by @RZhang05 in #4052
- [Compiler] Attachments #2/3 by @RZhang05 in #4087
- [Compiler] Attachments #3/3 by @RZhang05 in #4111
- Add support for comparing two map data slabs to slab decoding tool by @turbolent in #4234
- Add support for collecting computation usage profiles by @turbolent in #4266
- [Compiler] Attachments by @RZhang05 in #4204
🛠 Improvements
- refactor: use slices.Contains to simplify code by @keeghcet in #4206
- Improve tracing by @turbolent in #4217
- Improve tracing by @turbolent in #4218
- [Compiler] Improve globals. by @RZhang05 in #4211
- [Compiler] Simplify imported globals linking by @SupunS in #4220
- [Compiler] Improve enum case value global initialization by @turbolent in #4221
- [Compiler] Initialize all variables of a dynamically linked program by @SupunS in #4223
- [Compiler] Reuse elaboration for imports when possible. by @RZhang05 in #4215
- [Compiler] Refactor dynamic method invocation by @SupunS in #4226
- [Compiler] Improve transaction program init function by @turbolent in #4229
- [Compiler] Avoid creating an array for resource default-destroy events by @SupunS in #4230
- [Compiler] Trace event emission by @turbolent in #4231
- [Compiler] Skip encoding-decoding of constants by @SupunS in #4214
- Improve tracing and CI by @turbolent in #4246
- [Compiler] Always transfer on move operator. Remove redundent transfers by @SupunS in #4208
- [Compiler] Generate opcode.isControlFlow from instructions.yml. by @RZhang05 in #4238
- Unify move-operator interpretation to match the VM by @SupunS in #4245
- [Compiler] Improve error position/location info by @turbolent in #4247
- [Compiler] Create unified interface for native/host functions by @RZhang05 in #4232
- Remove per-context coverage report, use runtime config's by @turbolent in #4255
- [Compiler] Unify natives. by @RZhang05 in #4248
- [Compiler] Fix performance regression by @turbolent in #4258
- Remove wabt by @turbolent in #4260
- Rename unified to native, clean up native functions. by @RZhang05 in #4259
- Unify natives in the compiler/vm and interpreter. by @RZhang05 in #4264
- Set error location range in interpreter like in VM by @turbolent in #4249
- Remove location range passing code – Part 1/2 by @turbolent in #4250
- Remove location range passing code – Part 2/2 by @turbolent in #4251
- Remove unused location range parameter from native functions by @turbolent in #4268
- Replace variadic arguments parameters with slices by @turbolent in #4269
- Fix naming of "type parameters" which are actually type arguments by @turbolent in #4270
- Avoid unnecessary allocation of type arguments iterators by @turbolent in #4271
- Remove
vm.NativeFunctionVMand adaption tointerpreter.NativeFunctionby @turbolent in #4272 - Address reviews on compilation for attachments. by @RZhang05 in #4275
- Improve type conversion error by @turbolent in #4181
- Replace for-delete loops with clear by @turbolent in #4277
- Improve computation profiling by @turbolent in #4276
🐞 Bug Fixes
- [Compiler] Initialize all variable of all imports by @SupunS in #4222
- Fix tracing of function invocations by @turbolent in #4224
- [Compiler] Fix
invokeMethodDynamicby @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
- Merge master into feature/compile-attachments. by @RZhang05 in #4162
- Merge
release/v1.7.0tomasterby @github-actions[bot] in #4207 - Merge master into feature/attachments by @RZhang05 in #4233
- Speed up benchmarks by @turbolent in #4261
- Merge master into unify natives. by @RZhang05 in #4265
- Update to Go 1.24 by @turbolent in #4267
- Merge master into Attachment compilation feature branch by @turbolent in #4274
New Contributors
Full Changelog: v1.7.0...v1.8.0
v1.7.1
What's Changed
🐞 Bug Fixes
- [v1.7] Fix 128-bit fixed-point code by @turbolent in #4253
Full Changelog: v1.7.0...v1.7.1
v1.7.0
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 keywordNow:
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-guideThese 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 0x03This 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
Fix128andUFix128types to Cadence by @SupunS in #4131 - Add more tests for
Fix128type/value by @SupunS in #4140 - Add
UFix128type to Cadence by @SupunS in #4147 - Improve fixedpoint conversions by @SupunS in #4151
- Test least-significant decimal point truncation by @SupunS in #4155
- Support
Fix128andUFix128types 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
Implemented FLIP 314: Import Aliasing
- Import Aliasing by @RZhang05 in #4033
- Improve import aliasing by @turbolent in #4199
- Import Aliasing by @RZhang05 in #4203
Improved Cadence Errors to Support LLM Efficiency
- Update Cadence Errors with rec...
v1.7.0-preview.3
What's Changed
⭐ Features
- Add
UFix128type to Cadence by @SupunS in #4147 - [Compiler] Support
Fix128andUFix128types in compiler by @SupunS in #4164 - Add
Fix128andUFix128types 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
- [Compiler] Fix enums by @RZhang05 in #4189
- Use truncation instead of rounding for
big.Intdivision by @SupunS in #4184 - [Compiler] Do not transfer and convert moved value by @turbolent in #4193
🧪 Testing
- Add more tests for
Fix128type/value by @SupunS in #4140 - Test least-significant decimal point truncation by @SupunS in #4155
📖 Documentation
- Add release badge to README by @Olexandr88 in #4190
Other Changes
- Merge
release/v1.7.0-preview.2tomasterby @github-actions[bot] in #4188 - Bump fixed-point version to
v0.1.1by @SupunS in #4196
New Contributors
- @Olexandr88 made their first contribution in #4190
Full Changelog: v1.7.0-preview.2...v1.7.0-preview.3
v1.7.0-preview.2
What's Changed
💥 Language Breaking Changes
- Revert "revert "Remove support for account storage format V1""" by @turbolent in #4086
⭐ Features
- Add suggested fixes to errors by @turbolent in #4157
- Add suggested fixes to errors by @turbolent in #4158
- Add and improve suggested fixes by @turbolent in #4159
- Add suggested fixes for sema errors by @turbolent in #4165
🛠 Improvements
- Add Rosetta to the config of the update tool by @turbolent in #4156
- [4062-part-4] Update Cadence Errors by @briandoyle81 in #4128
- Improve type parsing errors by @turbolent in #4141
- Improve comment and statement parsing errors by @turbolent in #4142
- Improve parsing errors by @turbolent in #4143
- Improve sema errors by @turbolent in #4144
- Improve declaration parsing errors by @turbolent in #4146
- Improve statement parsing errors by @turbolent in #4148
- Improve parsing errors by @turbolent in #4149
- Improve expression parsing errors by @turbolent in #4150
- Simplify errors for
pubaccess modifier by @turbolent in #4160 - Improve insertion positions of suggested fixes by @turbolent in #4161
- Improve error messages by @turbolent in #4163
- refactor: use the built-in max/min to simplify the code by @wmypku in #4174
- Handle partial AST nodes when pretty printing by @turbolent in #4173
- Handle partial AST nodes when pretty printing – Part 2 by @turbolent in #4176
- [Compiler] Improve tracing in VM by @SupunS in #4175
- Handle partial AST nodes when pretty printing – Part 3 by @turbolent in #4178
- Handle partial AST nodes when pretty printing – Part 4 by @turbolent in #4179
- Refactor memory metering by @turbolent in #4166
- Refactor computation metering by @turbolent in #4167
- Return non-pointer error types as non-pointer values by @turbolent in #4182
- Fix typos by @omahs in #3891
- Make tracing enabled a build time flag by @turbolent in #4187
- [Compiler] Move empty initializer and enum lookup function creation from compiler into desugaring. by @RZhang05 in #4185
🐞 Bug Fixes
- Fix spacing in pretty printed AST nodes by @turbolent in #4180
📖 Documentation
- chore: fix wrong comment by @closeobserve in #3861
Other Changes
- Merge
release/v1.7.0-preview.1tomasterby @github-actions[bot] in #4153 - Improve release note generation by @turbolent in #4154
- Bump atree version to v0.10.1 by @fxamacker in #4168
- Update dependencies by @turbolent in #4169
New Contributors
- @wmypku made their first contribution in #4174
- @closeobserve made their first contribution in #3861
Full Changelog: v1.7.0-preview.1...v1.7.0-preview.2
v1.7.0-preview.1
What's Changed
💥 Go API Breaking Chance
- [Compiler] Cache compiled programs by @turbolent in #3956
- [Compiler] Remove environment composite functions handler by @turbolent in #4042
- Remove interpreter shared state feature by @turbolent in #4078
⭐ 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
resultvariable 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.CapabilitiesandAccount.StorageCapabilitiesby @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
Numbertypes' methods and static functions by @turbolent in #3982 - [Compiler] Implement built-in methods and functions for
Addressby @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.checkfunction, fixCapability.borrowby @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.ContractsandDeployedContractfunctions 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:...
v1.6.5
What's Changed
🐞 Bug Fixes
- [v1.6] Port v1.6.1-rc.1 by @turbolent in #4021
- [v1.6] Port v1.6.4-rc.1: Fix conformance kind mismatch error reporting by @SupunS in #4133
- [v1.6] Fix NPM version by @turbolent in #4138
Other Changes
- Merge
release/v1.6.1tov1.6by @github-actions[bot] in #4025 - [v1.6] Merge v1.6.3 by @turbolent in #4136
Full Changelog: v1.6.3...v1.6.5