Releases: CashScript/cashscript
Releases · CashScript/cashscript
v0.2.2
CashScript SDK
- 🐛 Remove minimaldata encoding in OP_RETURN outputs that caused incompatibility with SLP.
- 📛 Renamed
Contract.fromCashFile
toContract.compile
.- The new function allows to pass in a path to a
.cash
file, or a string of the contract source code. Contract.fromCashFile
still exists for backward compatibility, but is deprecated and will be removed in a later release.
- The new function allows to pass in a path to a
- 📛 Renamed
Contract.fromArtifact
toContract.import
.- The new function allows to pass in a path to a
.json
artifact file, or a JSON object of the artifact. Contract.fromArtifact
still exists for backward compatibility, but is deprecated and will be removed in a later release.
- The new function allows to pass in a path to a
- 🛠️
instance.export
'sfn
argument is now optional.- If it is provided, the artifact is written to the file, if not, it is returned as an object.
v0.2.1
cashc compiler
- ✨ Support
bytes
types with bounded size, e.g.bytes1
,bytes13
,bytes32
. - 🐛 Fix bug in bytecode optimisation
CashScript SDK
- ✨ Support
bytes
types with bounded size, e.g.bytes1
,bytes13
,bytes32
. - 🐦 Automatically output meep command on failed transaction error.
- 🔨 Make the
hashtype
parameter in signature placeholders optional.
v0.2.0
cashc compiler
- 🐎 Implement compiler optimisations
- For the final use of a variable, it is retrieved with OP_ROLL rather than OP_PICK. This removes the need to clean the stack at the end of a contract.
- Final OP_VERIFY OP_TRUE is removed as there is an implicit OP_VERIFY at the end of a Script.
- OP_VERIFY is merged with preceding opcode where applicable.
- Shallow OP_PICK and OP_ROLL are replaced by hardcoded opcodes (e.g. OP_SWAP, OP_DUP).
- Several other bytecode optimisations.
- ✨ Add
pragma
keyword to specify intended compiler version.- Example:
pragma cashscript ^0.2.0;
- Contract fails to compile when compiler version does not satisfy constraints.
- Example:
- 🚨 Add CashProof for all individual bytecode optimisations and for example contracts from 0.1.2 to 0.2.0.
- 🐛 Add "default case" for function selection that fixes a vulnerability where people could spend funds by not calling any function.
- ⬆️ Update dependencies.
CashScript SDK
- ⬆️ Update
cashc
and other dependencies.
Update notes
Due to compiler optimisations, this version of CashScript will output different bytecode than version 0.1.x
. Keep this in mind when updating. If you are using contracts compiled with version 0.1.2
make sure to store an artifact file compiled with version 0.1.2
before upgrading to 0.2.0
to keep using these contracts.
Going forward, it is also recommended to add a pragma directive at the start of each contract file to enforce the compiler version that this contract was written for.
v0.1.2
v0.1.1
CashScript SDK
- 🐛 Bug fixes with incorrect parameter encoding for string/bool/int types.
v0.1.0
- 🎉 Initial release.