Skip to main content

Module unsafe_oz_erc721_mint

Module unsafe_oz_erc721_mint 

Source

Re-exportsΒ§

use super::UnsafeOzErc721Mint; πŸ”’
use crate::linter::LateLintPass; πŸ”’
use crate::linter::LintContext; πŸ”’
use crate::sol::Severity; πŸ”’
use crate::sol::SolLint; πŸ”’
use crate::sol::analysis::OPENZEPPELIN_ROOTS; πŸ”’
use crate::sol::analysis::arg_for_param; πŸ”’
use crate::sol::analysis::for_each_lhs_var; πŸ”’
use crate::sol::analysis::is_address_type; πŸ”’
use crate::sol::analysis::is_builtin; πŸ”’
use crate::sol::analysis::is_literal_false; πŸ”’
use crate::sol::analysis::is_require_or_assert; πŸ”’
use crate::sol::analysis::loop_stmts; πŸ”’
use crate::sol::analysis::source_in_package; πŸ”’
use crate::sol::analysis::underlying_var; πŸ”’
use crate::sol::analysis::unique; πŸ”’
use crate::sol::analysis::write_target; πŸ”’
use alloy_primitives::U256; πŸ”’
use solar::ast::ElementaryType; πŸ”’
use solar::ast::LitKind; πŸ”’
use solar::ast::StateMutability; πŸ”’
use solar::ast::Visibility; πŸ”’
use solar::interface::Span; πŸ”’
use solar::interface::kw; πŸ”’
use solar::sema::Gcx; πŸ”’
use solar::sema::hir; πŸ”’
use solar::sema::hir::BinOpKind; πŸ”’
use solar::sema::hir::CallArgs; πŸ”’
use solar::sema::hir::Expr; πŸ”’
use solar::sema::hir::ExprKind; πŸ”’
use solar::sema::hir::FunctionId; πŸ”’
use solar::sema::hir::Hir; πŸ”’
use solar::sema::hir::ItemId; πŸ”’
use solar::sema::hir::Stmt; πŸ”’
use solar::sema::hir::StmtKind; πŸ”’
use solar::sema::hir::TypeKind; πŸ”’
use solar::sema::hir::VariableId; πŸ”’
use solar::sema::hir::Visit; πŸ”’
use solar::sema::ty::TyFn; πŸ”’
use solar::sema::ty::TyKind; πŸ”’
use std::ops::ControlFlow; πŸ”’
use std::slice; πŸ”’

StructsΒ§

Cx πŸ”’
The analysis context.
Finder πŸ”’
Breaks out of a subtree at the first statement or expression matching a predicate.
GuardWalk πŸ”’
The straight-line reading of a body: coverage once a guard has run on the path, pending while a delegated mint has run with no guard before or after it yet, failed once a path may leave the function successfully with such a mint standing, escaped once one may leave before any guard ran.
GuardWalker πŸ”’
Reads a body in statement order and judges the delegated mints against the guards for recipient and token. A code-less proof may cover a later delegation, but a callback must run after ownership is established to match _safeMint: the receiver can inspect ownerOf, balances, or reenter during the hook. Such a callback covers delegations still pending, the revert undoing them, unless a statement in between may leave the function successfully, keeping the unacknowledged token: super._mint(to, id); if (id == 0) return; require(hook...) walks out with token zero standing.
UnsafeMintTarget πŸ”’
An unsafe mint target and whether every recursive hop preserves the recipient and token it receives. A callback guard needs both guarantees, while a code-less-recipient proof needs only the first.

EnumsΒ§

GuardCoverage πŸ”’
How a path established that the recipient can receive the mint. Callback evidence remains valid when summarizing a guard helper, while a code-less proof must be retired once a call could deploy code at the recipient address. Whether the evidence can cover a future mint is tracked separately by GuardWalk::future_coverage.
SelectorEncoding πŸ”’
The representation of a selector-sized constant at one conversion step.

ConstantsΒ§

ERC721_RECEIVED πŸ”’
The ERC721 answer meaning the recipient accepts the token, onERC721Received’s selector.

StaticsΒ§

UNSAFE_OZ_ERC721_MINT

FunctionsΒ§

assigns_to πŸ”’
Whether an expression writes var: var = x, var += x, var++ or delete var, directly or as one component of a tuple.
is_assembly πŸ”’
is_canonical_erc721 πŸ”’
The OpenZeppelin contracts whose _mint skips the receiver check. ERC721 and ERC721Upgradeable declare the unchecked _mint; in the v4 line, ERC721Consecutive and ERC721ConsecutiveUpgradeable override it with a construction guard that forwards to the base through super._mint, still without a receiver check. In v5 the Consecutive extension overrides _update instead, and the two extra names match nothing.
is_internal πŸ”’
is_revert_call πŸ”’
revert(...), require(false, ...) and assert(false).
keeps_its_value πŸ”’
Whether the variable cannot change between the delegation and the callback guard. An intervening call can reenter and mutate a state variable after the mint reads it but before the guard does. A local, a parameter, a constant or an immutable cannot be moved that way.
modifier_body_sides πŸ”’
The statements before and after a modifier’s single top-level placeholder. More complicated expansion shapes are left uncredited rather than guessing which paths execute the body.
named πŸ”’

Type AliasesΒ§

Call πŸ”’
A resolved call: its target, arguments and span.