- Added a new
notification
package with data structures and functions to help create SNIP-52 private push notifications compliant secret contracts (#99).
- Fixed
Wasm contract requires unsupported import: "env.rustsecp256k1_v0_8_1_context_preallocated_size
error by freezingcc
version to1.1.10
.
- Bumped
cosmwasm-std
version tov1.1.11
(#93).
- Added optional
admin
field toutils::InitCallback::to_cosmos_msg
(#93).
- Only padding encrypted attributes in
utils::pad_handle_result
(#92). - Support
backtraces
feature forKeyMap
andKeySet
(#90).
- Replace
cosmwasm-std
withsecret-cosmwasm-std
in prep for crates.io packages (#87). - Add
RngCore
&CryptoRng
trait toPrng
(#87). - Added
from_env
function forContractPrng
that consumesenv.block.random
(#87).
- Renamed
Prng
asContractPrng
(#87).
- Fixed a remove bug in
Keymap
andKeyset
(#86).
- Fixed a bug in
Keymap
andKeyset
(#84).
- SecureItem - storage access pattern obfuscating Item (#82).
- Change the internal
rng
field of thePrng
struct to be public (#81),
This release upgrades all secret-toolkit
packages to be compatible with Cosmwasm v1.1.
The APIs remains the same, but it is necessary to upgrade the contract's cosmwasm
dependencies to v1.1.0
- Since
cosmwasm v1.1
had some breaking changes to it's dependencies, this version will not work withcosmwasm v1
. It is necessary to upgrade tocosmwasm v1.1
in order to use this release and vice verca. However, neithercosmwasm v1.1
or this version did not have breaking changes to the APIs.
-
This release changes the internal toolkit package to be part of the workspace - this fixes default-features flags in some of the crates. In addition, crates used by the toolkit have been bumped, and the edition of the toolkit crates has been bumped to 2021.
-
Added the
Keyset
storage object (A hashset like storage object). -
Allowed further customisation of Keymap and Keyset with new constructor structs called
KeymapBuilder
andKeysetBuilder
which allow the user to disable the iterator feature (saving gas) or adjust the internal indexes' page size so that the user may determine how many objects are to be stored/loaded together in the iterator. -
::new_with_page_size(namespace, page_size)
method was added toAppendStore
andDequeStore
so that the user may adjust the internal indexes' page size which determine how many objects are to be stored/loaded together in the iterator. -
Minor performance upgrades to
Keymap
,AppendStore
, andDequeStore
.
- Older rust compilers ( < 1.50 ) may not work due to upgraded dependencies
This release upgrades all secret-toolkit
packages to be compatible with Cosmwasm v1.0 (Secret Network v1.4).
The APIs remains the same, but it is necessary to upgrade the contract's cosmwasm
dependencies to v1.0.0
.
- This version will not work with
cosmwasm v0.10
. It is necessary to upgrade tocosmwasm v1
in order to use this release.
This release includes some minor fixed to the storage package which required some breaking changes. We are releasing these breaking changes because we reached the conclusion that the current interfaces are prone to bugs, or inefficient. Unless you are using these specific interfaces, you should be able to upgrade from 0.4 without issues.
- Removed the implementations of Clone for storage types which are not useful and may cause data corruption if used incorrectly.
- Changed
Keymap::insert
to take the item by reference rather than by value. This should reduce the cost of calling that function by avoiding cloning.
- Changed the implementation of the
add_prefix
methods in the storage package to use length prefixing, which should help avoid namespace collisions.
- BUGFIX: implementation of
.clone
method fixed - Added
.add_suffix
and.clone
methods tosecret-toolkit::storage::Item
- Minor performance updates to
secret-toolkit::storage::Keymap
- BUGFIX:
Item::is_empty
was returning the opposite value from what you'd expect.
This release mostly includes the work of @srdtrk in #53. Thanks Srdtrk!
It revamps the secret-toolkit-storage
package to make it more similar to cw-storage-plus
and much easier
to use. It also removes the Cashmap
type from the incubator in favor of KeyMap
in secret-toolkit-storage
.
This is a summary of the changes and additions in this release:
- Minimum Rust version is bumped to the latest v1.63. This is because we want to use
Mutex::new
in aconst fn
. - No more distinction between
Readonly*
and*Mut
types. Instead, methods take references or mutable references to the storage every time. - Usage of
PrefixedStore
is made mostly unnecessary. - Storage type's constructors are const functions, which means they can be initialized as global static variables.
- Added
secret-toolkit::storage::Item
which is similar toItem
fromcw-storage-plus
orTypedStore
fromcosmwasm_storage
v0.10. - Added
secret-toolkit::storage::KeyMap
which is similar toCashmap
. Cashmap
is completely removed.
A full guide to using the new storage
types can be found
in the package's readme file.
- Fixed compilation issue with Rust v1.61 (#46, #48)
- Removed Siphasher dependency (#46, #48)
- BUGFIX:
secret-toolkit::utils::FeatureToggle::handle_pause
had an inverse authorization check: only non-pausers could pause features.
- Removed the
ecc-secp256k1
feature fromsecret-toolkit-crypto
dependency ofsecret-toolkit-permit
.- This tiny change significantly reduces the size of binaries that only use the permit feature.
-
Added
clear
method toAppendStore
andDequeStore
to quickly reset the collections (#34) -
docs.rs documentation now includes all sub-crates.
-
BUGFIX:
secret-toolkit::snip721::Metadata
was severely out of date with the SNIP-721 specification, and not useful. It is now compatible with deployed SNIP-721 contracts. -
Added
types
module under theutil
package, to standardize often used types. -
Added
secret-toolkit::viewing_key
, which can be imported by enabling theviewing-key
feature. -
Added
secret-toolkit::permit::PubKey::canonical_address()
. -
Types in
secret-toolkit::permit::Permit
are now generic over the type of permissions they accept. -
Added the
maxheap
type to the incubator. -
Added
secret-toolkit::utils::feature_toggle
which allow managing feature flags in your contract.
-
secret-toolkit::permit::validate()
Now supports validating any type of Cosmos address. Interface changes: Now takes a reference to the current token address instead of taking it by value and an optional hrp string. In addition, it returns a String and not HumanAddr. -
Renamed
secret-toolkit::permit::Permission
tosecret-toolkit::permit::TokenPermission
. -
secret-toolkit-crypto
now has features["hash", "rng" and "ecc-secp256k1"]
which are all off by default - enable those you need. -
secret-toolkit-crypto::secp256k1::PublicKey::parse
now returnsStdResult<Self>
. -
Changes to
secret-toolkit::crypto::secp256k1::PrivateKey::sign
:- The
data
argument is now any slice of bytes, and not the hash of a slice of data. - the
Api
fromdeps.api
is now required as the second argument as we now use the precompiled implementation.
- The
-
Changes to
secret-toolkit::crypto::secp256k1::PublicKey::verify
:- the
Api
fromdeps.api
is now required as the third argument as we now use the precompiled implementation.
- the
-
secret-toolkit-incubator
now has features["cashmap", "generational-store"]
which are all off by default.
This release includes a ton of new features, and a few breaking changes in various interfaces. This version is also the first released to crates.io!
-
Change: when a query fails because of a bad viewing key, this now correctly fails with
StdError::Unauthorized
-
Added support for some missing SNIP-20 functionality, such as
CreateViewingKey
-
Added support for SNIP-21 queries (memos and improved history) which broke some interfaces
-
Added support for SNIP-22 messages (batch operations)
-
Added support for SNIP-23 messages (improved Send operations) which broke some interfaces
-
Added support for SNIP-24 permits
-
Added
Base64Of<S: Serde, T>
,Base64JsonOf<T>
, andBase64Bincode2Of<T>
, which are wrappers that automatically deserializes base64 strings toT
. It can be used in message types' fields instead ofBinary
when the contents of the string should have more specific contents. -
Added
storage::DequeStore
- Similar toAppendStore
but allows pushing and popping on both ends -
Added the
secret-toolkit::incubator
package intended for experimental features. It contains:CashMap
- A hashmap like storage abstractionGenerationalIndex
- A generational index storage abstraction
-
The various subpackages can now be selected using feature flags. The default flags are
["serialization", "snip20", "snip721", "storage", "utils"]
while["crypto", "permit", "incubator"]
are left disabled by default.
- Removed unused dev-dependency that was slowing down test compilation times.
This is the first release of secret-toolkit
. It supports:
-
secret-toolkit::snip20
- Helper types and functions for interaction with SNIP-20 contracts. -
secret-toolkit::snip721
- Helper types and functions for interaction with SNIP-721 contracts. -
secret-toolkit::crypto
- Wrappers for known-to-work crypto primitives from ecosystem libraries. We include implementations for Sha256, Secp256k1 keys, and ChaChaRng. -
secret-toolkit::storage
- Types implementing useful storage managements techniques:AppendStore
andTypedStore
, usingbincode2
by default. -
secret-toolkit::serialization
- marker types for overriding the storage format used by types insecret-toolkit::storage
.Json
andBincode2
. -
secret-toolkit::utils
- General utilities for writing contract code.padding
- tools for padding queries and responses.calls
- Tools for marking types as messages in queries and callbacks to other contracts.