Skip to content

v0.13.0

Latest

Choose a tag to compare

@rkalis rkalis released this 26 May 08:53
· 3 commits to master since this release
a346166

This release contains several breaking changes, please refer to the migration notes for more information.

cashc compiler

  • ✨ Add support for for, while and do-while loops.
  • ✨ Add support for compound assignment operators (+=, -=) and increment/decrement operators (++, --).
  • ✨ Add support for bitwise and arithmetic shift operators (<<, >>) and bitwise inversion (~).
  • ✨ Add fingerprint field to artifact to allow for fingerprinting of the contract bytecode.
  • ✨ Add unsafe_bool() and unsafe_int() casting for semantic-only casts.
  • ✨ Add support for narrowing bytes types after x.length == N and checks in require or if statements.
  • 🛠️ BREAKING: Automatically inject require(tx.time >= tx.locktime) when a function uses tx.locktime without a tx.time check in scope, ensuring the spending input is non-final so nLockTime is enforced. This can be disabled with the enforceLocktimeGuard: false compiler 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: false compiler option (CLI: --skip-enforce-function-parameter-types).
  • 🐛 Fix issue where casting bytes larger than bytes8 to int was 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) and bytes(int, 4) to toPaddedBytes(int, 4).
  • 💥 BREAKING: Rename bytes4(bytes) to unsafe_bytes4(bytes).
  • 🐎 Add optimisations for negated number comparisons and boolean comparisons.

CashScript SDK

  • ✨ Add support for loops in debug tooling.
  • ✨ Add support for p2s contract type.
  • ✨ Add addBchChangeOutputIfNeeded() method to TransactionBuilder class.
  • ✨ Add addTokenChangeOutputIfNeeded() method to TransactionBuilder class for adding a fungible token change output for a specific category.
  • ✨ Add getTransactionSize method to TransactionBuilder class.
  • ✨ Add lockingBytecode property to Contract class.
  • ✨ Add getUtxosForLockingBytecode() method to ElectrumNetworkProvider class and MockNetworkProvider interface.
  • ✨ In the MockNetworkProvider, addUtxo() now also allows UTXOs to be added by locking bytecode.
  • ✨ Add gatherBchUtxos() and gatherFungibleTokenUtxos() 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 FailedTransactionError would not show underlying error if BitAuth URI generation failed.
  • 💥 BREAKING: Remove BitcoinRpcNetworkProvider and FullStackNetworkProvider from the SDK.
  • 🛠️ BREAKING: Rename addressType option on Contract constructor to contractType.
  • 🛠️ BREAKING: Remove undocumented redeemScript property from Contract class.
  • 🛠️ BREAKING: Remove undocumented buildLibauthTransaction() method from TransactionBuilder class.
  • 🛠️ 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 the artifacts/ directory.
  • 🛠️ Compile TS artifacts as well as JSON artifacts.
  • 🛠️ Add key management utilities for testing.