Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ concurrency:
env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
RUST_VERSION: 1.84.0
FORC_VERSION: 0.69.0
CORE_VERSION: 0.44.0
RUST_VERSION: 1.90.0
FORC_VERSION: 0.70.2
CORE_VERSION: 0.47.1

jobs:
build-sway-lib:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
- v*

env:
RUST_VERSION: 1.84.0
FORC_VERSION: 0.69.0
CORE_VERSION: 0.44.0
RUST_VERSION: 1.90.0
FORC_VERSION: 0.70.2
CORE_VERSION: 0.47.1

jobs:
deploy-contributing:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ concurrency:
env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
RUST_VERSION: 1.84.0
FORC_VERSION: 0.69.0
CORE_VERSION: 0.44.0
RUST_VERSION: 1.90.0
FORC_VERSION: 0.70.2
CORE_VERSION: 0.47.1

jobs:
verify-branch:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ fn foo() -> I8 {

- [#318](https://github.com/FuelLabs/sway-libs/pull/318) Adds further documentation and examples for the `signed_integers` library.
- [#319](https://github.com/FuelLabs/sway-libs/pull/319) Adds further documentation and examples for the ownership library.
- [#322](https://github.com/FuelLabs/sway-libs/pull/320) Adds further documentation and examples for the asset metadata library.
- #322 Adds further documentation and examples for the asset metadata library.

### Changed v0.24.2

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<a href="https://github.com/FuelLabs/sway-libs/actions/workflows/ci.yml" alt="CI">
<img src="https://github.com/FuelLabs/sway-libs/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://crates.io/crates/forc/0.69.0" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.69.0-orange" />
<a href="https://crates.io/crates/forc/0.70.2" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.70.2-orange" />
</a>
<a href="./LICENSE" alt="forc">
<img src="https://img.shields.io/github/license/FuelLabs/sway-libs" />
Expand Down Expand Up @@ -106,7 +106,7 @@ For more information about implementation please refer to the [Sway Libs Docs Hu

## Running Tests

There are two sets of tests that should be run: inline tests and sdk-harness tests. Please make sure you are using `forc v0.69.0` and `fuel-core v0.44.0`. You can check what version you are using by running the `fuelup show` command.
There are two sets of tests that should be run: inline tests and sdk-harness tests. Please make sure you are using `forc v0.70.2` and `fuel-core v0.47.1`. You can check what version you are using by running the `fuelup show` command.

Make sure you are in the source directory of this repository `sway-libs/<you are here>`.

Expand All @@ -128,7 +128,7 @@ forc test --path tests --release --locked && cargo test --manifest-path tests/Ca
Any instructions related to using a specific library should be found within the README.md of that library.

> **NOTE:**
> All projects currently use `forc v0.69.0`, `fuels-rs v0.70.0` and `fuel-core v0.44.0`.
> All projects currently use `forc v0.70.2`, `fuels-rs v0.70.0` and `fuel-core v0.47.1`.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use ownership::only_owner;
```

> **NOTE:**
> All projects currently use `forc v0.69.0`, `fuels-rs v0.70.0` and `fuel-core v0.44.0`.
> All projects currently use `forc v0.70.2`, `fuels-rs v0.70.0` and `fuel-core v0.47.1`.

## Using Sway Libs

Expand Down
30 changes: 18 additions & 12 deletions examples/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "admin"
source = "path+from-root-9E88A97493D252A9"
dependencies = [
"ownership registry+ownership?0.26.0#QmbVoNUrvCTyQTdE8ZP83XxTQQVzhrevfMqk1rAJAkMFVo!",
"src5",
"src5 registry+src5?0.8.0#QmNRPZrPHFBiEAyWPU8gesdPsD2zb3cMKwEgxJwV1ZEjyD!",
"std",
]

Expand Down Expand Up @@ -67,7 +67,7 @@ dependencies = [
name = "ownership"
source = "path+from-root-9E88A97493D252A9"
dependencies = [
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
]

Expand All @@ -76,7 +76,7 @@ name = "ownership"
version = "0.26.0"
source = "registry+ownership?0.26.0#QmbVoNUrvCTyQTdE8ZP83XxTQQVzhrevfMqk1rAJAkMFVo!"
dependencies = [
"src5",
"src5 registry+src5?0.8.0#QmNRPZrPHFBiEAyWPU8gesdPsD2zb3cMKwEgxJwV1ZEjyD!",
"std",
]

Expand All @@ -85,7 +85,7 @@ name = "ownership_configurable_examples"
source = "member"
dependencies = [
"ownership path+from-root-9E88A97493D252A9",
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
]

Expand All @@ -94,7 +94,7 @@ name = "ownership_examples"
source = "member"
dependencies = [
"ownership path+from-root-9E88A97493D252A9",
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
]

Expand Down Expand Up @@ -161,10 +161,10 @@ dependencies = [

[[package]]
name = "src14"
version = "0.8.0"
source = "registry+src14?0.8.0#QmQduNaJgjotgw2tz5KLv18PckFZP6zLH3Wzk7mqLfwgcu!"
version = "0.8.2"
source = "registry+src14?0.8.2#QmfU1MiScsFLLMQiPFZNuoijwpvZqQb6rQRHnadT5TGyXE!"
dependencies = [
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
]

Expand All @@ -174,17 +174,23 @@ version = "0.8.0"
source = "registry+src5?0.8.0#QmNRPZrPHFBiEAyWPU8gesdPsD2zb3cMKwEgxJwV1ZEjyD!"
dependencies = ["std"]

[[package]]
name = "src5"
version = "0.8.2"
source = "registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!"
dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"

[[package]]
name = "upgradability"
source = "path+from-root-2D2584D311CEA5F2"
dependencies = [
"src14",
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
]

Expand All @@ -193,7 +199,7 @@ name = "upgradability_examples"
source = "member"
dependencies = [
"src14",
"src5",
"src5 registry+src5?0.8.2#QmVxJGt3C8saPmAe14FtecN2bXcZfVfDwsebsgPZumUXs4!",
"std",
"upgradability",
]
2 changes: 1 addition & 1 deletion examples/asset/base_docs/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "base_docs"

[dependencies]
src20 = "0.8.0"
src20 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/basic_src20/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "basic_src20"

[dependencies]
src20 = "0.8.0"
src20 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/basic_src3/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "basic_src3"

[dependencies]
src3 = "0.8.0"
src3 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/basic_src7/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "basic_src7"

[dependencies]
src7 = "0.8.0"
src7 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/metadata_docs/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "metadata_docs"

[dependencies]
src7 = "0.8.0"
src7 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/setting_src20_attributes/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "setting_src20_attributes"

[dependencies]
src20 = "0.8.0"
src20 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/setting_src7_attributes/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "setting_src7_attributes"

[dependencies]
src7 = "0.8.0"
src7 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/asset/supply_docs/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "supply_docs"

[dependencies]
src3 = "0.8.0"
src3 = "0.8.2"
asset = { path = "../../../libs/asset" }
2 changes: 1 addition & 1 deletion examples/ownership/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "ownership_examples"

[dependencies]
src5 = "0.8.0"
src5 = "0.8.2"
ownership = { path = "../../libs/ownership" }
2 changes: 1 addition & 1 deletion examples/ownership_configurable/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "ownership_configurable_examples"

[dependencies]
src5 = "0.8.0"
src5 = "0.8.2"
ownership = { path = "../../libs/ownership" }
4 changes: 2 additions & 2 deletions examples/upgradability/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ license = "Apache-2.0"
name = "upgradability_examples"

[dependencies]
src5 = "0.8.0"
src14 = "0.8.0"
src5 = "0.8.2"
src14 = "0.8.2"
upgradability = { path = "../../libs/upgradability" }
4 changes: 2 additions & 2 deletions libs/admin/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"
12 changes: 6 additions & 6 deletions libs/asset/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ dependencies = [

[[package]]
name = "src20"
version = "0.8.0"
source = "registry+src20?0.8.0#QmSwYjybtdvSF3Ey9RncVUUaFaWsizSBNgAtY9JoyaAHvh!"
version = "0.8.2"
source = "registry+src20?0.8.2#QmUiXq3uPWaf6BxLeNdm8sHsjwbwQ5DRvBGLezv2k5EZ26!"
dependencies = ["std"]

[[package]]
name = "src7"
version = "0.8.0"
source = "registry+src7?0.8.0#QmbDHPdbKzpRg31bxNNLHQ6pyreH2GjHiXjnR7aKoNC2Y5!"
version = "0.8.2"
source = "registry+src7?0.8.2#QmXxuQD9GR4sa5kybYBFf2w2HmBzvUqGN5ypbTmT6gp1V5!"
dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"
6 changes: 3 additions & 3 deletions libs/asset/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Fuel Labs <contact@fuel.sh>"]
entry = "lib.sw"
license = "Apache-2.0"
name = "asset"
version = "0.26.1"
version = "0.26.2"
description = "The Asset Library provides basic helper functions for the SRC-20, SRC-3, and the SRC-7 standards. It is intended to make development of Native Assets using Sway quick and easy while following the standard's specifications."
homepage = "https://docs.fuel.network/docs/sway-libs/asset/"
repository = "https://github.com/FuelLabs/sway-libs"
Expand All @@ -13,5 +13,5 @@ categories = ["Decentralized Finance", "Standards", "Native Assets"]
keywords = ["library"]

[dependencies]
src20 = "0.8.0"
src7 = "0.8.0"
src20 = "0.8.2"
src7 = "0.8.2"
4 changes: 2 additions & 2 deletions libs/big_int/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"
2 changes: 1 addition & 1 deletion libs/big_int/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Fuel Labs <contact@fuel.sh>"]
entry = "big_int.sw"
license = "Apache-2.0"
name = "big_int"
version = "0.26.1"
version = "0.27.0"
description = "The Big Integers library provides a library to use extremely large numbers in Sway."
homepage = "https://docs.fuel.network/docs/sway-libs/bigint/"
repository = "https://github.com/FuelLabs/sway-libs"
Expand Down
2 changes: 1 addition & 1 deletion libs/big_int/src/big_int.sw
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ impl Subtract for BigUint {
if borrow == 0 {
break;
}
let diff: U128 = result.get(idx).unwrap().into() - borrow.into();
let diff: U128 = U128::from(result.get(idx).unwrap()) - U128::from(borrow);
result.set(idx, diff.lower());
borrow = if diff.upper() != 0 { 1 } else { 0 };
}
Expand Down
4 changes: 2 additions & 2 deletions libs/bytecode/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"
4 changes: 2 additions & 2 deletions libs/merkle/Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies = ["std"]

[[package]]
name = "std"
version = "0.69.0"
source = "registry+std?0.69.0#QmSeLFUtVXk8i13owCv87Kga1MfsYgfn7sdj6WimxLwq2g!"
version = "0.70.2"
source = "registry+std?0.70.2#QmWuWwmjn2vVDup2672LpToek8N58PYGJt2eH55M7ZzY2Y!"
2 changes: 1 addition & 1 deletion libs/merkle/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Fuel Labs <contact@fuel.sh>"]
entry = "merkle.sw"
license = "Apache-2.0"
name = "merkle"
version = "0.26.1"
version = "0.26.2"
description = "Merkle trees allow for on-chain verification of off-chain data. With the merkle root posted on-chain, the generation of proofs off-chain can provide verifiably true data."
homepage = "https://docs.fuel.network/docs/sway-libs/merkle/"
repository = "https://github.com/FuelLabs/sway-libs"
Expand Down
8 changes: 6 additions & 2 deletions libs/merkle/src/binary.sw
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library;

use ::common::{LEAF, MerkleRoot, node_digest, ProofError, ProofSet};
use std::{alloc::alloc_bytes, bytes::Bytes, hash::{Hash, sha256}};
use std::alloc::alloc_bytes;

/// This function will compute and return a Merkle root given a leaf and corresponding proof.
///
Expand Down Expand Up @@ -175,7 +175,11 @@ pub fn leaf_digest(data: b256) -> b256 {
ptr.write_byte(LEAF);
__addr_of(data).copy_bytes_to(ptr.add_uint_offset(1), 32);

sha256(Bytes::from(raw_slice::from_parts::<u8>(ptr, 33)))
let result_buffer: b256 = 0x0000000000000000000000000000000000000000000000000000000000000000;
asm(hash: result_buffer, ptr: ptr, bytes: 33) {
s256 hash ptr bytes;
hash: b256
}
}

/// Calculates the starting bit of the path to a leaf
Expand Down
6 changes: 5 additions & 1 deletion libs/merkle/src/common.sw
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@ pub fn node_digest(left: b256, right: b256) -> b256 {
__addr_of(left).copy_bytes_to(ptr.add_uint_offset(1), 32);
__addr_of(right).copy_bytes_to(ptr.add_uint_offset(33), 32);

sha256(Bytes::from(raw_slice::from_parts::<u8>(ptr, 65)))
let result_buffer: b256 = 0x0000000000000000000000000000000000000000000000000000000000000000;
asm(hash: result_buffer, ptr: ptr, bytes: 65) {
s256 hash ptr bytes;
hash: b256
}
}
Loading
Loading