Skip to content

Commit

Permalink
Update to new linter toolchain and 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Dec 5, 2024
1 parent 7d083b2 commit 40df82e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 54 deletions.
24 changes: 1 addition & 23 deletions docs/basics/contract-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,7 @@ edition = "2021"
# `ink::env` is the `ink_env` crate that contains functions
# to interact with a contract's environment (querying information
# about a caller, the current block number, etc.).
ink = { version = "4.0.0-beta", default-features = false }

# Substrate blockchains use the SCALE codec for anything to
# do with data encoding/decoding. If an ink! contract is called
# the passed values have to be SCALE-encoded and return values
# have to be SCALE-decoded. All values that are put into a
# contract's storage are SCALE-encoded as well.
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }

# This crate is used to write information about a contract's
# types into the contract's metadata (i.e. its ABI). This is
# needed so that a client knows that a contract message requires
# e.g. an Array and that it has to SCALE-encode the value as an Array.
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
ink = { version = "5", default-features = false }

[dev-dependencies]
# This developer dependency is for the End-to-End testing framework.
Expand All @@ -87,19 +74,10 @@ ink_e2e = { path = "../../crates/e2e" }
name = "foobar"
path = "lib.rs"

# This setting typically specifies that you'd like the compiler to
# create a dynamic system library. For WebAssembly though it specifies
# that the compiler should create a `*.wasm` without a start function.
crate-type = [
"cdylib",
]

[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
]
ink-as-dependency = []

Expand Down
4 changes: 2 additions & 2 deletions docs/basics/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ It may _optionally_ include the following keys:
```json
"source": {
"hash": "0x157014494527fee27a82e49bbd9eea10c0713bb0566f6def37f4595db86236ff",
"language": "ink! 4.0.0",
"language": "ink! 5.1.0",
"compiler": "rustc 1.66.0"
}
```
Expand Down Expand Up @@ -109,7 +109,7 @@ It can _optionally_ include the following keys:
```json
"contract": {
"name": "flipper",
"version": "4.0.0-beta.1",
"version": "5.0.0",
"authors": [
"Use Ink <[email protected]>"
]
Expand Down
4 changes: 2 additions & 2 deletions docs/linter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ description: An overview of ink! linter
ink! includes the linter - a security tool designed to identify typical security issues in smart contracts. The linter is meant to seamlessly fit into the smart contracts development process, ensuring that contracts are thoroughly checked during the build phase before they are deployed to the blockchain.

## Installation
The linter is integrated to the contracts build process, therefore you should already have it installed if you are using [`cargo-contract`](https://github.com/use-ink/cargo-contract) of version `4.0.0` or later.
The linter is integrated to the contracts build process, therefore you should already have it installed if you are using [`cargo-contract`](https://github.com/use-ink/cargo-contract) of version `5.0.0` or later.

The linter requires two crates and a fixed Rust toolchain version. You can use
these commands to install the required dependencies:

```
export TOOLCHAIN_VERSION=nightly-2024-02-08
export TOOLCHAIN_VERSION=nightly-2024-09-05
rustup install $TOOLCHAIN_VERSION
rustup component add rust-src --toolchain $TOOLCHAIN_VERSION
rustup run $TOOLCHAIN_VERSION cargo install cargo-dylint dylint-link
Expand Down
24 changes: 1 addition & 23 deletions versioned_docs/version-6.x/basics/contract-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,7 @@ edition = "2021"
# `ink::env` is the `ink_env` crate that contains functions
# to interact with a contract's environment (querying information
# about a caller, the current block number, etc.).
ink = { version = "4.0.0-beta", default-features = false }

# Substrate blockchains use the SCALE codec for anything to
# do with data encoding/decoding. If an ink! contract is called
# the passed values have to be SCALE-encoded and return values
# have to be SCALE-decoded. All values that are put into a
# contract's storage are SCALE-encoded as well.
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }

# This crate is used to write information about a contract's
# types into the contract's metadata (i.e. its ABI). This is
# needed so that a client knows that a contract message requires
# e.g. an Array and that it has to SCALE-encode the value as an Array.
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
ink = { version = "5", default-features = false }

[dev-dependencies]
# This developer dependency is for the End-to-End testing framework.
Expand All @@ -87,19 +74,10 @@ ink_e2e = { path = "../../crates/e2e" }
name = "foobar"
path = "lib.rs"

# This setting typically specifies that you'd like the compiler to
# create a dynamic system library. For WebAssembly though it specifies
# that the compiler should create a `*.wasm` without a start function.
crate-type = [
"cdylib",
]

[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
]
ink-as-dependency = []

Expand Down
4 changes: 2 additions & 2 deletions versioned_docs/version-6.x/basics/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ It may _optionally_ include the following keys:
```json
"source": {
"hash": "0x157014494527fee27a82e49bbd9eea10c0713bb0566f6def37f4595db86236ff",
"language": "ink! 4.0.0",
"language": "ink! 5.1.0",
"compiler": "rustc 1.66.0"
}
```
Expand Down Expand Up @@ -109,7 +109,7 @@ It can _optionally_ include the following keys:
```json
"contract": {
"name": "flipper",
"version": "4.0.0-beta.1",
"version": "5.0.0",
"authors": [
"Use Ink <[email protected]>"
]
Expand Down
4 changes: 2 additions & 2 deletions versioned_docs/version-6.x/linter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ description: An overview of ink! linter
ink! includes the linter - a security tool designed to identify typical security issues in smart contracts. The linter is meant to seamlessly fit into the smart contracts development process, ensuring that contracts are thoroughly checked during the build phase before they are deployed to the blockchain.

## Installation
The linter is integrated to the contracts build process, therefore you should already have it installed if you are using [`cargo-contract`](https://github.com/use-ink/cargo-contract) of version `4.0.0` or later.
The linter is integrated to the contracts build process, therefore you should already have it installed if you are using [`cargo-contract`](https://github.com/use-ink/cargo-contract) of version `5.0.0` or later.

The linter requires two crates and a fixed Rust toolchain version. You can use
these commands to install the required dependencies:

```
export TOOLCHAIN_VERSION=nightly-2024-02-08
export TOOLCHAIN_VERSION=nightly-2024-09-05
rustup install $TOOLCHAIN_VERSION
rustup component add rust-src --toolchain $TOOLCHAIN_VERSION
rustup run $TOOLCHAIN_VERSION cargo install cargo-dylint dylint-link
Expand Down

0 comments on commit 40df82e

Please sign in to comment.