Skip to main content

Module incorrect_exp

Module incorrect_exp 

Source

Re-exportsยง

use super::IncorrectExp; ๐Ÿ”’
use crate::linter::LateLintPass; ๐Ÿ”’
use crate::linter::LintContext; ๐Ÿ”’
use crate::sol::Severity; ๐Ÿ”’
use crate::sol::SolLint; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use solar::ast::BinOpKind; ๐Ÿ”’
use solar::ast::LitKind; ๐Ÿ”’
use solar::sema::Gcx; ๐Ÿ”’
use solar::sema::hir; ๐Ÿ”’
use solar::sema::hir::ElementaryType; ๐Ÿ”’
use solar::sema::hir::Expr; ๐Ÿ”’
use solar::sema::hir::ExprKind; ๐Ÿ”’
use solar::sema::hir::Lit; ๐Ÿ”’
use solar::sema::hir::TypeKind; ๐Ÿ”’

Staticsยง

INCORRECT_EXP

Functionsยง

peel_int_casts ๐Ÿ”’
Looks through parentheses and integer casts (uint256(x), int8(x)), returning the innermost operand. A misplaced ^ can hide behind such a cast (uint256(10) ^ 18), which a bare literal check would miss. Non-integer casts (bytes32(x), address(x)) are left alone, since xor of a bytesN bit pattern is a legitimate operation.
plain_decimal_int_lit ๐Ÿ”’
Returns the value of a plain decimal integer literal, looking through parentheses and integer casts (uint256(10)), or None for anything else.