v0.4.0
cashc compiler
- ✨ - Add
.reverse()member function tobytesandstringtypes. - ✨ - Add bitwise operators
&,^,|. - ✨ - Allow casting
intto variable sizebytesbased onsizeparameter. - 💥 BREAKING: Casting from
intto unboundedbytestype now does not performOP_NUM2BIN. Instead it is a purely semantic cast to signal that an integer value should be treated as a bytes value. - 🏇 Compiler optimisations.
- Use
NUMEQUALVERIFYfor the final function in a contract. - Only drop the final
VERIFYif the remaining stack size is less than 5. - Precalculate
OutputNullDataargument size.
- Use
- 🐛 Fix a bug where return type of
sha1was incorrectly marked asbytes32. - 🐛
Data.decodeBoolonly treated numerical zero as false, now any zero-representation is considered false (e.g. 0x0000, -0, ...).
CashScript SDK
- ✨ Add ability to provide hardcoded inputs to the transaction rather than use CashScript's coin selection (authored by @maikelmclauflin through #61).
- 💥 BREAKING: Refactor the transaction flow to a fluent API
- Remove the
TxOptionsargument and other arguments to the Transactionsend()function. - Instead these parameters are passed in through fluent functions
from(),to(),withOpReturn(),withAge(),withTime(),withHardcodedFee(),withFeePerByte()andwithMinChange(). - After specifying at least one output with either
to()orwithOpReturn()the transaction is ready. From here the transaction can be sent to the network with thesend()function, the transaction hex can be returned with thebuild()function, or the meep debugging command can be returned with themeep()function.
- Remove the
- 💥 Remove
Contract.fromCashFile()andContract.fromArtifact()which were deprecated in favour orContract.compile()andContract.import()in v0.2.2.
Migration
This update contains several breaking changes. See the migration notes for a full migration guide.