Skip to main content

check_init_selector

Function check_init_selector 

Source
fn check_init_selector(
    kind: &ContractKind,
    init_data: &Bytes,
    proxy_major: Option<u8>,
) -> CheckRow
Expand description

Validate init calldata against the kind’s expected reinitializer.

Empty init data is only accepted when the reinitializer is genuinely unnecessary: either the kind has none, or the proxy’s on-chain major version (proxy_major, None if the query failed) already reached the target. Otherwise the upgrade would silently skip e.g. initializeV3().