diff --git a/crates/lint/src/sol/med/mod.rs b/crates/lint/src/sol/med/mod.rs index 35e55f594fa8f..5034e849ce601 100644 --- a/crates/lint/src/sol/med/mod.rs +++ b/crates/lint/src/sol/med/mod.rs @@ -3,4 +3,10 @@ use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod div_mul; use div_mul::DIVIDE_BEFORE_MULTIPLY; -register_lints!((DivideBeforeMultiply, early, (DIVIDE_BEFORE_MULTIPLY))); +mod unsafe_typecast; +use unsafe_typecast::UNSAFE_TYPECAST; + +register_lints!( + (DivideBeforeMultiply, early, (DIVIDE_BEFORE_MULTIPLY)), + (UnsafeTypecast, late, (UNSAFE_TYPECAST)) +); diff --git a/crates/lint/src/sol/med/unsafe_typecast.rs b/crates/lint/src/sol/med/unsafe_typecast.rs new file mode 100644 index 0000000000000..d0142b2b72ee7 --- /dev/null +++ b/crates/lint/src/sol/med/unsafe_typecast.rs @@ -0,0 +1,180 @@ +use super::UnsafeTypecast; +use crate::{ + linter::{LateLintPass, LintContext, Snippet}, + sol::{Severity, SolLint}, +}; +use solar_ast::{LitKind, StrKind}; +use solar_sema::hir::{self, ElementaryType, ExprKind, ItemId, Res, TypeKind}; + +declare_forge_lint!( + UNSAFE_TYPECAST, + Severity::Med, + "unsafe-typecast", + "typecasts that can truncate values should be checked" +); + +impl<'hir> LateLintPass<'hir> for UnsafeTypecast { + fn check_expr( + &mut self, + ctx: &LintContext<'_>, + hir: &'hir hir::Hir<'hir>, + expr: &'hir hir::Expr<'hir>, + ) { + // Check for type cast expressions: Type(value) + if let ExprKind::Call(call, args, _) = &expr.kind + && let ExprKind::Type(hir::Type { kind: TypeKind::Elementary(ty), .. }) = &call.kind + && args.len() == 1 + && let Some(call_arg) = args.exprs().next() + && is_unsafe_typecast_hir(hir, call_arg, ty) + { + ctx.emit_with_fix( + &UNSAFE_TYPECAST, + expr.span, + Snippet::Block { + desc: Some("Consider disabling this lint if you're certain the cast is safe:"), + code: format!( + "// casting to '{abi_ty}' is safe because [explain why]\n// forge-lint: disable-next-line(unsafe-typecast)", + abi_ty = ty.to_abi_str() + ) + } + ); + } + } +} + +/// Determines if a typecast is potentially unsafe (could lose data or precision). +fn is_unsafe_typecast_hir( + hir: &hir::Hir<'_>, + source_expr: &hir::Expr<'_>, + target_type: &hir::ElementaryType, +) -> bool { + let mut source_types = Vec::::new(); + infer_source_types(Some(&mut source_types), hir, source_expr); + + if source_types.is_empty() { + return false; + }; + + for source_ty in source_types { + if is_unsafe_elementary_typecast(&source_ty, target_type) { + return true; + } + } + + false +} + +/// Infers the elementary source type(s) of an expression. +/// +/// This function traverses an expression tree to find the original "source" types. +/// For cast chains, it returns the ultimate source type, not intermediate cast results. +/// For binary operations, it collects types from both sides into the `output` vector. +/// +/// # Returns +/// An `Option` containing the inferred type of the expression if it can be +/// resolved to a single source (like variables, literals, or unary expressions). +/// Returns `None` for expressions complex expressions (like binary operations). +fn infer_source_types( + mut output: Option<&mut Vec>, + hir: &hir::Hir<'_>, + expr: &hir::Expr<'_>, +) -> Option { + let mut track = |ty: ElementaryType| -> Option { + if let Some(output) = output.as_mut() { + output.push(ty); + } + Some(ty) + }; + + match &expr.kind { + // A type cast call: `Type(val)` + ExprKind::Call(call_expr, args, ..) => { + // Check if the called expression is a type, which indicates a cast. + if let ExprKind::Type(hir::Type { kind: TypeKind::Elementary(..), .. }) = + &call_expr.kind + && let Some(inner) = args.exprs().next() + { + // Recurse to find the original (inner-most) source type. + return infer_source_types(output, hir, inner); + } + None + } + + // Identifiers (variables) + ExprKind::Ident(resolutions) => { + if let Some(Res::Item(ItemId::Variable(var_id))) = resolutions.first() { + let variable = hir.variable(*var_id); + if let TypeKind::Elementary(elem_type) = &variable.ty.kind { + return track(*elem_type); + } + } + None + } + + // Handle literal values + ExprKind::Lit(hir::Lit { kind, .. }) => match kind { + LitKind::Str(StrKind::Hex, ..) => track(ElementaryType::Bytes), + LitKind::Str(..) => track(ElementaryType::String), + LitKind::Address(_) => track(ElementaryType::Address(false)), + LitKind::Bool(_) => track(ElementaryType::Bool), + // Unnecessary to check numbers as assigning literal values that cannot fit into a type + // throws a compiler error. Reference: + _ => None, + }, + + // Unary operations: Recurse to find the source type of the inner expression. + ExprKind::Unary(_, inner_expr) => infer_source_types(output, hir, inner_expr), + + // Binary operations + ExprKind::Binary(lhs, _, rhs) => { + if let Some(mut output) = output { + // Recurse on both sides to find and collect all source types. + infer_source_types(Some(&mut output), hir, lhs); + infer_source_types(Some(&mut output), hir, rhs); + } + None + } + + // Complex expressions are not evaluated + _ => None, + } +} + +/// Checks if a type cast from source_type to target_type is unsafe. +fn is_unsafe_elementary_typecast( + source_type: &ElementaryType, + target_type: &ElementaryType, +) -> bool { + match (source_type, target_type) { + // Numeric downcasts (smaller target size) + (ElementaryType::UInt(source_size), ElementaryType::UInt(target_size)) + | (ElementaryType::Int(source_size), ElementaryType::Int(target_size)) => { + source_size.bits() > target_size.bits() + } + + // Signed to unsigned conversion (potential loss of sign) + (ElementaryType::Int(_), ElementaryType::UInt(_)) => true, + + // Unsigned to signed conversion with same or smaller size + (ElementaryType::UInt(source_size), ElementaryType::Int(target_size)) => { + source_size.bits() >= target_size.bits() + } + + // Fixed bytes to smaller fixed bytes + (ElementaryType::FixedBytes(source_size), ElementaryType::FixedBytes(target_size)) => { + source_size.bytes() > target_size.bytes() + } + + // Dynamic bytes to fixed bytes (potential truncation) + (ElementaryType::Bytes, ElementaryType::FixedBytes(_)) + | (ElementaryType::String, ElementaryType::FixedBytes(_)) => true, + + // Address to smaller uint (truncation) - address is 160 bits + (ElementaryType::Address(_), ElementaryType::UInt(target_size)) => target_size.bits() < 160, + + // Address to int (sign issues) + (ElementaryType::Address(_), ElementaryType::Int(_)) => true, + + _ => false, + } +} diff --git a/crates/lint/testdata/UnsafeTypecast.sol b/crates/lint/testdata/UnsafeTypecast.sol new file mode 100644 index 0000000000000..52e90aed4b283 --- /dev/null +++ b/crates/lint/testdata/UnsafeTypecast.sol @@ -0,0 +1,455 @@ +/// forge-lint: disable-start(mixed-case-variable) +contract UnsafeTypecast { + // Unsigned upcasts are always safe. + function upcastSafeUint() public pure { + uint8 a = type(uint8).max; + uint16 b = uint16(a); + uint24 c = uint24(b); + uint32 d = uint32(c); + uint40 e = uint40(d); + uint48 f = uint48(e); + uint56 g = uint56(f); + uint64 h = uint64(g); + uint72 i = uint72(h); + uint80 j = uint80(i); + uint88 k = uint88(j); + uint96 l = uint96(k); + uint104 m = uint104(l); + uint112 n = uint112(m); + uint120 o = uint120(n); + uint128 p = uint128(o); + uint136 q = uint136(p); + uint144 r = uint144(q); + uint152 s = uint152(r); + uint160 t = uint160(s); + uint168 u = uint168(t); + uint176 v = uint176(u); + uint184 w = uint184(v); + uint192 x = uint192(w); + uint200 y = uint200(x); + uint208 z = uint208(y); + uint216 A = uint216(z); + uint224 B = uint224(A); + uint232 C = uint232(B); + uint240 D = uint240(C); + uint248 E = uint248(D); + uint256 F = uint256(E); + } + + // Signed upcasts are safe. + function upcastSafeInt() public pure { + int8 a = type(int8).max; + int16 b = int16(a); + int24 c = int24(b); + int32 d = int32(c); + int40 e = int40(d); + int48 f = int48(e); + int56 g = int56(f); + int64 h = int64(g); + int72 i = int72(h); + int80 j = int80(i); + int88 k = int88(j); + int96 l = int96(k); + int104 m = int104(l); + int112 n = int112(m); + int120 o = int120(n); + int128 p = int128(o); + int136 q = int136(p); + int144 r = int144(q); + int152 s = int152(r); + int160 t = int160(s); + int168 u = int168(t); + int176 v = int176(u); + int184 w = int184(v); + int192 x = int192(w); + int200 y = int200(x); + int208 z = int208(y); + int216 A = int216(z); + int224 B = int224(A); + int232 C = int232(B); + int240 D = int240(C); + int248 E = int248(D); + int256 F = int256(E); + } + + function upcastSafeBytes() public pure { + bytes1 a = 0xFF; + bytes2 b = bytes2(a); + bytes3 c = bytes3(b); + bytes4 d = bytes4(c); + bytes5 e = bytes5(d); + bytes6 f = bytes6(e); + bytes7 g = bytes7(f); + bytes8 h = bytes8(g); + bytes9 i = bytes9(h); + bytes10 j = bytes10(i); + bytes11 k = bytes11(j); + bytes12 l = bytes12(k); + bytes13 m = bytes13(l); + bytes14 n = bytes14(m); + bytes15 o = bytes15(n); + bytes16 p = bytes16(o); + bytes17 q = bytes17(p); + bytes18 r = bytes18(q); + bytes19 s = bytes19(r); + bytes20 t = bytes20(s); + bytes21 u = bytes21(t); + bytes22 v = bytes22(u); + bytes23 w = bytes23(v); + bytes24 x = bytes24(w); + bytes25 y = bytes25(x); + bytes26 z = bytes26(y); + bytes27 A = bytes27(z); + bytes28 B = bytes28(A); + bytes29 C = bytes29(B); + bytes30 D = bytes30(C); + bytes31 E = bytes31(D); + bytes32 F = bytes32(E); + } + + function safeSizeUint() public pure { + uint256(type(uint256).max); + uint248(type(uint248).max); + uint240(type(uint240).max); + uint232(type(uint232).max); + uint224(type(uint224).max); + uint216(type(uint216).max); + uint208(type(uint208).max); + uint200(type(uint200).max); + uint192(type(uint192).max); + uint184(type(uint184).max); + uint176(type(uint176).max); + uint168(type(uint168).max); + uint160(type(uint160).max); + uint152(type(uint152).max); + uint144(type(uint144).max); + uint136(type(uint136).max); + uint128(type(uint128).max); + uint120(type(uint120).max); + uint112(type(uint112).max); + uint104(type(uint104).max); + uint96(type(uint96).max); + uint88(type(uint88).max); + uint80(type(uint80).max); + uint72(type(uint72).max); + uint64(type(uint64).max); + uint56(type(uint56).max); + uint48(type(uint48).max); + uint40(type(uint40).max); + uint32(type(uint32).max); + uint24(type(uint24).max); + uint16(type(uint16).max); + uint8(type(uint8).max); + } + + function safeSizeInt() public pure { + int256(type(int256).max); + int248(type(int248).max); + int240(type(int240).max); + int232(type(int232).max); + int224(type(int224).max); + int216(type(int216).max); + int208(type(int208).max); + int200(type(int200).max); + int192(type(int192).max); + int184(type(int184).max); + int176(type(int176).max); + int168(type(int168).max); + int160(type(int160).max); + int152(type(int152).max); + int144(type(int144).max); + int136(type(int136).max); + int128(type(int128).max); + int120(type(int120).max); + int112(type(int112).max); + int104(type(int104).max); + int96(type(int96).max); + int88(type(int88).max); + int80(type(int80).max); + int72(type(int72).max); + int64(type(int64).max); + int56(type(int56).max); + int48(type(int48).max); + int40(type(int40).max); + int32(type(int32).max); + int24(type(int24).max); + int16(type(int16).max); + int8(type(int8).max); + } + + function sameSizeAddressSafe() public pure { + address a = 0x1234567890123456789012345678901234567890; + uint160 b = uint160(a); + bytes20 c = bytes20(a); + address d = address(a); + // The following tests, `downcastUnsafeUint` and `downcastUnsafeBytes`, verify that other downcasts + // would also throw. Additionally, the compiler prevents direct casting of addresses to smaller types. + } + + function downcastUnsafeUint() public pure { + uint256 a = type(uint256).max; + uint248 b = uint248(a); //~WARN: typecasts that can truncate values should be checked + uint240 c = uint240(b); //~WARN: typecasts that can truncate values should be checked + uint232 d = uint232(c); //~WARN: typecasts that can truncate values should be checked + uint224 e = uint224(d); //~WARN: typecasts that can truncate values should be checked + uint216 f = uint216(e); //~WARN: typecasts that can truncate values should be checked + uint208 g = uint208(f); //~WARN: typecasts that can truncate values should be checked + uint200 h = uint200(g); //~WARN: typecasts that can truncate values should be checked + uint192 i = uint192(h); //~WARN: typecasts that can truncate values should be checked + uint184 j = uint184(i); //~WARN: typecasts that can truncate values should be checked + uint176 k = uint176(j); //~WARN: typecasts that can truncate values should be checked + uint168 l = uint168(k); //~WARN: typecasts that can truncate values should be checked + uint160 m = uint160(l); //~WARN: typecasts that can truncate values should be checked + uint152 n = uint152(m); //~WARN: typecasts that can truncate values should be checked + uint144 o = uint144(n); //~WARN: typecasts that can truncate values should be checked + uint136 p = uint136(o); //~WARN: typecasts that can truncate values should be checked + uint128 q = uint128(p); //~WARN: typecasts that can truncate values should be checked + uint120 r = uint120(q); //~WARN: typecasts that can truncate values should be checked + uint112 s = uint112(r); //~WARN: typecasts that can truncate values should be checked + uint104 t = uint104(s); //~WARN: typecasts that can truncate values should be checked + uint96 u = uint96(t); //~WARN: typecasts that can truncate values should be checked + uint88 v = uint88(u); //~WARN: typecasts that can truncate values should be checked + uint80 w = uint80(v); //~WARN: typecasts that can truncate values should be checked + uint72 x = uint72(w); //~WARN: typecasts that can truncate values should be checked + uint64 y = uint64(x); //~WARN: typecasts that can truncate values should be checked + uint56 z = uint56(y); //~WARN: typecasts that can truncate values should be checked + uint48 A = uint48(z); //~WARN: typecasts that can truncate values should be checked + uint40 B = uint40(A); //~WARN: typecasts that can truncate values should be checked + uint32 C = uint32(B); //~WARN: typecasts that can truncate values should be checked + uint24 D = uint24(C); //~WARN: typecasts that can truncate values should be checked + uint16 E = uint16(D); //~WARN: typecasts that can truncate values should be checked + uint8 F = uint8(E); //~WARN: typecasts that can truncate values should be checked + } + + function downcastUnsafeInt() public pure { + int256 a = type(int256).max; + int248 b = int248(a); //~WARN: typecasts that can truncate values should be checked + int240 c = int240(b); //~WARN: typecasts that can truncate values should be checked + int232 d = int232(c); //~WARN: typecasts that can truncate values should be checked + int224 e = int224(d); //~WARN: typecasts that can truncate values should be checked + int216 f = int216(e); //~WARN: typecasts that can truncate values should be checked + int208 g = int208(f); //~WARN: typecasts that can truncate values should be checked + int200 h = int200(g); //~WARN: typecasts that can truncate values should be checked + int192 i = int192(h); //~WARN: typecasts that can truncate values should be checked + int184 j = int184(i); //~WARN: typecasts that can truncate values should be checked + int176 k = int176(j); //~WARN: typecasts that can truncate values should be checked + int168 l = int168(k); //~WARN: typecasts that can truncate values should be checked + int160 m = int160(l); //~WARN: typecasts that can truncate values should be checked + int152 n = int152(m); //~WARN: typecasts that can truncate values should be checked + int144 o = int144(n); //~WARN: typecasts that can truncate values should be checked + int136 p = int136(o); //~WARN: typecasts that can truncate values should be checked + int128 q = int128(p); //~WARN: typecasts that can truncate values should be checked + int120 r = int120(q); //~WARN: typecasts that can truncate values should be checked + int112 s = int112(r); //~WARN: typecasts that can truncate values should be checked + int104 t = int104(s); //~WARN: typecasts that can truncate values should be checked + int96 u = int96(t); //~WARN: typecasts that can truncate values should be checked + int88 v = int88(u); //~WARN: typecasts that can truncate values should be checked + int80 w = int80(v); //~WARN: typecasts that can truncate values should be checked + int72 x = int72(w); //~WARN: typecasts that can truncate values should be checked + int64 y = int64(x); //~WARN: typecasts that can truncate values should be checked + int56 z = int56(y); //~WARN: typecasts that can truncate values should be checked + int48 A = int48(z); //~WARN: typecasts that can truncate values should be checked + int40 B = int40(A); //~WARN: typecasts that can truncate values should be checked + int32 C = int32(B); //~WARN: typecasts that can truncate values should be checked + int24 D = int24(C); //~WARN: typecasts that can truncate values should be checked + int16 E = int16(D); //~WARN: typecasts that can truncate values should be checked + int8 F = int8(E); //~WARN: typecasts that can truncate values should be checked + } + + function downcastUnsafeBytes() public pure { + bytes32 a = bytes32(type(uint256).max); + bytes31 b = bytes31(a); //~WARN: typecasts that can truncate values should be checked + bytes30 c = bytes30(b); //~WARN: typecasts that can truncate values should be checked + bytes29 d = bytes29(c); //~WARN: typecasts that can truncate values should be checked + bytes28 e = bytes28(d); //~WARN: typecasts that can truncate values should be checked + bytes27 f = bytes27(e); //~WARN: typecasts that can truncate values should be checked + bytes26 g = bytes26(f); //~WARN: typecasts that can truncate values should be checked + bytes25 h = bytes25(g); //~WARN: typecasts that can truncate values should be checked + bytes24 i = bytes24(h); //~WARN: typecasts that can truncate values should be checked + bytes23 j = bytes23(i); //~WARN: typecasts that can truncate values should be checked + bytes22 k = bytes22(j); //~WARN: typecasts that can truncate values should be checked + bytes21 l = bytes21(k); //~WARN: typecasts that can truncate values should be checked + bytes20 m = bytes20(l); //~WARN: typecasts that can truncate values should be checked + bytes19 n = bytes19(m); //~WARN: typecasts that can truncate values should be checked + bytes18 o = bytes18(n); //~WARN: typecasts that can truncate values should be checked + bytes17 p = bytes17(o); //~WARN: typecasts that can truncate values should be checked + bytes16 q = bytes16(p); //~WARN: typecasts that can truncate values should be checked + bytes15 r = bytes15(q); //~WARN: typecasts that can truncate values should be checked + bytes14 s = bytes14(r); //~WARN: typecasts that can truncate values should be checked + bytes13 t = bytes13(s); //~WARN: typecasts that can truncate values should be checked + bytes12 u = bytes12(t); //~WARN: typecasts that can truncate values should be checked + bytes11 v = bytes11(u); //~WARN: typecasts that can truncate values should be checked + bytes10 w = bytes10(v); //~WARN: typecasts that can truncate values should be checked + bytes9 x = bytes9(w); //~WARN: typecasts that can truncate values should be checked + bytes8 y = bytes8(x); //~WARN: typecasts that can truncate values should be checked + bytes7 z = bytes7(y); //~WARN: typecasts that can truncate values should be checked + bytes6 A = bytes6(z); //~WARN: typecasts that can truncate values should be checked + bytes5 B = bytes5(A); //~WARN: typecasts that can truncate values should be checked + bytes4 C = bytes4(B); //~WARN: typecasts that can truncate values should be checked + bytes3 D = bytes3(C); //~WARN: typecasts that can truncate values should be checked + bytes2 E = bytes2(D); //~WARN: typecasts that can truncate values should be checked + bytes1 F = bytes1(E); //~WARN: typecasts that can truncate values should be checked + } + + function unsignedSignedUnsafe() public pure { + uint256 a = type(uint256).max; + int256 b = int256(a); //~WARN: typecasts that can truncate values should be checked + uint248 c = type(uint248).max; + int248 d = int248(c); //~WARN: typecasts that can truncate values should be checked + uint240 e = type(uint240).max; + int240 f = int240(e); //~WARN: typecasts that can truncate values should be checked + uint232 g = type(uint232).max; + int232 h = int232(g); //~WARN: typecasts that can truncate values should be checked + uint224 i = type(uint224).max; + int224 j = int224(i); //~WARN: typecasts that can truncate values should be checked + uint216 k = type(uint216).max; + int216 l = int216(k); //~WARN: typecasts that can truncate values should be checked + uint208 m = type(uint208).max; + int208 n = int208(m); //~WARN: typecasts that can truncate values should be checked + uint200 o = type(uint200).max; + int200 p = int200(o); //~WARN: typecasts that can truncate values should be checked + uint192 q = type(uint192).max; + int192 r = int192(q); //~WARN: typecasts that can truncate values should be checked + uint184 s = type(uint184).max; + int184 t = int184(s); //~WARN: typecasts that can truncate values should be checked + uint176 u = type(uint176).max; + int176 v = int176(u); //~WARN: typecasts that can truncate values should be checked + uint168 w = type(uint168).max; + int168 x = int168(w); //~WARN: typecasts that can truncate values should be checked + uint160 y = type(uint160).max; + int160 z = int160(y); //~WARN: typecasts that can truncate values should be checked + uint152 A = type(uint152).max; + int152 B = int152(A); //~WARN: typecasts that can truncate values should be checked + uint144 C = type(uint144).max; + int144 D = int144(C); //~WARN: typecasts that can truncate values should be checked + uint136 E = type(uint136).max; + int136 F = int136(E); //~WARN: typecasts that can truncate values should be checked + uint128 G = type(uint128).max; + int128 H = int128(G); //~WARN: typecasts that can truncate values should be checked + uint120 I = type(uint120).max; + int120 J = int120(I); //~WARN: typecasts that can truncate values should be checked + uint112 K = type(uint112).max; + int112 L = int112(K); //~WARN: typecasts that can truncate values should be checked + uint104 M = type(uint104).max; + int104 N = int104(M); //~WARN: typecasts that can truncate values should be checked + uint96 O = type(uint96).max; + int96 P = int96(O); //~WARN: typecasts that can truncate values should be checked + uint88 Q = type(uint88).max; + int88 R = int88(Q); //~WARN: typecasts that can truncate values should be checked + uint80 S = type(uint80).max; + int80 T = int80(S); //~WARN: typecasts that can truncate values should be checked + uint72 U = type(uint72).max; + int72 V = int72(U); //~WARN: typecasts that can truncate values should be checked + uint64 W = type(uint64).max; + int64 X = int64(W); //~WARN: typecasts that can truncate values should be checked + uint56 Y = type(uint56).max; + int56 Z = int56(Y); //~WARN: typecasts that can truncate values should be checked + uint48 AA = type(uint48).max; + int48 BB = int48(AA); //~WARN: typecasts that can truncate values should be checked + uint40 CC = type(uint40).max; + int40 DD = int40(CC); //~WARN: typecasts that can truncate values should be checked + uint32 EE = type(uint32).max; + int32 FF = int32(EE); //~WARN: typecasts that can truncate values should be checked + uint24 GG = type(uint24).max; + int24 HH = int24(GG); //~WARN: typecasts that can truncate values should be checked + uint16 II = type(uint16).max; + int16 JJ = int16(II); //~WARN: typecasts that can truncate values should be checked + uint8 KK = type(uint8).max; + int8 LL = int8(KK); //~WARN: typecasts that can truncate values should be checked + } + + function signedUnsignedUnsafe() public pure { + int256 a = -1; + uint256 b = uint256(a); //~WARN: typecasts that can truncate values should be checked + int248 c = -1; + uint248 d = uint248(c); //~WARN: typecasts that can truncate values should be checked + int240 e = -1; + uint240 f = uint240(e); //~WARN: typecasts that can truncate values should be checked + int232 g = -1; + uint232 h = uint232(g); //~WARN: typecasts that can truncate values should be checked + int224 i = -1; + uint224 j = uint224(i); //~WARN: typecasts that can truncate values should be checked + int216 k = -1; + uint216 l = uint216(k); //~WARN: typecasts that can truncate values should be checked + int208 m = -1; + uint208 n = uint208(m); //~WARN: typecasts that can truncate values should be checked + int200 o = -1; + uint200 p = uint200(o); //~WARN: typecasts that can truncate values should be checked + int192 q = -1; + uint192 r = uint192(q); //~WARN: typecasts that can truncate values should be checked + int184 s = -1; + uint184 t = uint184(s); //~WARN: typecasts that can truncate values should be checked + int176 u = -1; + uint176 v = uint176(u); //~WARN: typecasts that can truncate values should be checked + int168 w = -1; + uint168 x = uint168(w); //~WARN: typecasts that can truncate values should be checked + int160 y = -1; + uint160 z = uint160(y); //~WARN: typecasts that can truncate values should be checked + int152 A = -1; + uint152 B = uint152(A); //~WARN: typecasts that can truncate values should be checked + int144 C = -1; + uint144 D = uint144(C); //~WARN: typecasts that can truncate values should be checked + int136 E = -1; + uint136 F = uint136(E); //~WARN: typecasts that can truncate values should be checked + int128 G = -1; + uint128 H = uint128(G); //~WARN: typecasts that can truncate values should be checked + int120 I = -1; + uint120 J = uint120(I); //~WARN: typecasts that can truncate values should be checked + int112 K = -1; + uint112 L = uint112(K); //~WARN: typecasts that can truncate values should be checked + int104 M = -1; + uint104 N = uint104(M); //~WARN: typecasts that can truncate values should be checked + int96 O = -1; + uint96 P = uint96(O); //~WARN: typecasts that can truncate values should be checked + int88 Q = -1; + uint88 R = uint88(Q); //~WARN: typecasts that can truncate values should be checked + int80 S = -1; + uint80 T = uint80(S); //~WARN: typecasts that can truncate values should be checked + int72 U = -1; + uint72 V = uint72(U); //~WARN: typecasts that can truncate values should be checked + int64 W = -1; + uint64 X = uint64(W); //~WARN: typecasts that can truncate values should be checked + int56 Y = -1; + uint56 Z = uint56(Y); //~WARN: typecasts that can truncate values should be checked + int48 AA = -1; + uint48 BB = uint48(AA); //~WARN: typecasts that can truncate values should be checked + int40 CC = -1; + uint40 DD = uint40(CC); //~WARN: typecasts that can truncate values should be checked + int32 EE = -1; + uint32 FF = uint32(EE); //~WARN: typecasts that can truncate values should be checked + int24 GG = -1; + uint24 HH = uint24(GG); //~WARN: typecasts that can truncate values should be checked + int16 II = -1; + uint16 JJ = uint16(II); //~WARN: typecasts that can truncate values should be checked + int8 KK = -1; + uint8 LL = uint8(KK); //~WARN: typecasts that can truncate values should be checked + } + + function downcastDynamicUnsafe() public pure { + bytes memory data = "hello world"; + bytes32 dataSlice = bytes32(data); //~WARN: typecasts that can truncate values should be checked + string memory str = "hello world"; + bytes32 strSlice = bytes32(bytes(str)); //~WARN: typecasts that can truncate values should be checked + } +} + +contract Repros { + function longDynamicBytesDoNotPanic() public pure { + bytes memory stringToBytes = bytes("Initializable: contract is already initialized"); + } + + function nestedCastsAreEvaluatedAtAllDepths(uint64 a, int128 b) internal pure returns (uint64) { + uint64 aAloneIsSafe = uint64(uint128(int128(uint128(a)))); + + uint128 aPlusB = uint128(int128(a) + b); + //~^WARN: typecasts that can truncate values should be checked + + uint64 unsafe = uint64(aPlusB); + //~^WARN: typecasts that can truncate values should be checked + + return uint64(uint128(int128(uint128(a)) + b)); + //~^WARN: typecasts that can truncate values should be checked + //~^^WARN: typecasts that can truncate values should be checked + } +} +/// forge-lint: disable-end(mixed-case-variable) diff --git a/crates/lint/testdata/UnsafeTypecast.stderr b/crates/lint/testdata/UnsafeTypecast.stderr new file mode 100644 index 0000000000000..1bf3b9c7bdcb6 --- /dev/null +++ b/crates/lint/testdata/UnsafeTypecast.stderr @@ -0,0 +1,2119 @@ +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +191 | uint248 b = uint248(a); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint248' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +192 | uint240 c = uint240(b); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint240' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +193 | uint232 d = uint232(c); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint232' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +194 | uint224 e = uint224(d); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint224' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +195 | uint216 f = uint216(e); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint216' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +196 | uint208 g = uint208(f); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint208' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +197 | uint200 h = uint200(g); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint200' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +198 | uint192 i = uint192(h); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint192' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +199 | uint184 j = uint184(i); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint184' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +200 | uint176 k = uint176(j); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint176' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +201 | uint168 l = uint168(k); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint168' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +202 | uint160 m = uint160(l); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint160' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +203 | uint152 n = uint152(m); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint152' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +204 | uint144 o = uint144(n); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint144' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +205 | uint136 p = uint136(o); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint136' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +206 | uint128 q = uint128(p); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +207 | uint120 r = uint120(q); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint120' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +208 | uint112 s = uint112(r); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint112' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +209 | uint104 t = uint104(s); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint104' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +210 | uint96 u = uint96(t); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint96' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +211 | uint88 v = uint88(u); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint88' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +212 | uint80 w = uint80(v); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint80' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +213 | uint72 x = uint72(w); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint72' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +214 | uint64 y = uint64(x); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +215 | uint56 z = uint56(y); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint56' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +216 | uint48 A = uint48(z); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint48' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +217 | uint40 B = uint40(A); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint40' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +218 | uint32 C = uint32(B); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +219 | uint24 D = uint24(C); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint24' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +220 | uint16 E = uint16(D); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint16' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +221 | uint8 F = uint8(E); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint8' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +226 | int248 b = int248(a); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int248' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +227 | int240 c = int240(b); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int240' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +228 | int232 d = int232(c); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int232' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +229 | int224 e = int224(d); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int224' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +230 | int216 f = int216(e); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int216' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +231 | int208 g = int208(f); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int208' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +232 | int200 h = int200(g); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int200' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +233 | int192 i = int192(h); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int192' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +234 | int184 j = int184(i); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int184' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +235 | int176 k = int176(j); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int176' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +236 | int168 l = int168(k); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int168' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +237 | int160 m = int160(l); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int160' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +238 | int152 n = int152(m); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int152' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +239 | int144 o = int144(n); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int144' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +240 | int136 p = int136(o); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int136' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +241 | int128 q = int128(p); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +242 | int120 r = int120(q); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int120' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +243 | int112 s = int112(r); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int112' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +244 | int104 t = int104(s); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int104' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +245 | int96 u = int96(t); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int96' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +246 | int88 v = int88(u); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int88' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +247 | int80 w = int80(v); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int80' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +248 | int72 x = int72(w); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int72' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +249 | int64 y = int64(x); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +250 | int56 z = int56(y); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int56' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +251 | int48 A = int48(z); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int48' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +252 | int40 B = int40(A); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int40' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +253 | int32 C = int32(B); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +254 | int24 D = int24(C); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int24' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +255 | int16 E = int16(D); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int16' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +256 | int8 F = int8(E); + | ------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int8' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +261 | bytes31 b = bytes31(a); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes31' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +262 | bytes30 c = bytes30(b); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes30' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +263 | bytes29 d = bytes29(c); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes29' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +264 | bytes28 e = bytes28(d); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes28' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +265 | bytes27 f = bytes27(e); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes27' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +266 | bytes26 g = bytes26(f); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes26' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +267 | bytes25 h = bytes25(g); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes25' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +268 | bytes24 i = bytes24(h); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes24' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +269 | bytes23 j = bytes23(i); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes23' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +270 | bytes22 k = bytes22(j); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes22' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +271 | bytes21 l = bytes21(k); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes21' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +272 | bytes20 m = bytes20(l); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes20' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +273 | bytes19 n = bytes19(m); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes19' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +274 | bytes18 o = bytes18(n); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes18' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +275 | bytes17 p = bytes17(o); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes17' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +276 | bytes16 q = bytes16(p); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes16' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +277 | bytes15 r = bytes15(q); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes15' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +278 | bytes14 s = bytes14(r); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes14' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +279 | bytes13 t = bytes13(s); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes13' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +280 | bytes12 u = bytes12(t); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes12' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +281 | bytes11 v = bytes11(u); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes11' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +282 | bytes10 w = bytes10(v); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes10' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +283 | bytes9 x = bytes9(w); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes9' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +284 | bytes8 y = bytes8(x); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes8' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +285 | bytes7 z = bytes7(y); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes7' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +286 | bytes6 A = bytes6(z); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes6' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +287 | bytes5 B = bytes5(A); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes5' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +288 | bytes4 C = bytes4(B); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes4' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +289 | bytes3 D = bytes3(C); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes3' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +290 | bytes2 E = bytes2(D); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes2' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +291 | bytes1 F = bytes1(E); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes1' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +296 | int256 b = int256(a); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int256' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +298 | int248 d = int248(c); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int248' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +300 | int240 f = int240(e); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int240' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +302 | int232 h = int232(g); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int232' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +304 | int224 j = int224(i); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int224' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +306 | int216 l = int216(k); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int216' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +308 | int208 n = int208(m); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int208' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +310 | int200 p = int200(o); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int200' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +312 | int192 r = int192(q); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int192' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +314 | int184 t = int184(s); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int184' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +316 | int176 v = int176(u); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int176' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +318 | int168 x = int168(w); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int168' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +320 | int160 z = int160(y); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int160' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +322 | int152 B = int152(A); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int152' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +324 | int144 D = int144(C); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int144' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +326 | int136 F = int136(E); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int136' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +328 | int128 H = int128(G); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +330 | int120 J = int120(I); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int120' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +332 | int112 L = int112(K); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int112' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +334 | int104 N = int104(M); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int104' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +336 | int96 P = int96(O); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int96' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +338 | int88 R = int88(Q); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int88' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +340 | int80 T = int80(S); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int80' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +342 | int72 V = int72(U); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int72' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +344 | int64 X = int64(W); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +346 | int56 Z = int56(Y); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int56' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +348 | int48 BB = int48(AA); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int48' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +350 | int40 DD = int40(CC); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int40' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +352 | int32 FF = int32(EE); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +354 | int24 HH = int24(GG); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int24' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +356 | int16 JJ = int16(II); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int16' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +358 | int8 LL = int8(KK); + | -------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'int8' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +363 | uint256 b = uint256(a); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint256' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +365 | uint248 d = uint248(c); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint248' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +367 | uint240 f = uint240(e); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint240' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +369 | uint232 h = uint232(g); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint232' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +371 | uint224 j = uint224(i); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint224' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +373 | uint216 l = uint216(k); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint216' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +375 | uint208 n = uint208(m); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint208' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +377 | uint200 p = uint200(o); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint200' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +379 | uint192 r = uint192(q); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint192' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +381 | uint184 t = uint184(s); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint184' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +383 | uint176 v = uint176(u); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint176' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +385 | uint168 x = uint168(w); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint168' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +387 | uint160 z = uint160(y); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint160' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +389 | uint152 B = uint152(A); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint152' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +391 | uint144 D = uint144(C); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint144' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +393 | uint136 F = uint136(E); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint136' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +395 | uint128 H = uint128(G); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +397 | uint120 J = uint120(I); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint120' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +399 | uint112 L = uint112(K); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint112' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +401 | uint104 N = uint104(M); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint104' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +403 | uint96 P = uint96(O); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint96' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +405 | uint88 R = uint88(Q); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint88' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +407 | uint80 T = uint80(S); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint80' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +409 | uint72 V = uint72(U); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint72' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +411 | uint64 X = uint64(W); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +413 | uint56 Z = uint56(Y); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint56' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +415 | uint48 BB = uint48(AA); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint48' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +417 | uint40 DD = uint40(CC); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint40' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +419 | uint32 FF = uint32(EE); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +421 | uint24 HH = uint24(GG); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint24' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +423 | uint16 JJ = uint16(II); + | ---------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint16' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +425 | uint8 LL = uint8(KK); + | --------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint8' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +430 | bytes32 dataSlice = bytes32(data); + | ------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +432 | bytes32 strSlice = bytes32(bytes(str)); + | ------------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'bytes32' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +444 | uint128 aPlusB = uint128(int128(a) + b); + | ---------------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +447 | uint64 unsafe = uint64(aPlusB); + | -------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +450 | return uint64(uint128(int128(uint128(a)) + b)); + | --------------------------------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint64' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast + +warning[unsafe-typecast]: typecasts that can truncate values should be checked + --> ROOT/testdata/UnsafeTypecast.sol:LL:CC + | +450 | return uint64(uint128(int128(uint128(a)) + b)); + | ------------------------------- + | + = note: Consider disabling this lint if you're certain the cast is safe: + + // casting to 'uint128' is safe because [explain why] + // forge-lint: disable-next-line(unsafe-typecast) + + = help: https://book.getfoundry.sh/reference/forge/forge-lint#unsafe-typecast +