Skip to content

Commit

Permalink
Release v5.0.3 (#1911)
Browse files Browse the repository at this point in the history
* Deny overflowing (and lossy) integer type cast operations (#1895)

* Deny overflowing (and lossy) integer type cast operations

* Update docs

* Update changelog

* Add some tests for compatibility

* Bump `cargo-contract` version to `5.0.3`

* Apply `cargo fmt`

---------

Co-authored-by: David Semakula <davidsemakula@users.noreply.github.com>
  • Loading branch information
cmichi and davidsemakula authored Jan 24, 2025
1 parent 10cb226 commit 81420a5
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 27 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[Unreleased]

## [5.0.3]

### Added
- Deny overflowing (and lossy) integer type cast operations - [#1895](https://github.com/use-ink/cargo-contract/pull/1895)

### Changed
- Use ink! release version in new contract template - [1896](https://github.com/use-ink/cargo-contract/pull/1896)
- Use latest ink! release version in new contract template - [#1896](https://github.com/use-ink/cargo-contract/pull/1896)

## [5.0.2]

Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/analyze/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-analyze"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
edition = "2021"

Expand All @@ -14,7 +14,7 @@ keywords = ["wasm", "ink", "webassembly", "blockchain", "edsl"]
include = ["Cargo.toml", "*.rs", "LICENSE"]

[dependencies]
contract-metadata = { version = "5.0.2", path = "../metadata" }
contract-metadata = { version = "5.0.3", path = "../metadata" }
wasmparser = "0.220.0"
anyhow = "1.0.94"

Expand Down
4 changes: 2 additions & 2 deletions crates/build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-build"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
edition = "2021"

Expand Down Expand Up @@ -47,7 +47,7 @@ tokio-stream = "0.1"
bollard = "0.18"
crossterm = "0.28.1"

contract-metadata = { version = "5.0.2", path = "../metadata" }
contract-metadata = { version = "5.0.3", path = "../metadata" }

[target.'cfg(unix)'.dependencies]
uzers = "0.12"
Expand Down
9 changes: 7 additions & 2 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,14 @@ fn exec_cargo_clippy(crate_metadata: &CrateMetadata, verbosity: Verbosity) -> Re
"--all-features",
// customize clippy lints after the "--"
"--",
// this is a hard error because we want to guarantee that implicit overflows
// never happen
// these are hard errors because we want to guarantee that implicit overflows
// and lossy integer conversions never happen
// See https://github.com/use-ink/cargo-contract/pull/1190
"-Dclippy::arithmetic_side_effects",
// See https://github.com/use-ink/cargo-contract/pull/1895
"-Dclippy::cast_possible_truncation",
"-Dclippy::cast_possible_wrap",
"-Dclippy::cast_sign_loss",
];
// we execute clippy with the plain manifest no temp dir required
execute_cargo(util::cargo_cmd(
Expand Down
12 changes: 6 additions & 6 deletions crates/cargo-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-contract"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
build = "build.rs"
edition = "2021"
Expand All @@ -18,11 +18,11 @@ include = [
]

[dependencies]
contract-build = { version = "5.0.2", path = "../build" }
contract-extrinsics = { version = "5.0.2", path = "../extrinsics" }
contract-transcode = { version = "5.0.2", path = "../transcode" }
contract-metadata = { version = "5.0.2", path = "../metadata" }
contract-analyze = { version = "5.0.2", path = "../analyze" }
contract-build = { version = "5.0.3", path = "../build" }
contract-extrinsics = { version = "5.0.3", path = "../extrinsics" }
contract-transcode = { version = "5.0.3", path = "../transcode" }
contract-metadata = { version = "5.0.3", path = "../metadata" }
contract-analyze = { version = "5.0.3", path = "../analyze" }

anyhow = "1.0.94"
clap = { version = "4.5.22", features = ["derive", "env"] }
Expand Down
8 changes: 4 additions & 4 deletions crates/extrinsics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-extrinsics"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
edition = "2021"
rust-version = "1.70"
Expand All @@ -15,9 +15,9 @@ keywords = ["wasm", "ink", "webassembly", "blockchain", "edsl"]
include = ["Cargo.toml", "*.rs", "LICENSE",]

[dependencies]
contract-build = { version = "5.0.2", path = "../build" }
contract-metadata = { version = "5.0.2", path = "../metadata" }
contract-transcode = { version = "5.0.2", path = "../transcode" }
contract-build = { version = "5.0.3", path = "../build" }
contract-metadata = { version = "5.0.3", path = "../metadata" }
contract-transcode = { version = "5.0.3", path = "../transcode" }

anyhow = "1.0.94"
blake2 = { version = "0.10.6", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-metadata"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion crates/metadata/compatibility_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"5.0.2"
]
},
"5.0.2": {
"5.0.3": {
"ink": [
">=5.0.0-rc.2",
"5.0.2"
Expand Down
24 changes: 24 additions & 0 deletions crates/metadata/src/compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,28 @@ mod tests {
let res = check_contract_ink_compatibility(&ink_version, None);
assert!(res.is_ok());
}

#[test]
fn check_current_ink_and_cargo_contract_versions() {
// Current `cargo-contract` version is 5.0.3
let cargo_contract_version = Some(Version::new(5, 0, 3));

let ink_version = Version::new(5, 1, 1);
let res = check_contract_ink_compatibility(
&ink_version,
cargo_contract_version.clone(),
);
assert!(res.is_ok());

let ink_version = Version::new(5, 0, 0);
let res = check_contract_ink_compatibility(
&ink_version,
cargo_contract_version.clone(),
);
assert!(res.is_ok());

let ink_version = Version::new(5, 1, 0);
let res = check_contract_ink_compatibility(&ink_version, cargo_contract_version);
assert!(res.is_ok());
}
}
4 changes: 2 additions & 2 deletions crates/transcode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-transcode"
version = "5.0.2"
version = "5.0.3"
authors = ["Use Ink <ink@use.ink>"]
edition = "2021"

Expand All @@ -20,7 +20,7 @@ path = "src/lib.rs"
anyhow = "1.0.94"
base58 = { version = "0.2.0" }
blake2 = { version = "0.10.6", default-features = false }
contract-metadata = { version = "5.0.2", path = "../metadata" }
contract-metadata = { version = "5.0.3", path = "../metadata" }
escape8259 = "0.5.2"
hex = "0.4.3"
indexmap = "2.2.6"
Expand Down

0 comments on commit 81420a5

Please sign in to comment.