Module solidity

Module solidity 

Source
Expand description

Solidity Metadata Extraction Module

This module provides functionality for extracting metadata from Solidity source code, including contract definitions, function signatures, state variables, events, and Natspec documentation.

§Key Components

§Example

use neo_solidity::solidity::{analyse_all_sources, ContractMetadata};

let sources = vec![("Contract.sol".to_string(), source_code)];
let contracts = analyse_all_sources(&sources)?;

Structs§

ContractMetadata
Diagnostic
EnumMetadata
EventMetadata
EventParameter
FunctionMetadata
NatspecDoc
Natspec documentation extracted from Solidity source comments
ParameterMetadata
SelectorRegistry
StateVariableMetadata
StructFieldMetadata
StructMetadata

Enums§

DiagnosticSeverity
FunctionKind
SolidityError
Errors from Solidity compilation
StateMutability

Functions§

analyse_all_sources
analyse_source
apply_base_constructors_and_modifiers 🔒
apply_modifier_calls_to_body 🔒
apply_modifiers_and_base_constructors 🔒
base_last_name 🔒
build_method_name_counts 🔒
build_modifier_definition_map 🔒
build_parameter_substitutions 🔒
c3_merge 🔒
canonical_param_type 🔒
check_bn254_precompile_usage 🔒
Detect BN254 elliptic curve precompile usage and suggest Neo alternatives.
check_erc20_approve_pattern 🔒
Detect ERC-20 approve/allowance/transferFrom and note they are not in NEP-17.
check_erc20_transfer_pattern 🔒
Detect ERC-20 style transfer(address, uint256) and suggest NEP-17 4-param form.
check_erc721_transfer_from_pattern 🔒
Detect ERC-721 transferFrom(from, to, tokenId) and suggest NEP-11 transfer(to, tokenId, data).
check_erc1155_pattern 🔒
Detect ERC-1155 multi-token pattern and note Neo N3 has no direct equivalent.
check_erc2612_permit_pattern 🔒
Detect ERC-2612 permit pattern and note Neo uses checkWitness instead.
check_erc4626_vault_pattern 🔒
Detect ERC-4626 tokenized vault pattern and suggest NEP-17 replacement.
check_receive_fallback_pattern 🔒
Detect receive() / fallback() and suggest onNEP17Payment().
check_return_statements 🔒
check_supports_interface_pattern 🔒
Detect supportsInterface(bytes4) and note that Neo uses manifest instead.
collect_interface_events 🔒
collect_interface_events_recursive 🔒
collect_interface_types 🔒
collect_interface_types_recursive 🔒
compute_function_selector 🔒
contract_linearization_base_to_derived 🔒
contract_linearization_mro 🔒
convert_contract 🔒
convert_enum 🔒
convert_event 🔒
convert_function 🔒
convert_parameter 🔒
convert_state_variable 🔒
convert_struct 🔒
enums_to_type_metadata 🔒
extract_return_expression
flatten_contract_inheritance 🔒
function_ty_key 🔒
getter_signature_from_neotype 🔒
inheritance_contract_chain 🔒
modifier_placeholder_stmt 🔒
normalize_event_signature 🔒
rewrite_expression 🔒
rewrite_statement 🔒
solidity_type_from_neotype 🔒
statement_list_from_body 🔒
structs_to_type_metadata 🔒
synthesize_public_getters 🔒
validate_abstract_contract 🔒
validate_contract
validate_erc_nep_patterns 🔒
ERC → NEP pattern adaptation diagnostics.
validate_events 🔒
validate_flatten_warnings 🔒
validate_library 🔒
validate_methods 🔒
validate_return_types 🔒
validate_state_variables 🔒
validate_type_definitions 🔒
validate_using_directives 🔒