Releases: FuelLabs/sway-libs
Releases · FuelLabs/sway-libs
v0.24.0
What's Changed
Added v0.24.0
- #293 Adds the
BytecodeRoot
andContractConfigurables
types to the Bytecode Library. - #286 Adds the
_metadata()
function to the Asset Library.
Changed v0.24.0
- #286 Updates the repository to Sway-Standards v0.6.0 and implements the new SRC-20 and SRC-7 logging specifications.
- #286
_set_metadata()
,_set_name()
and_set_symbol()
now revert if the metadata is an empty string. - #286
_set_metadata()
now reverts if the metadata is empty bytes. - #286
_mint()
and_burn()
now revert if theamount
argument is zero. - #289 Bumps Sway-Libs to forc
v0.63.3
, fuel-corev0.34.0
, and fuelsv0.66.2
. - #290 Update the Upgradeability library to use a specific storage slot for owner functionality.
- #291 Prepares for the
v0.24.0
release.
Breaking v0.24.0
- #290 The
_proxy_owner()
,only_proxy_owner()
and_set_proxy_owner()
functions no longer takestorage.proxy_owner
as a parameter. Instead they directly read and write to the storage slot0xbb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754
which issha256("storage_SRC14_1")
.
Before:
fn foo() {
let stored_proxy_owner = _proxy_owner(storage.proxy_owner);
only_proxy_owner(storage.proxy_owner);
_set_proxy_owner(new_proxy_owner, storage.proxy_owner);
}
After:
fn foo() {
let stored_proxy_owner = _proxy_owner();
only_proxy_owner();
_set_proxy_owner(new_proxy_owner);
}
Full Changelog: v0.23.0...v0.24.0
v0.23.1
v0.23.0
What's Changed
Breaking
- #263 Removes the
TwosComplement
trait in favor ofWrappingNeg
.
The following demonstrates the breaking change. While this example code uses the I8
type, the same logic may be applied to the I16
, I32
, I64
, I128
, and I256
types.
Before:
let my_i8 = i8::zero();
let twos_complement = my_i8.twos_complement();
After:
let my_i8 = i8::zero();
let wrapping_neg = my_i8.wrapping_neg();
- #272 The
From
implementation for all signed integers to their respective unsigned integer has been removed. TheTryFrom
implementation has been added in its place.
Before:
let my_i8: I8 = I8::from(1u8);
After:
let my_i8: I8 = I8::try_from(1u8).unwrap();
- #273 The
neg_from
implementation for all signed integers has been removed. Theneg_try_from()
implementation has been added in its place.
The following demonstrates the breaking change. While this example code uses the I8
type, the same logic may be applied to the I16
, I32
, I64
, I128
, and I256
types.
Before:
let my_negative_i8: I8 = I8::neg_from(1u8);
After:
let my_negative_i8: I8 = I8::neg_try_from(1u8).unwrap();
- #278 Deprecates the Fixed Point number library. The Fixed Point number library is no longer available.
Added
- #259 Adds a new upgradability library, including associated tests and documentation.
- #265 Adds the
SetMetadataEvent
and emitsSetMetadataEvent
when the_set_metadata()
function is called. - #270 Adds
OrdEq
functionality to Signed Integers. - #272 Adds the
TryFrom
implementation from signed integers to unsigned integers.
Changed
- #265 Enables the metadata events now that the Rust SDK supports wrapped heap types.
- #269 Hashes the string "admin" and with the bits of an Identity when creating a storage slot to storage an admin in the Admin Library.
- #276 Prepares for v0.23.0 release.
- #278 Deprecates the Fixed Point number library.
Fixed
- #258 Fixes incorrect instructions on how to run tests in README and docs hub.
- #262 Fixes incorrect ordering comparison for IFP64, IFP128 and IFP256.
- #263 Fixes
I256
's returned bits. - #263 Fixes
I128
andI256
's zero or "indent" value. - #268 Fixes subtraction involving negative numbers for
I8
,I16
,I32
,I64
,I128
, andI256
. - #272 Fixes
From
implementations for Signed Integers withTryFrom
. - #273 Fixes negative from implementations for Signed Integers.
- #274 Fixes the
swap_configurables()
function to correctly handle the case where the bytecode is too large to fit in the buffer. - #275 Fixes an infinite loop in the Bytecode root library's
_compute_bytecode_root()
function.
Full Changelog: v0.22.0...v0.23.0
v0.22.0
What's Changed
- Hotfix: Fix CI to forc v0.56.0 and tests to fuels v0.57.0 by @bitzoic in #242
- Bump Merkle Library to use fuel-merkle v0.49 by @bitzoic in #243
- Fix unused lines from fixed point library by @SwayStar123 in #240
- Update Pull Request template to include checklist by @bitzoic in #249
- Update to forc v0.60.0 by @bitzoic in #250
- Prepare for v0.22.0 release by @bitzoic in #252
Full Changelog: v0.21.0...v0.22.0
v0.21.0
v0.20.1
v0.20.0
What's Changed
- Fix incorrect native asset URL in README by @BladeRunner713 in #213
- Deploy generated docs to github pages by @bitzoic in #215
- Fix github pages error by @bitzoic in #216
- add total_assets_only_incremented_once test by @SwayStar123 in #217
- Remove Workspaces by @bitzoic in #224
- Introduce the Sway-Libs Book by @bitzoic in #225
- Change
sway_libs::asset::mint::*
tosway_libs::asset::supply::*
by @bitzoic in #227 - Fix Sway-Libs Book Links in README by @bitzoic in #229
- chore: fix some typos in comments by @laterlaugh in #234
- Additional Ownership Lib Tests by @bitzoic in #231
- Bump to forc v0.53.0 by @bitzoic in #226
Breaking Changes
- All libraries are now imported using a single import:
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.20.0" }
From there you may import your specific library:
use sway_libs::asset::base::*;
- The
asset::mint
import is nowasset::supply
New Contributors
- @laterlaugh made their first contribution in #234
Full Changelog: v0.19.0...v0.20.0