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

Deprecated arithmetic issues detectors / example #291

Open
kevin-valerio opened this issue Nov 25, 2024 · 0 comments
Open

Deprecated arithmetic issues detectors / example #291

kevin-valerio opened this issue Nov 25, 2024 · 0 comments

Comments

@kevin-valerio
Copy link

Hello all,

Since ink! v5, arithmetic issues aren't possible anymore, since cargo-contract automatically check for such bugs before compiling. Thus, those tests won't compile anymore, and are deprecated.

Example:

~/scout/test-cases/integer-overflow-or-underflow/integer-overflow-or-underflow-2/vulnerable-example (default-do-not-use-scout-reserved)
❯ cargo contract build
error: arithmetic operation that can potentially result in unexpected side-effects
  --> integer-overflow-or-underflow-2/vulnerable-example/src/lib.rs:22:13
   |
22 |             self.value *= value;
   |             ^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
   = note: requested on the command line with `-D clippy::arithmetic-side-effects`

❯ cargo contract --version
cargo-contract-contract 5.0.0-alpha-b183e9e-aarch64-apple-darwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant