Skip to content

Commit

Permalink
Merge branch 'master' into kayagokalp/deploy-default-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
sdankel committed Aug 1, 2024
2 parents a14e437 + 0245223 commit 1ae122d
Show file tree
Hide file tree
Showing 28 changed files with 700 additions and 375 deletions.
452 changes: 347 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
- [Attributes](./reference/attributes.md)
- [Style Guide](./reference/style_guide.md)
- [Known Issues and Workarounds](./reference/known_issues_and_workarounds.md)
- [Behavior Considered Undefined](./reference/undefined_behavior.md)
- [Differences From Solidity](./reference/solidity_differences.md)
- [Differences From Rust](./reference/rust_differences.md)
- [Contributing To Sway](./reference/contributing_to_sway.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/book/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ You can find example applications built with Sway in the [Sway Applications repo

**Q: What is the standard library?**

The [standard library](./introduction/standard_library.md), also referred to as `std`, is a library that offers core functions and helpers for developing in Sway. The standard library has it's own [reference documentation](https://fuellabs.github.io/sway/master/std/) that has detailed information about each module in `std`.
The [standard library](./introduction/standard_library.md), also referred to as `std`, is a library that offers core functions and helpers for developing in Sway. The standard library has its own [reference documentation](https://fuellabs.github.io/sway/master/std/) that has detailed information about each module in `std`.

**Q: What are Sway standards?**

Similar to ERC standards for Ethereum and Solidity, Sway has it's own SRC standards that help enable cross compatibility across different smart contracts. For more information on using a Sway Standard, you can check out the [Sway-Standards Repository](https://github.com/FuelLabs/sway-standards).
Similar to ERC standards for Ethereum and Solidity, Sway has its own SRC standards that help enable cross compatibility across different smart contracts. For more information on using a Sway Standard, you can check out the [Sway-Standards Repository](https://github.com/FuelLabs/sway-standards).

**Q: How can I make a token?**

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/reference/known_issues_and_workarounds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Missing Features

* [#1182](https://github.com/FuelLabs/sway/issues/1182) Arrays in a `storage` block are not yet supported. See the [Manual Storage Management](../blockchain-development/storage.md#manual-storage-management) section for details on how to use `store` and `get` from the standard library to manage storage slots directly. Note, however, that `StorageMap<K, V>` _does_ support arbitrary types for `K` and `V` without any limitations.
* [#1182](https://github.com/FuelLabs/sway/issues/1182) Arrays in a `storage` block are not yet supported. See the [Manual Storage Management](../advanced/advanced_storage.md#manual-storage-management) section for details on how to use `store` and `get` from the standard library to manage storage slots directly. Note, however, that `StorageMap<K, V>` _does_ support arbitrary types for `K` and `V` without any limitations.

## General

Expand Down
15 changes: 15 additions & 0 deletions docs/book/src/reference/undefined_behavior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Behavior Considered Undefined

Sway code that contains any of the following behavior is considered undefined.
The compiler is allowed to treat undefined Sway code however it desires,
including removing it or replacing it with any other Sway code.

This is not an exhaustive list, it may grow or shrink, there is no formal model
of Sway's semantics so there may be more behavior considered undefined. We
reserve the right to make some of the listed behavior defined in the future.

* Invalid arithmetic operations (overflows, underflows, division by zero, etc)
* Misuse of compiler intrinsics
* Incorrect use of inline assembly
* Reading and writing `raw_ptr` and `raw_slice`
* Slicing and indexing out of bounds by directly using compiler intrinsics.
12 changes: 6 additions & 6 deletions forc-pkg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ repository.workspace = true
ansi_term = "0.12"
anyhow = "1"
byte-unit = "5.1.4"
cid = "0.10"
cid = "0.11"
forc-tracing = { version = "0.62.0", path = "../forc-tracing" }
forc-util = { version = "0.62.0", path = "../forc-util" }
fuel-abi-types = { workspace = true }
futures = "0.3"
git2 = { version = "0.17.2", features = [
git2 = { version = "0.19", features = [
"vendored-libgit2",
"vendored-openssl",
] }
gix-url = { version = "0.16.0", features = ["serde1"] }
gix-url = { version = "0.27", features = ["serde"] }
hex = "0.4.3"
ipfs-api-backend-hyper = { version = "0.6", features = ["with-builder"] }
petgraph = { version = "0.6", features = ["serde-1"] }
reqwest = "0.11.7"
reqwest = "0.12"
semver = { version = "1.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_ignored = "0.1.9"
Expand All @@ -36,7 +36,7 @@ sway-error = { version = "0.62.0", path = "../sway-error" }
sway-types = { version = "0.62.0", path = "../sway-types" }
sway-utils = { version = "0.62.0", path = "../sway-utils" }
tar = "0.4.38"
toml = { version = "0.7", features = ["parse"] }
toml = { version = "0.8", features = ["parse"] }
tracing = "0.1"
url = { version = "2.2", features = ["serde"] }
vec1 = "1.8.0"
Expand All @@ -46,4 +46,4 @@ walkdir = "2"
regex = "^1.10.2"

[target.'cfg(not(target_os = "macos"))'.dependencies]
sysinfo = "0.29.0"
sysinfo = "0.29"
15 changes: 7 additions & 8 deletions forc-pkg/src/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ impl BuildPlan {
///
/// To do so, it tries to read the manifet file at the target path and creates the plan with
/// `BuildPlan::from_lock_and_manifest`.
pub fn from_build_opts(build_options: &BuildOpts) -> Result<Self> {
let path = &build_options.pkg.path;
pub fn from_pkg_opts(pkg_options: &PkgOpts) -> Result<Self> {
let path = &pkg_options.path;

let manifest_dir = if let Some(ref path) = path {
PathBuf::from(path)
Expand All @@ -602,9 +602,9 @@ impl BuildPlan {
Self::from_lock_and_manifests(
&lock_path,
&member_manifests,
build_options.pkg.locked,
build_options.pkg.offline,
&build_options.pkg.ipfs_node,
pkg_options.locked,
pkg_options.offline,
&pkg_options.ipfs_node,
)
}

Expand Down Expand Up @@ -2154,10 +2154,9 @@ pub fn build_with_options(build_options: &BuildOpts) -> Result<Built> {
.as_ref()
.map_or_else(|| current_dir, PathBuf::from);

let building = ansi_term::Colour::Green.bold().paint("Building");
info!(" {} {}", building, path.display());
println_action_green("Building", &path.display().to_string());

let build_plan = BuildPlan::from_build_opts(build_options)?;
let build_plan = BuildPlan::from_pkg_opts(&build_options.pkg)?;
let graph = build_plan.graph();
let manifest_map = build_plan.manifest_map();

Expand Down
6 changes: 3 additions & 3 deletions forc-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::execute::TestExecutor;
use crate::setup::{
ContractDeploymentSetup, ContractTestSetup, DeploymentSetup, ScriptTestSetup, TestSetup,
};
use forc_pkg as pkg;
use forc_pkg::{self as pkg, BuildOpts};
use fuel_abi_types::error_codes::ErrorSignal;
use fuel_tx as tx;
use fuel_vm::checked_transaction::builder::TransactionBuilderExt;
Expand Down Expand Up @@ -601,8 +601,8 @@ impl BuiltTests {

/// First builds the package or workspace, ready for execution.
pub fn build(opts: TestOpts) -> anyhow::Result<BuiltTests> {
let build_opts = opts.into();
let build_plan = pkg::BuildPlan::from_build_opts(&build_opts)?;
let build_opts: BuildOpts = opts.into();
let build_plan = pkg::BuildPlan::from_pkg_opts(&build_opts.pkg)?;
let built = pkg::build_with_options(&build_opts)?;
BuiltTests::from_built(built, &build_plan)
}
Expand Down
4 changes: 2 additions & 2 deletions forc-util/src/fs_locking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl PidFileLocking {
}

/// Checks if the given pid is active
#[cfg(not(target = "windows"))]
#[cfg(not(target_os = "windows"))]
fn is_pid_active(pid: usize) -> bool {
// Not using sysinfo here because it has compatibility issues with fuel.nix
// https://github.com/FuelLabs/fuel.nix/issues/64
Expand All @@ -50,7 +50,7 @@ impl PidFileLocking {
output_str.contains(&format!("{} ", pid))
}

#[cfg(target = "windows")]
#[cfg(target_os = "windows")]
fn is_pid_active(pid: usize) -> bool {
// Not using sysinfo here because it has compatibility issues with fuel.nix
// https://github.com/FuelLabs/fuel.nix/issues/64
Expand Down
2 changes: 1 addition & 1 deletion forc/src/ops/forc_contract_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tracing::info;

pub fn contract_id(command: ContractIdCommand) -> Result<()> {
let build_options = build_opts_from_cmd(&command);
let build_plan = pkg::BuildPlan::from_build_opts(&build_options)?;
let build_plan = pkg::BuildPlan::from_pkg_opts(&build_options.pkg)?;
// If a salt was specified but we have more than one member to build, there
// may be ambiguity in how the salt should be applied, especially if the
// workspace contains multiple contracts, and especially if one contract
Expand Down
1 change: 0 additions & 1 deletion sway-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ proc-macro2 = "1.0.5"
quote = "1.0.9"
rayon = "1.5.0"
rayon-cond = "0.3"
ropey = "1.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.60"
sway-ast = { version = "0.62.0", path = "../sway-ast" }
Expand Down
Loading

0 comments on commit 1ae122d

Please sign in to comment.