This release contains several breaking changes, please refer to the migration notes for more information.
cashc compiler
- ✨ Add support for
for,whileanddo-whileloops. - ✨ Add support for compound assignment operators (
+=,-=) and increment/decrement operators (++,--). - ✨ Add support for bitwise and arithmetic shift operators (
<<,>>) and bitwise inversion (~). - ✨ Add
fingerprintfield to artifact to allow for fingerprinting of the contract bytecode. - ✨ Add
unsafe_bool()andunsafe_int()casting for semantic-only casts. - ✨ Add support for narrowing bytes types after
x.length == Nand checks in require or if statements. - 🛠️ BREAKING: Automatically inject
require(tx.time >= tx.locktime)when a function usestx.locktimewithout atx.timecheck in scope, ensuring the spending input is non-final sonLockTimeis enforced. This can be disabled with theenforceLocktimeGuard: falsecompiler option (CLI:--skip-enforce-locktime-guard). - 🛠️ BREAKING: Function parameter types are now strictly enforced (bounded bytes and boolean values). This can be disabled with the
enforceFunctionParameterTypes: falsecompiler option (CLI:--skip-enforce-function-parameter-types). - 🐛 Fix issue where casting bytes larger than
bytes8tointwas not allowed. - 🐛 Fix issue where empty bytecode contracts were not properly compiled.
- 🐛 BREAKING: Fix issue where
bool()casting did not change the value of the argument. - 💥 BREAKING: Rename
bytes4(int)andbytes(int, 4)totoPaddedBytes(int, 4). - 💥 BREAKING: Rename
bytes4(bytes)tounsafe_bytes4(bytes). - 🐎 Add optimisations for negated number comparisons and boolean comparisons.
CashScript SDK
- ✨ Add support for loops in debug tooling.
- ✨ Add support for
p2scontract type. - ✨ Add
addBchChangeOutputIfNeeded()method toTransactionBuilderclass. - ✨ Add
addTokenChangeOutputIfNeeded()method toTransactionBuilderclass for adding a fungible token change output for a specific category. - ✨ Add
getTransactionSizemethod toTransactionBuilderclass. - ✨ Add
lockingBytecodeproperty toContractclass. - ✨ Add
getUtxosForLockingBytecode()method toElectrumNetworkProviderclass andMockNetworkProviderinterface. - ✨ In the
MockNetworkProvider,addUtxo()now also allows UTXOs to be added by locking bytecode. - ✨ Add
gatherBchUtxos()andgatherFungibleTokenUtxos()functions to the SDK for gathering UTXOs. - ✨ Add specific network error classes to standardise error handling in network providers.
- ✨ Add TSDoc strings for all public classes and methods.
- 🐛 Fix issue where
FailedTransactionErrorwould not show underlying error if BitAuth URI generation failed. - 💥 BREAKING: Remove
BitcoinRpcNetworkProviderandFullStackNetworkProviderfrom the SDK. - 🛠️ BREAKING: Rename
addressTypeoption onContractconstructor tocontractType. - 🛠️ BREAKING: Remove undocumented
redeemScriptproperty fromContractclass. - 🛠️ BREAKING: Remove undocumented
buildLibauthTransaction()method fromTransactionBuilderclass. - 🛠️ Update default VM target to
BCH_2026_05. - 🛠️ Improve validation when adding outputs to a transaction.
- 🛠️ Improve package size by tidying up dependencies.
Testing Suite
- 🛠️ Add README.md to help guide users on how to use the testing suite.
- 🛠️ Compile all contracts in the
contracts/directory and save the artifacts in theartifacts/directory. - 🛠️ Compile TS artifacts as well as JSON artifacts.
- 🛠️ Add key management utilities for testing.