Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to forc v0.60.0 #250

Merged
merged 9 commits into from
May 31, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
RUST_VERSION: 1.77.0
FORC_VERSION: 0.56.0
CORE_VERSION: 0.24.2
FORC_VERSION: 0.60.0
CORE_VERSION: 0.26.0

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

env:
RUST_VERSION: 1.77.0
FORC_VERSION: 0.56.0
CORE_VERSION: 0.24.2
FORC_VERSION: 0.60.0
CORE_VERSION: 0.26.0

jobs:
deploy-contributing:
Expand Down
6 changes: 3 additions & 3 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.49.1" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.49.1-orange" />
<a href="https://crates.io/crates/forc/0.60.0" alt="forc">
<img src="https://img.shields.io/badge/forc-v0.60.0-orange" />
</a>
<a href="./LICENSE" alt="forc">
<img src="https://img.shields.io/github/license/FuelLabs/sway-libs" />
Expand Down Expand Up @@ -115,7 +115,7 @@ forc test && cargo test
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.53.0`, `fuels-rs v0.53.0` and `fuel-core 0.23.0`.
> All projects currently use `forc v0.60.0`, `fuels-rs v0.62.0` and `fuel-core 0.26.0`.

## 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 @@ -38,7 +38,7 @@ use sway_libs::ownership::only_owner;
```

> **NOTE:**
> All projects currently use `forc v0.50.0`, `fuels-rs v0.53.0` and `fuel-core 0.22.0`.
> All projects currently use `forc v0.60.0`, `fuels-rs v0.62.0` and `fuel-core 0.26.0`.

## Using Sway Libs

Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Apache-2.0"
[dependencies]
fuel-merkle = { version = "0.49.0" }
sha2 = { version = "0.10" }
fuels = { version = "0.58.0", features = ["fuel-core-lib"] }
fuels = { version = "0.62.0", features = ["fuel-core-lib"] }
tokio = { version = "1.12", features = ["rt", "macros"] }

[[test]]
Expand Down
2 changes: 1 addition & 1 deletion examples/admin/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "admin_examples"

[dependencies]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../../libs" }
2 changes: 1 addition & 1 deletion examples/merkle/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ANCHOR: import
use fuel_merkle::{binary::in_memory::MerkleTree, common::Bytes32};
use fuel_merkle::binary::in_memory::MerkleTree;
// ANCHOR_END: import
use fuels::{prelude::*, types::Bits256};
use sha2::{Digest, Sha256};
Expand Down
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]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { path = "../../libs" }
2 changes: 1 addition & 1 deletion libs/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ license = "Apache-2.0"
name = "sway_libs"

[dependencies]
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.4.3" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
4 changes: 2 additions & 2 deletions libs/src/asset/metadata.sw
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ impl Metadata {
/// # Examples
///
/// ```sway
/// use std::{constants::ZERO_B256, string::String};
/// use std::string::String;
/// use sway_libs::asset::metadata::*;
/// use standards::src7::{SRC7, Metadata};
///
Expand All @@ -358,7 +358,7 @@ impl Metadata {
/// let metadata = metadata_abi.metadata(asset, key);
///
/// let val = metadata.unwrap().as_b256();
/// assert(val != ZERO_B256);
/// assert(val != b256::zero());
/// }
/// ```
pub fn as_b256(self) -> Option<b256> {
Expand Down
10 changes: 5 additions & 5 deletions libs/src/asset/supply.sw
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ use std::{
///
/// ```sway
/// use sway_libs::asset::supply::_mint;
/// use std::{constants::ZERO_B256, context::balance_of};
/// use std::context::balance_of;
///
/// storage {
/// total_assets: u64 = 0,
/// total_supply: StorageMap<AssetId, u64> = StorageMap {},
/// }
///
/// fn foo(recipient: Identity) {
/// let recipient = Identity::ContractId(ContractId::from(ZERO_B256));
/// let asset_id = _mint(storage.total_assets, storage.total_supply, recipient, ZERO_B256, 100);
/// let recipient = Identity::ContractId(ContractId::zero());
/// let asset_id = _mint(storage.total_assets, storage.total_supply, recipient, SubId::zero(), 100);
/// assert(balance_of(recipient.as_contract_id(), asset_id), 100);
/// }
/// ```
Expand Down Expand Up @@ -106,15 +106,15 @@ pub fn _mint(
///
/// ```sway
/// use sway_libs::asset::supply::_burn;
/// use std::{call_frames::contract_id, constants::ZERO_B256, context::balance_of};
/// use std::{call_frames::contract_id, context::balance_of};
///
/// storage {
/// total_supply: StorageMap<AssetId, u64> = StorageMap {},
/// }
///
/// fn foo(asset_id: AssetId) {
/// assert(balance_of(contract_id(), asset_id) == 100);
/// _burn(storage.total_supply, ZERO_B256, 100);
/// _burn(storage.total_supply, SubId::zero(), 100);
/// assert(balance_of(contract_id(), asset_id) == 0);
/// }
/// ```
Expand Down
15 changes: 5 additions & 10 deletions libs/src/bytecode.sw
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ use ::bytecode::utils::{_compute_bytecode_root, _predicate_address_from_root, _s
/// # Examples
///
/// ```sway
/// use std::constants::ZERO_B256;
/// use sway_libs::bytecode::compute_bytecode_root;
///
/// fn foo(my_bytecode: Vec<u8>) {
/// let bytecode_root = compute_bytecode_root(my_bytecode);
/// assert(bytecode_root != ZERO_B256);
/// assert(bytecode_root != b256::zero());
/// }
/// ```
pub fn compute_bytecode_root(bytecode: Vec<u8>) -> b256 {
Expand All @@ -45,13 +44,12 @@ pub fn compute_bytecode_root(bytecode: Vec<u8>) -> b256 {
/// # Examples
///
/// ```sway
/// use std::constants::ZERO_B256;
/// use sway_libs::bytecode::compute_bytecode_root_with_configurables;
///
/// fn foo(my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
/// let mut my_bytecode = my_bytecode;
/// let bytecode_root = compute_bytecode_root_with_configurables(my_bytecode, my_configurables);
/// assert(bytecode_root != ZERO_B256);
/// assert(bytecode_root != b256::zero());
/// }
/// ```
pub fn compute_bytecode_root_with_configurables(
Expand All @@ -76,12 +74,11 @@ pub fn compute_bytecode_root_with_configurables(
/// # Examples
///
/// ```sway
/// use std::constants::ZERO_B256;
/// use sway_libs::bytecode::compute_predicate_address;
///
/// fn foo(my_bytecode: Vec<u8>) {
/// let predicate_address = compute_predicate_address(my_bytecode);
/// assert(predicate_address != Address::from(ZERO_B256));
/// assert(predicate_address != Address::zero());
/// }
/// ```
pub fn compute_predicate_address(bytecode: Vec<u8>) -> Address {
Expand All @@ -103,13 +100,12 @@ pub fn compute_predicate_address(bytecode: Vec<u8>) -> Address {
/// # Examples
///
/// ```sway
/// use std::constants::ZERO_B256;
/// use sway_libs::bytecode::compute_predicate_address;
///
/// fn foo(my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
/// let mut my_bytecode = my_bytecode;
/// let predicate_address = compute_predicate_address(my_bytecode, my_configurables);
/// assert(predicate_address != Address::from(ZERO_B256));
/// assert(predicate_address != Address::zero());
/// }
/// ```
pub fn compute_predicate_address_with_configurables(
Expand All @@ -135,12 +131,11 @@ pub fn compute_predicate_address_with_configurables(
/// # Examples
///
/// ```sway
/// use std::constants::ZERO_B256;
/// use sway_libs::bytecode::predicate_address_from_root;
///
/// fn foo(predicate_bytecode_root: b256) {
/// let predicate_address = predicate_address_from_root(predicate_bytecode_root);
/// assert(predicate_address != Address::from(ZERO_B256));
/// assert(predicate_address != Address::zero());
/// }
/// ```
pub fn predicate_address_from_root(bytecode_root: b256) -> Address {
Expand Down
Loading
Loading