This is page 4 of 94. Use http://codebase.md/cyfrin/aderyn?lines=false&page={x} to view the full context.
# Directory Structure
```
├── .cargo
│ └── config.toml
├── .git-blame-ignore-revs
├── .gitattributes
├── .github
│ ├── images
│ │ ├── aderyn_logo.png
│ │ ├── poweredbycyfrinblack.png
│ │ └── poweredbycyfrinblue.png
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.md
│ │ ├── false_positive_issue.md
│ │ └── feature_request.md
│ └── workflows
│ ├── cargo.yml
│ ├── dependencies.yml
│ ├── release.yml
│ ├── reports.yml
│ └── toml.yml
├── .gitignore
├── .gitmodules
├── .vscode
│ └── settings.json
├── aderyn
│ ├── Cargo.toml
│ ├── oranda.json
│ ├── README.md
│ ├── src
│ │ ├── birdsong.rs
│ │ ├── completions.rs
│ │ ├── lib.rs
│ │ ├── lsp.rs
│ │ ├── main.rs
│ │ ├── mcp.rs
│ │ └── panic.rs
│ └── templates
│ └── aderyn.toml
├── aderyn_core
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── README.md
│ ├── src
│ │ ├── ast
│ │ │ ├── ast_nodes.rs
│ │ │ ├── ast.rs
│ │ │ ├── impls
│ │ │ │ ├── ctx
│ │ │ │ │ ├── utils.rs
│ │ │ │ │ └── workspace.rs
│ │ │ │ ├── ctx.rs
│ │ │ │ ├── disp
│ │ │ │ │ ├── blocks.rs
│ │ │ │ │ ├── contracts.rs
│ │ │ │ │ ├── enumerations.rs
│ │ │ │ │ ├── errors.rs
│ │ │ │ │ ├── events.rs
│ │ │ │ │ ├── expressions.rs
│ │ │ │ │ ├── functions.rs
│ │ │ │ │ ├── identifiers.rs
│ │ │ │ │ ├── literals.rs
│ │ │ │ │ ├── modifiers.rs
│ │ │ │ │ ├── statements.rs
│ │ │ │ │ ├── structures.rs
│ │ │ │ │ ├── types.rs
│ │ │ │ │ ├── user_defined_value_types.rs
│ │ │ │ │ ├── using_for_directives.rs
│ │ │ │ │ └── variables.rs
│ │ │ │ ├── disp.rs
│ │ │ │ ├── node
│ │ │ │ │ ├── blocks.rs
│ │ │ │ │ ├── contracts.rs
│ │ │ │ │ ├── documentation.rs
│ │ │ │ │ ├── enumerations.rs
│ │ │ │ │ ├── errors.rs
│ │ │ │ │ ├── events.rs
│ │ │ │ │ ├── expressions.rs
│ │ │ │ │ ├── functions.rs
│ │ │ │ │ ├── identifiers.rs
│ │ │ │ │ ├── import_directives.rs
│ │ │ │ │ ├── literals.rs
│ │ │ │ │ ├── modifiers.rs
│ │ │ │ │ ├── pragma_directives.rs
│ │ │ │ │ ├── source_units.rs
│ │ │ │ │ ├── statements.rs
│ │ │ │ │ ├── structures.rs
│ │ │ │ │ ├── types.rs
│ │ │ │ │ ├── user_defined_value_types.rs
│ │ │ │ │ ├── using_for_directives.rs
│ │ │ │ │ └── variables.rs
│ │ │ │ ├── node.rs
│ │ │ │ ├── own
│ │ │ │ │ ├── hashing.rs
│ │ │ │ │ ├── node_id.rs
│ │ │ │ │ ├── source_units.rs
│ │ │ │ │ └── utils.rs
│ │ │ │ └── own.rs
│ │ │ ├── impls.rs
│ │ │ ├── macros.rs
│ │ │ ├── magic.rs
│ │ │ ├── node_type.rs
│ │ │ └── yul.rs
│ │ ├── ast.rs
│ │ ├── audit
│ │ │ ├── attack_surface.rs
│ │ │ ├── auditor.rs
│ │ │ ├── entrypoint.rs
│ │ │ └── public_functions_no_sender.rs
│ │ ├── audit.rs
│ │ ├── context
│ │ │ ├── browser
│ │ │ │ ├── ancestral_line.rs
│ │ │ │ ├── closest_ancestor.rs
│ │ │ │ ├── external_calls.rs
│ │ │ │ ├── extractor.rs
│ │ │ │ ├── immediate_children.rs
│ │ │ │ ├── location.rs
│ │ │ │ ├── macros.rs
│ │ │ │ ├── parent.rs
│ │ │ │ ├── peek_over.rs
│ │ │ │ ├── peek_under.rs
│ │ │ │ ├── peek.rs
│ │ │ │ ├── siblings.rs
│ │ │ │ ├── sort_nodes.rs
│ │ │ │ └── storage_vars.rs
│ │ │ ├── browser.rs
│ │ │ ├── capturable.rs
│ │ │ ├── flow
│ │ │ │ ├── display.rs
│ │ │ │ ├── error.rs
│ │ │ │ ├── kind.rs
│ │ │ │ ├── primitives.rs
│ │ │ │ ├── reducibles.rs
│ │ │ │ ├── tests.rs
│ │ │ │ ├── utils.rs
│ │ │ │ ├── visualizer.rs
│ │ │ │ └── voids.rs
│ │ │ ├── flow.rs
│ │ │ ├── graph
│ │ │ │ ├── callgraph
│ │ │ │ │ ├── legacy.rs
│ │ │ │ │ ├── new.rs
│ │ │ │ │ ├── tests.rs
│ │ │ │ │ ├── utils.rs
│ │ │ │ │ └── visit.rs
│ │ │ │ ├── callgraph.rs
│ │ │ │ ├── preprocess
│ │ │ │ │ ├── legacy.rs
│ │ │ │ │ └── new.rs
│ │ │ │ ├── preprocess.rs
│ │ │ │ ├── traits.rs
│ │ │ │ └── utils.rs
│ │ │ ├── graph.rs
│ │ │ ├── macros.rs
│ │ │ ├── mcp
│ │ │ │ ├── callgraph
│ │ │ │ │ ├── render.rs
│ │ │ │ │ ├── tool.rs
│ │ │ │ │ └── utils.rs
│ │ │ │ ├── callgraph.rs
│ │ │ │ ├── contract_surface
│ │ │ │ │ ├── render.rs
│ │ │ │ │ ├── tool.rs
│ │ │ │ │ └── util.rs
│ │ │ │ ├── contract_surface.rs
│ │ │ │ ├── list_contracts
│ │ │ │ │ ├── render.rs
│ │ │ │ │ └── tool.rs
│ │ │ │ ├── list_contracts.rs
│ │ │ │ ├── node_finder
│ │ │ │ │ ├── render.rs
│ │ │ │ │ ├── tool.rs
│ │ │ │ │ └── utils.rs
│ │ │ │ ├── node_finder.rs
│ │ │ │ ├── node_summarizer
│ │ │ │ │ ├── render.rs
│ │ │ │ │ ├── tool.rs
│ │ │ │ │ └── utils.rs
│ │ │ │ ├── node_summarizer.rs
│ │ │ │ ├── project_overview
│ │ │ │ │ ├── render.rs
│ │ │ │ │ └── tool.rs
│ │ │ │ ├── project_overview.rs
│ │ │ │ ├── tool_guide
│ │ │ │ │ └── tool.rs
│ │ │ │ └── tool_guide.rs
│ │ │ ├── mcp.rs
│ │ │ ├── router
│ │ │ │ ├── external_calls.rs
│ │ │ │ ├── internal_calls.rs
│ │ │ │ ├── modifier_calls.rs
│ │ │ │ └── tests.rs
│ │ │ ├── router.rs
│ │ │ └── workspace.rs
│ │ ├── context.rs
│ │ ├── detect
│ │ │ ├── detector.rs
│ │ │ ├── entrypoint.rs
│ │ │ ├── helpers.rs
│ │ │ ├── high
│ │ │ │ ├── _template.rs
│ │ │ │ ├── abi_encode_packed_hash_collision.rs
│ │ │ │ ├── arbitrary_transfer_from.rs
│ │ │ │ ├── const_func_changes_state.rs
│ │ │ │ ├── contract_locks_ether.rs
│ │ │ │ ├── dangerous_unary_operator.rs
│ │ │ │ ├── delegate_call_unchecked_address.rs
│ │ │ │ ├── delete_nested_mapping.rs
│ │ │ │ ├── dynamic_array_length_assignment.rs
│ │ │ │ ├── enumerable_loop_removal.rs
│ │ │ │ ├── eth_send_unchecked_address.rs
│ │ │ │ ├── experimental_encoder.rs
│ │ │ │ ├── function_selector_collision.rs
│ │ │ │ ├── incorrect_caret_operator.rs
│ │ │ │ ├── incorrect_erc20_interface.rs
│ │ │ │ ├── incorrect_erc721_interface.rs
│ │ │ │ ├── incorrect_shift_order.rs
│ │ │ │ ├── misused_boolean.rs
│ │ │ │ ├── msg_value_in_loops.rs
│ │ │ │ ├── multiple_constructors.rs
│ │ │ │ ├── nested_struct_in_mapping.rs
│ │ │ │ ├── out_of_order_retryable.rs
│ │ │ │ ├── pre_declared_variable_usage.rs
│ │ │ │ ├── reentrancy_state_change.rs
│ │ │ │ ├── reused_contract_name.rs
│ │ │ │ ├── rtlo.rs
│ │ │ │ ├── selfdestruct.rs
│ │ │ │ ├── signed_integer_storage_array.rs
│ │ │ │ ├── state_variable_shadowing.rs
│ │ │ │ ├── storage_array_memory_edit.rs
│ │ │ │ ├── strict_equality_contract_balance.rs
│ │ │ │ ├── tautological_compare.rs
│ │ │ │ ├── tautology_or_contradiction.rs
│ │ │ │ ├── tx_origin_used_for_auth.rs
│ │ │ │ ├── unchecked_low_level_call.rs
│ │ │ │ ├── unchecked_send.rs
│ │ │ │ ├── unprotected_initializer.rs
│ │ │ │ ├── unsafe_casting.rs
│ │ │ │ ├── weak_randomness.rs
│ │ │ │ └── yul_return.rs
│ │ │ ├── high.rs
│ │ │ ├── low
│ │ │ │ ├── _template.rs
│ │ │ │ ├── assert_state_change.rs
│ │ │ │ ├── block_timestamp_deadline.rs
│ │ │ │ ├── boolean_equality.rs
│ │ │ │ ├── builtin_symbol_shadowing.rs
│ │ │ │ ├── centralization_risk.rs
│ │ │ │ ├── constant_function_contains_assembly.rs
│ │ │ │ ├── costly_loop.rs
│ │ │ │ ├── dead_code.rs
│ │ │ │ ├── delegatecall_in_loop.rs
│ │ │ │ ├── deprecated_oz_function.rs
│ │ │ │ ├── division_before_multiplication.rs
│ │ │ │ ├── ecrecover.rs
│ │ │ │ ├── empty_block.rs
│ │ │ │ ├── empty_require_revert.rs
│ │ │ │ ├── function_initializing_state.rs
│ │ │ │ ├── function_pointer_in_constructor.rs
│ │ │ │ ├── inconsistent_type_names.rs
│ │ │ │ ├── incorrect_modifier.rs
│ │ │ │ ├── internal_function_used_once.rs
│ │ │ │ ├── large_numeric_literal.rs
│ │ │ │ ├── literal_instead_of_constant.rs
│ │ │ │ ├── local_variable_shadowing.rs
│ │ │ │ ├── missing_inheritance.rs
│ │ │ │ ├── modifier_used_only_once.rs
│ │ │ │ ├── multiple_placeholders.rs
│ │ │ │ ├── non_reentrant_not_first.rs
│ │ │ │ ├── push_0_opcode.rs
│ │ │ │ ├── redundant_statement.rs
│ │ │ │ ├── require_revert_in_loop.rs
│ │ │ │ ├── return_bomb.rs
│ │ │ │ ├── solmate_safe_transfer_lib.rs
│ │ │ │ ├── state_change_without_event.rs
│ │ │ │ ├── state_no_address_check.rs
│ │ │ │ ├── state_variable_could_be_constant.rs
│ │ │ │ ├── state_variable_could_be_immutable.rs
│ │ │ │ ├── state_variable_read_external.rs
│ │ │ │ ├── storage_array_length_not_cached.rs
│ │ │ │ ├── todo.rs
│ │ │ │ ├── unchecked_return.rs
│ │ │ │ ├── uninitialized_local_variable.rs
│ │ │ │ ├── unsafe_erc20_operation.rs
│ │ │ │ ├── unsafe_oz_erc721_mint.rs
│ │ │ │ ├── unspecific_solidity_pragma.rs
│ │ │ │ ├── unused_error.rs
│ │ │ │ ├── unused_import.rs
│ │ │ │ ├── unused_public_function.rs
│ │ │ │ ├── unused_state_variable.rs
│ │ │ │ └── void_constructor.rs
│ │ │ ├── low.rs
│ │ │ └── test_utils.rs
│ │ ├── detect.rs
│ │ ├── lib.rs
│ │ ├── stats
│ │ │ ├── cloc.rs
│ │ │ ├── dbg_tips.txt
│ │ │ ├── ignore.rs
│ │ │ ├── token.rs
│ │ │ └── util.rs
│ │ ├── stats.rs
│ │ ├── test_utils
│ │ │ └── load_source_unit.rs
│ │ ├── test_utils.rs
│ │ ├── visitor
│ │ │ ├── ast_visitor.rs
│ │ │ ├── macros.rs
│ │ │ └── workspace_visitor.rs
│ │ └── visitor.rs
│ ├── templates
│ │ └── mcp-tool-response
│ │ ├── callgraph.md
│ │ ├── contract_surface.md
│ │ ├── list_contracts.md
│ │ ├── node_finder_get_all.md
│ │ ├── node_finder_grep.md
│ │ ├── node_finder_search.md
│ │ ├── node_summarizer.md
│ │ ├── project_overview.md
│ │ └── tool_guide.md
│ └── tests
│ ├── common
│ │ ├── ancestral_line.rs
│ │ ├── closest_ancestor.rs
│ │ ├── immediate_children.rs
│ │ ├── immediate_parent.rs
│ │ ├── mod.rs
│ │ ├── new_ast_nodes.rs
│ │ ├── peek_over.rs
│ │ └── sibling.rs
│ └── traversal.rs
├── aderyn_driver
│ ├── .gitignore
│ ├── benches
│ │ └── detectors.rs
│ ├── Cargo.toml
│ ├── README.md
│ ├── src
│ │ ├── compile.rs
│ │ ├── config.rs
│ │ ├── display.rs
│ │ ├── driver.rs
│ │ ├── interface
│ │ │ ├── json.rs
│ │ │ ├── lsp.rs
│ │ │ ├── markdown.rs
│ │ │ ├── mod.rs
│ │ │ ├── sarif.rs
│ │ │ ├── tables.rs
│ │ │ └── util.rs
│ │ ├── lib.rs
│ │ ├── mcp.rs
│ │ ├── process.rs
│ │ └── runner.rs
│ └── tests
│ └── astgen.rs
├── bacon.toml
├── benchmarks
│ ├── aderyn
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── iteration_times.svg
│ │ │ └── pdf.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── iteration_times_small.svg
│ │ ├── iteration_times.svg
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── relative_iteration_times_small.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── SD.svg
│ │ └── typical.svg
│ ├── arbitrary-transfer-from
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── avoid-abi-encode-packed
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── block-timestamp-deadline
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── centralization-risk
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── constants-instead-of-literals
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── delegate-call-in-loop
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── deprecated-oz-functions
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── ecrecover
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── empty-block
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── hello_world
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── inconsistent-type-names
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── large-numeric-literal
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── non-reentrant-before-others
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── push-zero-opcode
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── report
│ │ └── index.html
│ ├── require-with-string
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── solmate-safe-transfer-lib
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── unindexed-events
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── unprotected-initializer
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── unsafe-erc20-functions
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── unsafe-oz-erc721-mint
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── unspecific-solidity-pragma
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── useless-internal-function
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── useless-modifier
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ ├── useless-public-function
│ │ ├── base
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ ├── change
│ │ │ └── estimates.json
│ │ ├── new
│ │ │ ├── benchmark.json
│ │ │ ├── estimates.json
│ │ │ ├── sample.json
│ │ │ └── tukey.json
│ │ └── report
│ │ ├── both
│ │ │ ├── pdf.svg
│ │ │ └── regression.svg
│ │ ├── change
│ │ │ ├── mean.svg
│ │ │ ├── median.svg
│ │ │ └── t-test.svg
│ │ ├── index.html
│ │ ├── MAD.svg
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ ├── pdf_small.svg
│ │ ├── pdf.svg
│ │ ├── regression_small.svg
│ │ ├── regression.svg
│ │ ├── relative_pdf_small.svg
│ │ ├── relative_regression_small.svg
│ │ ├── SD.svg
│ │ ├── slope.svg
│ │ └── typical.svg
│ └── zero-address-check
│ ├── base
│ │ ├── benchmark.json
│ │ ├── estimates.json
│ │ ├── sample.json
│ │ └── tukey.json
│ ├── change
│ │ └── estimates.json
│ ├── new
│ │ ├── benchmark.json
│ │ ├── estimates.json
│ │ ├── sample.json
│ │ └── tukey.json
│ └── report
│ ├── both
│ │ ├── pdf.svg
│ │ └── regression.svg
│ ├── change
│ │ ├── mean.svg
│ │ ├── median.svg
│ │ └── t-test.svg
│ ├── index.html
│ ├── MAD.svg
│ ├── mean.svg
│ ├── median.svg
│ ├── pdf_small.svg
│ ├── pdf.svg
│ ├── regression_small.svg
│ ├── regression.svg
│ ├── relative_pdf_small.svg
│ ├── relative_regression_small.svg
│ ├── SD.svg
│ ├── slope.svg
│ └── typical.svg
├── Cargo.lock
├── Cargo.toml
├── cli
│ ├── benchmarks.sh
│ └── reportgen.sh
├── CODEOWNERS
├── CONTRIBUTING.md
├── cyfrinup
│ ├── dynamic_script
│ └── why.md
├── deny.toml
├── dist-workspace.toml
├── funding.json
├── LICENSE
├── Makefile
├── package-lock.json
├── package.json
├── README.md
├── RELEASE_CHECKLIST.md
├── reports
│ ├── adhoc-sol-files-highs-only-report.json
│ ├── adhoc-sol-files-report.md
│ ├── ccip-functions-report.md
│ ├── empty_report.md
│ ├── hardhat-playground-report.md
│ ├── nft-report-icm.md
│ ├── nft-report.md
│ ├── prb-math-report.md
│ ├── report.json
│ ├── report.md
│ ├── report.sarif
│ ├── sablier-aderyn-toml-nested-root.md
│ ├── templegold-report.md
│ └── uniswap_profile.md
├── rust-toolchain.toml
├── rustfmt.toml
├── tests
│ ├── adhoc-sol-files
│ │ ├── aderyn.toml
│ │ ├── Counter.sol
│ │ ├── DemoASTNodes.sol
│ │ ├── Helper.sol
│ │ ├── InconsistentUints.sol
│ │ ├── inheritance
│ │ │ ├── ExtendedInheritance.sol
│ │ │ ├── IContractInheritance.sol
│ │ │ └── InheritanceBase.sol
│ │ ├── InternalFunctions.sol
│ │ ├── lib
│ │ │ └── ThisShouldBeExcluded.sol
│ │ ├── multiple-versions
│ │ │ ├── 0.4
│ │ │ │ ├── A.sol
│ │ │ │ └── B.sol
│ │ │ ├── 0.5
│ │ │ │ ├── A.sol
│ │ │ │ └── B.sol
│ │ │ ├── 0.6
│ │ │ │ ├── A.sol
│ │ │ │ └── B.sol
│ │ │ ├── 0.7
│ │ │ │ ├── A.sol
│ │ │ │ └── B.sol
│ │ │ └── 0.8
│ │ │ ├── A.sol
│ │ │ └── B.sol
│ │ ├── OnceModifierExample.sol
│ │ └── StateVariables.sol
│ ├── ast
│ │ ├── abstract_contract.json
│ │ ├── address_payable.json
│ │ ├── array_type_name.json
│ │ ├── ast-erc4626.json
│ │ ├── base_constructor_call.json
│ │ ├── bit_not.json
│ │ ├── call.json
│ │ ├── constructor.json
│ │ ├── contract_dep_order.json
│ │ ├── do_while.json
│ │ ├── documentation_1.json
│ │ ├── documentation_2.json
│ │ ├── documentation_3.json
│ │ ├── documentation_local_variable.json
│ │ ├── documentation_on_statements.json
│ │ ├── documentation_triple.json
│ │ ├── empty_block.json
│ │ ├── enum_value_declaration.json
│ │ ├── enum_value.json
│ │ ├── event_definition.json
│ │ ├── experimental_encoder_pragma.json
│ │ ├── fallback_and_reveice_ether.json
│ │ ├── fallback_payable.json
│ │ ├── fallback.json
│ │ ├── function_type.json
│ │ ├── function.json
│ │ ├── global_enum.json
│ │ ├── global_struct.json
│ │ ├── inheritance_specifier.json
│ │ ├── leave.json
│ │ ├── license.json
│ │ ├── long_type_name_binary_operation.json
│ │ ├── long_type_name_identifier.json
│ │ ├── loop.json
│ │ ├── mappings.json
│ │ ├── modifier_definition.json
│ │ ├── modifier_invocation.json
│ │ ├── mutability.json
│ │ ├── nested_functions.json
│ │ ├── non_utf8.json
│ │ ├── override.json
│ │ ├── placeholder_statement.json
│ │ ├── receive_ether.json
│ │ ├── short_type_name_ref.json
│ │ ├── short_type_name.json
│ │ ├── slot_offset.json
│ │ ├── smoke.json
│ │ ├── source_location.json
│ │ ├── string.json
│ │ ├── stringlit.json
│ │ ├── switch_default.json
│ │ ├── switch.json
│ │ ├── try_catch.json
│ │ ├── two_base_functions.json
│ │ ├── unicode.json
│ │ ├── used_errors.json
│ │ ├── userDefinedValueType.json
│ │ ├── using_for_directive.json
│ │ ├── var_access.json
│ │ └── yul_hex_literal.json
│ ├── contract-playground
│ │ ├── .github
│ │ │ └── workflows
│ │ │ └── test.yml
│ │ ├── .gitignore
│ │ ├── dot
│ │ │ └── .gitkeep
│ │ ├── foundry.toml
│ │ ├── README.md
│ │ ├── script
│ │ │ └── Counter.s.sol
│ │ ├── src
│ │ │ ├── AbstractContract.sol
│ │ │ ├── AderynIgnoreCustomDetectors.sol
│ │ │ ├── AdminContract.sol
│ │ │ ├── ArbitraryTransferFrom.sol
│ │ │ ├── AssemblyExample.sol
│ │ │ ├── AssertStateChange.sol
│ │ │ ├── auditor_mode
│ │ │ │ ├── ExternalCalls.sol
│ │ │ │ └── PublicFunctionsWithoutSenderCheck.sol
│ │ │ ├── BooleanEquality.sol
│ │ │ ├── BuiltinSymbolShadow.sol
│ │ │ ├── CacheArrayLength.sol
│ │ │ ├── CallGraphTests.sol
│ │ │ ├── Casting.sol
│ │ │ ├── cloc
│ │ │ │ ├── AnotherHeavilyCommentedContract.sol
│ │ │ │ ├── EmptyContractFile.sol
│ │ │ │ └── HeavilyCommentedContract.sol
│ │ │ ├── CompilerBugStorageSignedIntegerArray.sol
│ │ │ ├── ConstantFuncsAssembly.sol
│ │ │ ├── ConstantsLiterals.sol
│ │ │ ├── ConstFuncChangeState.sol
│ │ │ ├── ContractLocksEther.sol
│ │ │ ├── ContractWithTodo.sol
│ │ │ ├── control_flow
│ │ │ │ └── SimpleProgram.sol
│ │ │ ├── CostlyOperationsInsideLoops.sol
│ │ │ ├── Counter.sol
│ │ │ ├── CrazyPragma.sol
│ │ │ ├── DangerousStrictEquality1.sol
│ │ │ ├── DangerousStrictEquality2.sol
│ │ │ ├── DangerousUnaryOperator.sol
│ │ │ ├── DeadCode.sol
│ │ │ ├── DelegateCallWithoutAddressCheck.sol
│ │ │ ├── DeletionNestedMappingStructureContract.sol
│ │ │ ├── DeprecatedOZFunctions.sol
│ │ │ ├── DivisionBeforeMultiplication.sol
│ │ │ ├── DynamicArrayLengthAssignment.sol
│ │ │ ├── EmitAfterExternalCall.sol
│ │ │ ├── EmptyBlocks.sol
│ │ │ ├── EnumerableSetIteration.sol
│ │ │ ├── eth2
│ │ │ │ └── DepositContract.sol
│ │ │ ├── ExperimentalEncoder.sol
│ │ │ ├── ExternalCalls.sol
│ │ │ ├── FunctionInitializingState.sol
│ │ │ ├── FunctionPointers.sol
│ │ │ ├── FunctionSignatureCollision.sol
│ │ │ ├── HugeConstants.sol
│ │ │ ├── IgnoreEverything.sol
│ │ │ ├── InconsistentUints.sol
│ │ │ ├── IncorrectCaretOperator.sol
│ │ │ ├── IncorrectERC20.sol
│ │ │ ├── IncorrectERC721.sol
│ │ │ ├── IncorrectModifier.sol
│ │ │ ├── IncorrectShift.sol
│ │ │ ├── inheritance
│ │ │ │ ├── ExtendedInheritance.sol
│ │ │ │ ├── IContractInheritance.sol
│ │ │ │ └── InheritanceBase.sol
│ │ │ ├── InternalFunctions.sol
│ │ │ ├── KeccakContract.sol
│ │ │ ├── LocalVariableShadow.sol
│ │ │ ├── MissingInheritance.sol
│ │ │ ├── MisusedBoolean.sol
│ │ │ ├── MsgValueInLoop.sol
│ │ │ ├── MultipleConstructorSchemes.sol
│ │ │ ├── MultiplePlaceholders.sol
│ │ │ ├── nested
│ │ │ │ ├── 1
│ │ │ │ │ └── Nested.sol
│ │ │ │ └── 2
│ │ │ │ └── Nested.sol
│ │ │ ├── nested_mappings
│ │ │ │ ├── LaterVersion.sol
│ │ │ │ └── NestedMappings.sol
│ │ │ ├── OnceModifierExample.sol
│ │ │ ├── OnlyLibrary.sol
│ │ │ ├── OutOfOrderRetryable.sol
│ │ │ ├── parent_chain
│ │ │ │ └── ParentChainContract.sol
│ │ │ ├── PragmaRange.sol
│ │ │ ├── PreDeclaredVarUsage.sol
│ │ │ ├── PublicFunction.sol
│ │ │ ├── PublicVariableReadInExternalContext.sol
│ │ │ ├── RedundantStatements.sol
│ │ │ ├── ReturnBomb.sol
│ │ │ ├── reused_contract_name
│ │ │ │ ├── ContractA.sol
│ │ │ │ └── ContractB.sol
│ │ │ ├── RevertsAndRequriesInLoops.sol
│ │ │ ├── router
│ │ │ │ ├── ExternalCalls.sol
│ │ │ │ ├── FallbackAndReceiveOverrides.sol
│ │ │ │ ├── InternalCalls.sol
│ │ │ │ ├── ModifierCalls.sol
│ │ │ │ └── VarOverridesFunction.sol
│ │ │ ├── RTLO.sol
│ │ │ ├── SendEtherNoChecks.sol
│ │ │ ├── SendEtherNoChecksLibImport.sol
│ │ │ ├── StateChangeAfterExternalCall.sol
│ │ │ ├── StateShadowing.sol
│ │ │ ├── StateVariableCouldBeDeclaredConstant.sol
│ │ │ ├── StateVariableCouldBeDeclaredImmutable.sol
│ │ │ ├── StateVariables.sol
│ │ │ ├── StateVariablesChangesWithoutEvents.sol
│ │ │ ├── StateVariablesManipulation.sol
│ │ │ ├── StorageConditionals.sol
│ │ │ ├── StorageParameters.sol
│ │ │ ├── T11sTranferer.sol
│ │ │ ├── TautologicalCompare.sol
│ │ │ ├── TautologyOrContradiction.sol
│ │ │ ├── TestERC20.sol
│ │ │ ├── TransientKeyword.sol
│ │ │ ├── Trump.sol
│ │ │ ├── TxOriginUsedForAuth.sol
│ │ │ ├── U2.sol
│ │ │ ├── U3.sol
│ │ │ ├── U4.sol
│ │ │ ├── U5.sol
│ │ │ ├── UncheckedCalls.sol
│ │ │ ├── UncheckedReturn.sol
│ │ │ ├── UncheckedSend.sol
│ │ │ ├── UninitializedLocalVariables.sol
│ │ │ ├── UninitializedStateVariable.sol
│ │ │ ├── uniswap
│ │ │ │ ├── UniswapV2Swapper.sol
│ │ │ │ └── UniswapV3Swapper.sol
│ │ │ ├── UnprotectedInitialize.sol
│ │ │ ├── UnsafeERC721Mint.sol
│ │ │ ├── UnusedError.sol
│ │ │ ├── UnusedImport.sol
│ │ │ ├── UnusedStateVariables.sol
│ │ │ ├── UsingSelfdestruct.sol
│ │ │ ├── VoidConstructor.sol
│ │ │ ├── WeakRandomness.sol
│ │ │ ├── WrongOrderOfLayout.sol
│ │ │ ├── YulReturn.sol
│ │ │ └── ZeroAddressCheck.sol
│ │ └── test
│ │ └── Counter.t.sol
│ ├── foundry-nft-f23
│ │ ├── .github
│ │ │ └── workflows
│ │ │ └── test.yml
│ │ ├── .gitignore
│ │ ├── foundry.lock
│ │ ├── foundry.toml
│ │ ├── README.md
│ │ ├── remappings.txt
│ │ └── src
│ │ ├── BasicNft.sol
│ │ ├── F1.sol
│ │ ├── F2.sol
│ │ ├── Initializer.sol
│ │ └── inner-core-modules
│ │ └── ICM.sol
│ ├── foundry-nft-f23-icm
│ │ ├── .github
│ │ │ └── workflows
│ │ │ └── test.yml
│ │ ├── .gitignore
│ │ ├── aderyn.toml
│ │ ├── foundry.toml
│ │ ├── README.md
│ │ ├── remappings.txt
│ │ └── src
│ │ ├── BasicNft.sol
│ │ ├── F1.sol
│ │ ├── F2.sol
│ │ ├── Initializer.sol
│ │ └── inner-core-modules
│ │ └── ICM.sol
│ ├── hardhat-js-playground
│ │ ├── .gitignore
│ │ ├── artifacts
│ │ │ ├── build-info
│ │ │ │ └── cee6fe9a9a2f03f7ff10a27ab2746af6.json
│ │ │ └── contracts
│ │ │ ├── Counter.sol
│ │ │ │ ├── Counter.dbg.json
│ │ │ │ └── Counter.json
│ │ │ ├── ExtendedInheritance.sol
│ │ │ │ ├── ExtendedInheritance.dbg.json
│ │ │ │ └── ExtendedInheritance.json
│ │ │ ├── IContractInheritance.sol
│ │ │ │ ├── IContractInheritance.dbg.json
│ │ │ │ └── IContractInheritance.json
│ │ │ ├── InheritanceBase.sol
│ │ │ │ ├── InheritanceBase.dbg.json
│ │ │ │ └── InheritanceBase.json
│ │ │ ├── KeccakContract.sol
│ │ │ │ ├── KeccakContract.dbg.json
│ │ │ │ └── KeccakContract.json
│ │ │ ├── Lock.sol
│ │ │ │ ├── Lock.dbg.json
│ │ │ │ └── Lock.json
│ │ │ └── StateVariables.sol
│ │ │ ├── StateVariables.dbg.json
│ │ │ └── StateVariables.json
│ │ ├── contracts
│ │ │ ├── Counter.sol
│ │ │ ├── ExtendedInheritance.sol
│ │ │ ├── IContractInheritance.sol
│ │ │ ├── InheritanceBase.sol
│ │ │ ├── KeccakContract.sol
│ │ │ ├── Lock.sol
│ │ │ └── StateVariables.sol
│ │ ├── hardhat.config.js
│ │ ├── package.json
│ │ ├── README.md
│ │ ├── scripts
│ │ │ └── deploy.js
│ │ ├── test
│ │ │ └── Lock.js
│ │ └── yarn.lock
│ ├── no-sol-files
│ │ ├── extra
│ │ │ └── HelloAgain.md
│ │ ├── Hello.txt
│ │ └── Hello.yul
│ └── toml
│ ├── nested_project1
│ │ ├── aderyn.toml
│ │ ├── folder1
│ │ │ └── hardhat.config.ts
│ │ ├── folder2
│ │ │ └── hardhat.config.ts
│ │ └── folder3
│ │ └── file.txt
│ └── nested_project2
│ ├── aderyn.toml
│ ├── folder1
│ │ └── foundry.toml
│ └── folder2
│ └── file1.txt
├── tools
│ └── xtask
│ ├── Cargo.toml
│ └── src
│ ├── blesspr.rs
│ ├── cut_release.rs
│ ├── flags.rs
│ ├── main.rs
│ ├── reportgen.rs
│ └── tomlgen.rs
└── typos.toml
```
# Files
--------------------------------------------------------------------------------
/benchmarks/useless-modifier/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[38.0,76.0,114.0,152.0,190.0,228.0,266.0,304.0,342.0,380.0,418.0,456.0,494.0,532.0,570.0,608.0,646.0,684.0,722.0,760.0,798.0,836.0,874.0,912.0,950.0,988.0,1026.0,1064.0,1102.0,1140.0,1178.0,1216.0,1254.0,1292.0,1330.0,1368.0,1406.0,1444.0,1482.0,1520.0,1558.0,1596.0,1634.0,1672.0,1710.0,1748.0,1786.0,1824.0,1862.0,1900.0,1938.0,1976.0,2014.0,2052.0,2090.0,2128.0,2166.0,2204.0,2242.0,2280.0,2318.0,2356.0,2394.0,2432.0,2470.0,2508.0,2546.0,2584.0,2622.0,2660.0,2698.0,2736.0,2774.0,2812.0,2850.0,2888.0,2926.0,2964.0,3002.0,3040.0,3078.0,3116.0,3154.0,3192.0,3230.0,3268.0,3306.0,3344.0,3382.0,3420.0,3458.0,3496.0,3534.0,3572.0,3610.0,3648.0,3686.0,3724.0,3762.0,3800.0],"times":[1000898.0,2000658.0,3807676.0,4091968.0,5206770.0,6350277.0,6859289.0,7841732.0,8817467.0,9799552.0,10779046.0,11759737.0,12733736.0,13758813.0,14704430.0,15680763.0,16659286.0,17640217.0,18625698.0,19629828.0,20592056.0,21599075.0,22666452.0,23909303.0,24932891.0,25895033.0,27572095.0,26676194.0,27622190.0,28563879.0,29557504.0,30507407.0,31437487.0,32594366.0,34333954.0,35380791.0,36235845.0,36859005.0,38093053.0,38454785.0,39468062.0,40914708.0,42229769.0,43156227.0,43457740.0,44458366.0,44308156.0,45653806.0,46398753.0,47565302.0,48569982.0,49212044.0,50313290.0,51570394.0,52407741.0,51777198.0,52736932.0,53669727.0,54607475.0,55546355.0,57049228.0,59755668.0,60082371.0,61267901.0,62096520.0,62598997.0,62979669.0,64034286.0,64981992.0,66508255.0,66074139.0,66681259.0,67597767.0,68264472.0,68592499.0,69514326.0,71079081.0,71982434.0,72176626.0,73020188.0,73861073.0,74895962.0,76078298.0,77085484.0,76528190.0,78570632.0,79045423.0,79948318.0,79543362.0,80751638.0,83012160.0,82077868.0,83052316.0,83754813.0,84337927.0,86710827.0,87147209.0,87471193.0,95634828.0,91797079.0]}
```
--------------------------------------------------------------------------------
/benchmarks/unspecific-solidity-pragma/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[53.0,106.0,159.0,212.0,265.0,318.0,371.0,424.0,477.0,530.0,583.0,636.0,689.0,742.0,795.0,848.0,901.0,954.0,1007.0,1060.0,1113.0,1166.0,1219.0,1272.0,1325.0,1378.0,1431.0,1484.0,1537.0,1590.0,1643.0,1696.0,1749.0,1802.0,1855.0,1908.0,1961.0,2014.0,2067.0,2120.0,2173.0,2226.0,2279.0,2332.0,2385.0,2438.0,2491.0,2544.0,2597.0,2650.0,2703.0,2756.0,2809.0,2862.0,2915.0,2968.0,3021.0,3074.0,3127.0,3180.0,3233.0,3286.0,3339.0,3392.0,3445.0,3498.0,3551.0,3604.0,3657.0,3710.0,3763.0,3816.0,3869.0,3922.0,3975.0,4028.0,4081.0,4134.0,4187.0,4240.0,4293.0,4346.0,4399.0,4452.0,4505.0,4558.0,4611.0,4664.0,4717.0,4770.0,4823.0,4876.0,4929.0,4982.0,5035.0,5088.0,5141.0,5194.0,5247.0,5300.0],"times":[918834.0,1852480.0,2996435.0,4132180.0,4595080.0,5723924.0,6722419.0,7287233.0,8278345.0,9157781.0,10155316.0,10923867.0,11832236.0,12740926.0,13645597.0,14579025.0,15436148.0,16387191.0,17233012.0,18754542.0,19119635.0,20067286.0,21004521.0,21891510.0,22806932.0,23730338.0,24674678.0,25648729.0,26577903.0,27461031.0,28424755.0,29294696.0,30033986.0,30977758.0,31961496.0,32798474.0,33714089.0,34612951.0,35415106.0,36316492.0,37614638.0,37061009.0,37944063.0,38858009.0,39718991.0,40606307.0,41496007.0,42353922.0,43219605.0,44281096.0,45717044.0,46156764.0,47013014.0,47846901.0,48770392.0,49714805.0,50555226.0,51678122.0,52212427.0,53207353.0,52670411.0,53527699.0,54307191.0,55339663.0,55848705.0,56676879.0,57696391.0,58523317.0,59470874.0,60418049.0,60979588.0,61893794.0,62870569.0,63486628.0,64447694.0,65529124.0,66443721.0,67112766.0,68005413.0,68906600.0,69761024.0,68706263.0,69337822.0,70138378.0,71732450.0,72395860.0,73098787.0,73796647.0,74354277.0,74992398.0,76087141.0,76956329.0,81579865.0,81058214.0,79610490.0,80493712.0,80988092.0,81445238.0,81430030.0,82047878.0]}
```
--------------------------------------------------------------------------------
/benchmarks/unspecific-solidity-pragma/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[53.0,106.0,159.0,212.0,265.0,318.0,371.0,424.0,477.0,530.0,583.0,636.0,689.0,742.0,795.0,848.0,901.0,954.0,1007.0,1060.0,1113.0,1166.0,1219.0,1272.0,1325.0,1378.0,1431.0,1484.0,1537.0,1590.0,1643.0,1696.0,1749.0,1802.0,1855.0,1908.0,1961.0,2014.0,2067.0,2120.0,2173.0,2226.0,2279.0,2332.0,2385.0,2438.0,2491.0,2544.0,2597.0,2650.0,2703.0,2756.0,2809.0,2862.0,2915.0,2968.0,3021.0,3074.0,3127.0,3180.0,3233.0,3286.0,3339.0,3392.0,3445.0,3498.0,3551.0,3604.0,3657.0,3710.0,3763.0,3816.0,3869.0,3922.0,3975.0,4028.0,4081.0,4134.0,4187.0,4240.0,4293.0,4346.0,4399.0,4452.0,4505.0,4558.0,4611.0,4664.0,4717.0,4770.0,4823.0,4876.0,4929.0,4982.0,5035.0,5088.0,5141.0,5194.0,5247.0,5300.0],"times":[918834.0,1852480.0,2996435.0,4132180.0,4595080.0,5723924.0,6722419.0,7287233.0,8278345.0,9157781.0,10155316.0,10923867.0,11832236.0,12740926.0,13645597.0,14579025.0,15436148.0,16387191.0,17233012.0,18754542.0,19119635.0,20067286.0,21004521.0,21891510.0,22806932.0,23730338.0,24674678.0,25648729.0,26577903.0,27461031.0,28424755.0,29294696.0,30033986.0,30977758.0,31961496.0,32798474.0,33714089.0,34612951.0,35415106.0,36316492.0,37614638.0,37061009.0,37944063.0,38858009.0,39718991.0,40606307.0,41496007.0,42353922.0,43219605.0,44281096.0,45717044.0,46156764.0,47013014.0,47846901.0,48770392.0,49714805.0,50555226.0,51678122.0,52212427.0,53207353.0,52670411.0,53527699.0,54307191.0,55339663.0,55848705.0,56676879.0,57696391.0,58523317.0,59470874.0,60418049.0,60979588.0,61893794.0,62870569.0,63486628.0,64447694.0,65529124.0,66443721.0,67112766.0,68005413.0,68906600.0,69761024.0,68706263.0,69337822.0,70138378.0,71732450.0,72395860.0,73098787.0,73796647.0,74354277.0,74992398.0,76087141.0,76956329.0,81579865.0,81058214.0,79610490.0,80493712.0,80988092.0,81445238.0,81430030.0,82047878.0]}
```
--------------------------------------------------------------------------------
/benchmarks/useless-internal-function/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[61.0,122.0,183.0,244.0,305.0,366.0,427.0,488.0,549.0,610.0,671.0,732.0,793.0,854.0,915.0,976.0,1037.0,1098.0,1159.0,1220.0,1281.0,1342.0,1403.0,1464.0,1525.0,1586.0,1647.0,1708.0,1769.0,1830.0,1891.0,1952.0,2013.0,2074.0,2135.0,2196.0,2257.0,2318.0,2379.0,2440.0,2501.0,2562.0,2623.0,2684.0,2745.0,2806.0,2867.0,2928.0,2989.0,3050.0,3111.0,3172.0,3233.0,3294.0,3355.0,3416.0,3477.0,3538.0,3599.0,3660.0,3721.0,3782.0,3843.0,3904.0,3965.0,4026.0,4087.0,4148.0,4209.0,4270.0,4331.0,4392.0,4453.0,4514.0,4575.0,4636.0,4697.0,4758.0,4819.0,4880.0,4941.0,5002.0,5063.0,5124.0,5185.0,5246.0,5307.0,5368.0,5429.0,5490.0,5551.0,5612.0,5673.0,5734.0,5795.0,5856.0,5917.0,5978.0,6039.0,6100.0],"times":[1106324.0,2955651.0,3561764.0,3791536.0,5324088.0,6576151.0,6647921.0,8093746.0,8880572.0,9808345.0,10523661.0,11701426.0,12659951.0,13300781.0,14687248.0,25577164.0,17801656.0,22534121.0,26591468.0,19922210.0,20322329.0,21428098.0,23164558.0,27500038.0,26103106.0,25546526.0,26816491.0,27654232.0,27860667.0,31509264.0,30202932.0,30821871.0,32124397.0,33541227.0,33862561.0,54006890.0,73763683.0,47095375.0,44314294.0,41085445.0,40780640.0,46220237.0,41356765.0,43490445.0,43623754.0,43565436.0,45915791.0,50367970.0,52553018.0,50254706.0,48368677.0,48708848.0,49712003.0,50569905.0,51800569.0,52311116.0,54345111.0,59900823.0,60277667.0,62487439.0,58287770.0,61357512.0,60828734.0,62025285.0,67277017.0,67566559.0,64856922.0,66749895.0,66689603.0,67237138.0,68159746.0,71572084.0,71203773.0,73545138.0,74335896.0,74292464.0,73923607.0,74133306.0,77138090.0,78059182.0,77970348.0,77650109.0,78891611.0,79309867.0,78226524.0,80183753.0,80194510.0,80297152.0,81024033.0,81972347.0,83415575.0,88217848.0,93150590.0,91186773.0,93009667.0,92135593.0,93042140.0,110885086.0,97433476.0,95970244.0]}
```
--------------------------------------------------------------------------------
/benchmarks/useless-internal-function/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[61.0,122.0,183.0,244.0,305.0,366.0,427.0,488.0,549.0,610.0,671.0,732.0,793.0,854.0,915.0,976.0,1037.0,1098.0,1159.0,1220.0,1281.0,1342.0,1403.0,1464.0,1525.0,1586.0,1647.0,1708.0,1769.0,1830.0,1891.0,1952.0,2013.0,2074.0,2135.0,2196.0,2257.0,2318.0,2379.0,2440.0,2501.0,2562.0,2623.0,2684.0,2745.0,2806.0,2867.0,2928.0,2989.0,3050.0,3111.0,3172.0,3233.0,3294.0,3355.0,3416.0,3477.0,3538.0,3599.0,3660.0,3721.0,3782.0,3843.0,3904.0,3965.0,4026.0,4087.0,4148.0,4209.0,4270.0,4331.0,4392.0,4453.0,4514.0,4575.0,4636.0,4697.0,4758.0,4819.0,4880.0,4941.0,5002.0,5063.0,5124.0,5185.0,5246.0,5307.0,5368.0,5429.0,5490.0,5551.0,5612.0,5673.0,5734.0,5795.0,5856.0,5917.0,5978.0,6039.0,6100.0],"times":[1106324.0,2955651.0,3561764.0,3791536.0,5324088.0,6576151.0,6647921.0,8093746.0,8880572.0,9808345.0,10523661.0,11701426.0,12659951.0,13300781.0,14687248.0,25577164.0,17801656.0,22534121.0,26591468.0,19922210.0,20322329.0,21428098.0,23164558.0,27500038.0,26103106.0,25546526.0,26816491.0,27654232.0,27860667.0,31509264.0,30202932.0,30821871.0,32124397.0,33541227.0,33862561.0,54006890.0,73763683.0,47095375.0,44314294.0,41085445.0,40780640.0,46220237.0,41356765.0,43490445.0,43623754.0,43565436.0,45915791.0,50367970.0,52553018.0,50254706.0,48368677.0,48708848.0,49712003.0,50569905.0,51800569.0,52311116.0,54345111.0,59900823.0,60277667.0,62487439.0,58287770.0,61357512.0,60828734.0,62025285.0,67277017.0,67566559.0,64856922.0,66749895.0,66689603.0,67237138.0,68159746.0,71572084.0,71203773.0,73545138.0,74335896.0,74292464.0,73923607.0,74133306.0,77138090.0,78059182.0,77970348.0,77650109.0,78891611.0,79309867.0,78226524.0,80183753.0,80194510.0,80297152.0,81024033.0,81972347.0,83415575.0,88217848.0,93150590.0,91186773.0,93009667.0,92135593.0,93042140.0,110885086.0,97433476.0,95970244.0]}
```
--------------------------------------------------------------------------------
/benchmarks/avoid-abi-encode-packed/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[69.0,138.0,207.0,276.0,345.0,414.0,483.0,552.0,621.0,690.0,759.0,828.0,897.0,966.0,1035.0,1104.0,1173.0,1242.0,1311.0,1380.0,1449.0,1518.0,1587.0,1656.0,1725.0,1794.0,1863.0,1932.0,2001.0,2070.0,2139.0,2208.0,2277.0,2346.0,2415.0,2484.0,2553.0,2622.0,2691.0,2760.0,2829.0,2898.0,2967.0,3036.0,3105.0,3174.0,3243.0,3312.0,3381.0,3450.0,3519.0,3588.0,3657.0,3726.0,3795.0,3864.0,3933.0,4002.0,4071.0,4140.0,4209.0,4278.0,4347.0,4416.0,4485.0,4554.0,4623.0,4692.0,4761.0,4830.0,4899.0,4968.0,5037.0,5106.0,5175.0,5244.0,5313.0,5382.0,5451.0,5520.0,5589.0,5658.0,5727.0,5796.0,5865.0,5934.0,6003.0,6072.0,6141.0,6210.0,6279.0,6348.0,6417.0,6486.0,6555.0,6624.0,6693.0,6762.0,6831.0,6900.0],"times":[1084378.0,2032039.0,3694575.0,4167388.0,5028346.0,5994926.0,7135730.0,7689896.0,12543816.0,9485979.0,10662187.0,11732832.0,12713132.0,13686539.0,14775636.0,15678255.0,16769466.0,17578766.0,18668854.0,19380352.0,20704674.0,21826828.0,22895883.0,23912441.0,24389877.0,25094718.0,26731678.0,27925574.0,28929232.0,30086890.0,31134752.0,32228606.0,33100803.0,33959602.0,35113877.0,36264727.0,37369174.0,38180461.0,39283418.0,40038629.0,41134841.0,42238151.0,43138747.0,43969893.0,45138390.0,46074006.0,47574662.0,51911726.0,50671362.0,50265757.0,48825172.0,50220442.0,51846084.0,52107184.0,54364355.0,55725096.0,54959777.0,56507796.0,57809268.0,57150033.0,59145496.0,60153915.0,61162558.0,61861115.0,63481526.0,63935768.0,66398512.0,67510402.0,67481631.0,69489239.0,70637957.0,71623143.0,72595907.0,73503955.0,74461359.0,72558000.0,74888292.0,75582974.0,77065549.0,77327161.0,78678466.0,79765119.0,80226076.0,81061697.0,82554576.0,87411524.0,91533805.0,87488803.0,87442585.0,88185668.0,87766634.0,89132543.0,90035691.0,89968953.0,93712004.0,95112285.0,96318855.0,94983974.0,97664635.0,98201279.0]}
```
--------------------------------------------------------------------------------
/benchmarks/avoid-abi-encode-packed/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[69.0,138.0,207.0,276.0,345.0,414.0,483.0,552.0,621.0,690.0,759.0,828.0,897.0,966.0,1035.0,1104.0,1173.0,1242.0,1311.0,1380.0,1449.0,1518.0,1587.0,1656.0,1725.0,1794.0,1863.0,1932.0,2001.0,2070.0,2139.0,2208.0,2277.0,2346.0,2415.0,2484.0,2553.0,2622.0,2691.0,2760.0,2829.0,2898.0,2967.0,3036.0,3105.0,3174.0,3243.0,3312.0,3381.0,3450.0,3519.0,3588.0,3657.0,3726.0,3795.0,3864.0,3933.0,4002.0,4071.0,4140.0,4209.0,4278.0,4347.0,4416.0,4485.0,4554.0,4623.0,4692.0,4761.0,4830.0,4899.0,4968.0,5037.0,5106.0,5175.0,5244.0,5313.0,5382.0,5451.0,5520.0,5589.0,5658.0,5727.0,5796.0,5865.0,5934.0,6003.0,6072.0,6141.0,6210.0,6279.0,6348.0,6417.0,6486.0,6555.0,6624.0,6693.0,6762.0,6831.0,6900.0],"times":[1084378.0,2032039.0,3694575.0,4167388.0,5028346.0,5994926.0,7135730.0,7689896.0,12543816.0,9485979.0,10662187.0,11732832.0,12713132.0,13686539.0,14775636.0,15678255.0,16769466.0,17578766.0,18668854.0,19380352.0,20704674.0,21826828.0,22895883.0,23912441.0,24389877.0,25094718.0,26731678.0,27925574.0,28929232.0,30086890.0,31134752.0,32228606.0,33100803.0,33959602.0,35113877.0,36264727.0,37369174.0,38180461.0,39283418.0,40038629.0,41134841.0,42238151.0,43138747.0,43969893.0,45138390.0,46074006.0,47574662.0,51911726.0,50671362.0,50265757.0,48825172.0,50220442.0,51846084.0,52107184.0,54364355.0,55725096.0,54959777.0,56507796.0,57809268.0,57150033.0,59145496.0,60153915.0,61162558.0,61861115.0,63481526.0,63935768.0,66398512.0,67510402.0,67481631.0,69489239.0,70637957.0,71623143.0,72595907.0,73503955.0,74461359.0,72558000.0,74888292.0,75582974.0,77065549.0,77327161.0,78678466.0,79765119.0,80226076.0,81061697.0,82554576.0,87411524.0,91533805.0,87488803.0,87442585.0,88185668.0,87766634.0,89132543.0,90035691.0,89968953.0,93712004.0,95112285.0,96318855.0,94983974.0,97664635.0,98201279.0]}
```
--------------------------------------------------------------------------------
/benchmarks/centralization-risk/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[78.0,156.0,234.0,312.0,390.0,468.0,546.0,624.0,702.0,780.0,858.0,936.0,1014.0,1092.0,1170.0,1248.0,1326.0,1404.0,1482.0,1560.0,1638.0,1716.0,1794.0,1872.0,1950.0,2028.0,2106.0,2184.0,2262.0,2340.0,2418.0,2496.0,2574.0,2652.0,2730.0,2808.0,2886.0,2964.0,3042.0,3120.0,3198.0,3276.0,3354.0,3432.0,3510.0,3588.0,3666.0,3744.0,3822.0,3900.0,3978.0,4056.0,4134.0,4212.0,4290.0,4368.0,4446.0,4524.0,4602.0,4680.0,4758.0,4836.0,4914.0,4992.0,5070.0,5148.0,5226.0,5304.0,5382.0,5460.0,5538.0,5616.0,5694.0,5772.0,5850.0,5928.0,6006.0,6084.0,6162.0,6240.0,6318.0,6396.0,6474.0,6552.0,6630.0,6708.0,6786.0,6864.0,6942.0,7020.0,7098.0,7176.0,7254.0,7332.0,7410.0,7488.0,7566.0,7644.0,7722.0,7800.0],"times":[987055.0,2093861.0,2937619.0,3808127.0,4956181.0,6055950.0,6872682.0,7721892.0,8704057.0,9410808.0,11464734.0,12922383.0,12665349.0,13213119.0,14339480.0,14880369.0,16474944.0,16807275.0,18291717.0,18472924.0,19539450.0,20542319.0,21679577.0,23165032.0,24401838.0,25290057.0,26280944.0,27104561.0,27805016.0,29763263.0,31348525.0,35568935.0,34741515.0,34769500.0,33198529.0,33359769.0,34486437.0,35926461.0,37165649.0,36950351.0,37477991.0,39672574.0,43242288.0,46399734.0,41445801.0,43086913.0,45221995.0,45739283.0,57081842.0,58958000.0,49085825.0,49961845.0,50784920.0,52040308.0,53171710.0,55493511.0,55024148.0,56039385.0,57334770.0,57751704.0,60500632.0,59522244.0,60143584.0,64446976.0,75452508.0,65682613.0,64019245.0,63825358.0,63619073.0,64995774.0,67069981.0,69488575.0,70599246.0,71358306.0,72313495.0,71915161.0,72241195.0,71712852.0,74412353.0,75415507.0,79996139.0,83074779.0,83819318.0,84496021.0,86466493.0,82864954.0,82623038.0,81589749.0,84102738.0,84489430.0,84887958.0,85218632.0,91951625.0,94914921.0,97304200.0,93474904.0,90235290.0,93990606.0,95548745.0,96489954.0]}
```
--------------------------------------------------------------------------------
/benchmarks/centralization-risk/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[78.0,156.0,234.0,312.0,390.0,468.0,546.0,624.0,702.0,780.0,858.0,936.0,1014.0,1092.0,1170.0,1248.0,1326.0,1404.0,1482.0,1560.0,1638.0,1716.0,1794.0,1872.0,1950.0,2028.0,2106.0,2184.0,2262.0,2340.0,2418.0,2496.0,2574.0,2652.0,2730.0,2808.0,2886.0,2964.0,3042.0,3120.0,3198.0,3276.0,3354.0,3432.0,3510.0,3588.0,3666.0,3744.0,3822.0,3900.0,3978.0,4056.0,4134.0,4212.0,4290.0,4368.0,4446.0,4524.0,4602.0,4680.0,4758.0,4836.0,4914.0,4992.0,5070.0,5148.0,5226.0,5304.0,5382.0,5460.0,5538.0,5616.0,5694.0,5772.0,5850.0,5928.0,6006.0,6084.0,6162.0,6240.0,6318.0,6396.0,6474.0,6552.0,6630.0,6708.0,6786.0,6864.0,6942.0,7020.0,7098.0,7176.0,7254.0,7332.0,7410.0,7488.0,7566.0,7644.0,7722.0,7800.0],"times":[987055.0,2093861.0,2937619.0,3808127.0,4956181.0,6055950.0,6872682.0,7721892.0,8704057.0,9410808.0,11464734.0,12922383.0,12665349.0,13213119.0,14339480.0,14880369.0,16474944.0,16807275.0,18291717.0,18472924.0,19539450.0,20542319.0,21679577.0,23165032.0,24401838.0,25290057.0,26280944.0,27104561.0,27805016.0,29763263.0,31348525.0,35568935.0,34741515.0,34769500.0,33198529.0,33359769.0,34486437.0,35926461.0,37165649.0,36950351.0,37477991.0,39672574.0,43242288.0,46399734.0,41445801.0,43086913.0,45221995.0,45739283.0,57081842.0,58958000.0,49085825.0,49961845.0,50784920.0,52040308.0,53171710.0,55493511.0,55024148.0,56039385.0,57334770.0,57751704.0,60500632.0,59522244.0,60143584.0,64446976.0,75452508.0,65682613.0,64019245.0,63825358.0,63619073.0,64995774.0,67069981.0,69488575.0,70599246.0,71358306.0,72313495.0,71915161.0,72241195.0,71712852.0,74412353.0,75415507.0,79996139.0,83074779.0,83819318.0,84496021.0,86466493.0,82864954.0,82623038.0,81589749.0,84102738.0,84489430.0,84887958.0,85218632.0,91951625.0,94914921.0,97304200.0,93474904.0,90235290.0,93990606.0,95548745.0,96489954.0]}
```
--------------------------------------------------------------------------------
/benchmarks/delegate-call-in-loop/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[81.0,162.0,243.0,324.0,405.0,486.0,567.0,648.0,729.0,810.0,891.0,972.0,1053.0,1134.0,1215.0,1296.0,1377.0,1458.0,1539.0,1620.0,1701.0,1782.0,1863.0,1944.0,2025.0,2106.0,2187.0,2268.0,2349.0,2430.0,2511.0,2592.0,2673.0,2754.0,2835.0,2916.0,2997.0,3078.0,3159.0,3240.0,3321.0,3402.0,3483.0,3564.0,3645.0,3726.0,3807.0,3888.0,3969.0,4050.0,4131.0,4212.0,4293.0,4374.0,4455.0,4536.0,4617.0,4698.0,4779.0,4860.0,4941.0,5022.0,5103.0,5184.0,5265.0,5346.0,5427.0,5508.0,5589.0,5670.0,5751.0,5832.0,5913.0,5994.0,6075.0,6156.0,6237.0,6318.0,6399.0,6480.0,6561.0,6642.0,6723.0,6804.0,6885.0,6966.0,7047.0,7128.0,7209.0,7290.0,7371.0,7452.0,7533.0,7614.0,7695.0,7776.0,7857.0,7938.0,8019.0,8100.0],"times":[1020768.0,2642230.0,2889233.0,3593105.0,4830174.0,5416648.0,6714019.0,7193325.0,8098053.0,9120656.0,9740612.0,10791630.0,11626654.0,12881773.0,14200909.0,15555966.0,16393434.0,19243333.0,18603790.0,20774496.0,19130540.0,20617074.0,21040471.0,21220515.0,22255267.0,23391487.0,24550882.0,25096607.0,26402965.0,28033173.0,28989210.0,29055646.0,30372636.0,31401847.0,32167316.0,33212597.0,34144492.0,35086367.0,35966056.0,37066675.0,37892736.0,38724086.0,39630160.0,40553309.0,43578054.0,42176907.0,42689625.0,43963409.0,45091835.0,46197204.0,47457494.0,46258496.0,46677261.0,47876674.0,48614770.0,52108626.0,51091086.0,52500558.0,53814379.0,55152656.0,56187671.0,56851415.0,58002204.0,58808334.0,60564034.0,58976723.0,60441055.0,61757482.0,62666497.0,63484270.0,63049373.0,63815135.0,66864661.0,66898326.0,67850190.0,68847747.0,71010410.0,72684515.0,78366275.0,75103099.0,73954713.0,74405633.0,74043898.0,76780800.0,77799980.0,79658578.0,81505885.0,80303902.0,81953960.0,82799929.0,83802480.0,84541479.0,85228406.0,83657186.0,85122804.0,87744970.0,89254125.0,91274121.0,90040754.0,91405716.0]}
```
--------------------------------------------------------------------------------
/benchmarks/delegate-call-in-loop/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[81.0,162.0,243.0,324.0,405.0,486.0,567.0,648.0,729.0,810.0,891.0,972.0,1053.0,1134.0,1215.0,1296.0,1377.0,1458.0,1539.0,1620.0,1701.0,1782.0,1863.0,1944.0,2025.0,2106.0,2187.0,2268.0,2349.0,2430.0,2511.0,2592.0,2673.0,2754.0,2835.0,2916.0,2997.0,3078.0,3159.0,3240.0,3321.0,3402.0,3483.0,3564.0,3645.0,3726.0,3807.0,3888.0,3969.0,4050.0,4131.0,4212.0,4293.0,4374.0,4455.0,4536.0,4617.0,4698.0,4779.0,4860.0,4941.0,5022.0,5103.0,5184.0,5265.0,5346.0,5427.0,5508.0,5589.0,5670.0,5751.0,5832.0,5913.0,5994.0,6075.0,6156.0,6237.0,6318.0,6399.0,6480.0,6561.0,6642.0,6723.0,6804.0,6885.0,6966.0,7047.0,7128.0,7209.0,7290.0,7371.0,7452.0,7533.0,7614.0,7695.0,7776.0,7857.0,7938.0,8019.0,8100.0],"times":[1020768.0,2642230.0,2889233.0,3593105.0,4830174.0,5416648.0,6714019.0,7193325.0,8098053.0,9120656.0,9740612.0,10791630.0,11626654.0,12881773.0,14200909.0,15555966.0,16393434.0,19243333.0,18603790.0,20774496.0,19130540.0,20617074.0,21040471.0,21220515.0,22255267.0,23391487.0,24550882.0,25096607.0,26402965.0,28033173.0,28989210.0,29055646.0,30372636.0,31401847.0,32167316.0,33212597.0,34144492.0,35086367.0,35966056.0,37066675.0,37892736.0,38724086.0,39630160.0,40553309.0,43578054.0,42176907.0,42689625.0,43963409.0,45091835.0,46197204.0,47457494.0,46258496.0,46677261.0,47876674.0,48614770.0,52108626.0,51091086.0,52500558.0,53814379.0,55152656.0,56187671.0,56851415.0,58002204.0,58808334.0,60564034.0,58976723.0,60441055.0,61757482.0,62666497.0,63484270.0,63049373.0,63815135.0,66864661.0,66898326.0,67850190.0,68847747.0,71010410.0,72684515.0,78366275.0,75103099.0,73954713.0,74405633.0,74043898.0,76780800.0,77799980.0,79658578.0,81505885.0,80303902.0,81953960.0,82799929.0,83802480.0,84541479.0,85228406.0,83657186.0,85122804.0,87744970.0,89254125.0,91274121.0,90040754.0,91405716.0]}
```
--------------------------------------------------------------------------------
/tests/ast/string.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[9]},"id":10,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":9,"linearizedBaseContracts":[9],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":7,"nodeType":"Block","src":"33:36:1","statements":[{"assignments":[4],"declarations":[{"constant":false,"id":4,"mutability":"mutable","name":"x","nameLocation":"49:1:1","nodeType":"VariableDeclaration","scope":7,"src":"35:15:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":3,"name":"string","nodeType":"ElementaryTypeName","src":"35:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"id":6,"initialValue":{"hexValue":"48656c6c6f20576f726c64","id":5,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"53:13:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_592fa743889fc7f92ac2a37bb1f5ba1daf2a5c84741ca0e0061d243a2e6707ba","typeString":"literal_string \"Hello World\""},"value":"Hello World"},"nodeType":"VariableDeclarationStatement","src":"35:31:1"}]},"functionSelector":"26121ff0","id":8,"implemented":true,"kind":"function","modifiers":[],"name":"f","nameLocation":"22:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"23:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"33:0:1"},"scope":9,"src":"13:56:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":10,"src":"0:71:1","usedErrors":[]}],"src":"0:72:1"}
```
--------------------------------------------------------------------------------
/aderyn_core/tests/common/sibling.rs:
--------------------------------------------------------------------------------
```rust
use std::{collections::BTreeMap, error::Error};
use aderyn_core::{
ast::NodeID,
capture,
context::{
browser::{
GetImmediateChildren, GetNextSibling, GetPreviousSibling, SortNodeReferencesToSequence,
},
workspace::WorkspaceContext,
},
detect::detector::{IssueDetector, IssueDetectorNamePool, IssueSeverity},
};
use eyre::Result;
#[derive(Default)]
pub struct SiblingDemonstrator {
// Keys are: [0] source file name, [1] line number, [2] character location of node.
// Do not add items manually, use `capture!` to add nodes to this BTreeMap.
found_instances: BTreeMap<(String, usize, String), NodeID>,
}
impl IssueDetector for SiblingDemonstrator {
fn detect(&mut self, context: &WorkspaceContext) -> Result<bool, Box<dyn Error>> {
for contract in context.contract_definitions() {
if let Some(children) = contract.children(context)
&& let Some(sorted) = children.sort_by_src_position(context)
{
assert!(sorted.len() >= 2);
assert!(sorted[1].previous_sibling(context).unwrap() == sorted[0]);
assert!(sorted[0].next_sibling(context).unwrap() == sorted[1]);
capture!(self, context, sorted[1]);
}
}
Ok(!self.found_instances.is_empty())
}
fn severity(&self) -> IssueSeverity {
IssueSeverity::High
}
fn title(&self) -> String {
String::from("Sibling Demonstration")
}
fn description(&self) -> String {
String::from("Sibling Demonstration")
}
fn instances(&self) -> BTreeMap<(String, usize, String), NodeID> {
self.found_instances.clone()
}
fn name(&self) -> String {
format!("{}", IssueDetectorNamePool::CentralizationRisk)
}
}
```
--------------------------------------------------------------------------------
/tests/ast/unicode.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[9]},"id":10,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":9,"linearizedBaseContracts":[9],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":7,"nodeType":"Block","src":"33:42:1","statements":[{"assignments":[4],"declarations":[{"constant":false,"id":4,"mutability":"mutable","name":"x","nameLocation":"49:1:1","nodeType":"VariableDeclaration","scope":7,"src":"35:15:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":3,"name":"string","nodeType":"ElementaryTypeName","src":"35:6:1","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"id":6,"initialValue":{"hexValue":"48656c6c6f20f09f9883","id":5,"isConstant":false,"isLValue":false,"isPure":true,"kind":"unicodeString","lValueRequested":false,"nodeType":"Literal","src":"53:19:1","typeDescriptions":{"typeIdentifier":"t_stringliteral_cd7a99177cebb3d14b8cc54e313dbf76867c71cd6fbb9a33ce3870dc80e9992b","typeString":"literal_string hex\"48656c6c6f20f09f9883\""},"value":"Hello 😃"},"nodeType":"VariableDeclarationStatement","src":"35:37:1"}]},"functionSelector":"26121ff0","id":8,"implemented":true,"kind":"function","modifiers":[],"name":"f","nameLocation":"22:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"23:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"33:0:1"},"scope":9,"src":"13:62:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":10,"src":"0:77:1","usedErrors":[]}],"src":"0:78:1"}
```
--------------------------------------------------------------------------------
/tests/ast/short_type_name_ref.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"c":[12]},"id":13,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"c","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":12,"linearizedBaseContracts":[12],"name":"c","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":10,"nodeType":"Block","src":"33:25:1","statements":[{"assignments":[8],"declarations":[{"constant":false,"id":8,"mutability":"mutable","name":"rows","nameLocation":"51:4:1","nodeType":"VariableDeclaration","scope":10,"src":"35:20:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr","typeString":"uint256[][]"},"typeName":{"baseType":{"baseType":{"id":5,"name":"uint","nodeType":"ElementaryTypeName","src":"35:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":6,"nodeType":"ArrayTypeName","src":"35:6:1","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$dyn_storage_ptr","typeString":"uint256[]"}},"id":7,"nodeType":"ArrayTypeName","src":"35:8:1","typeDescriptions":{"typeIdentifier":"t_array$_t_array$_t_uint256_$dyn_storage_$dyn_storage_ptr","typeString":"uint256[][]"}},"visibility":"internal"}],"id":9,"nodeType":"VariableDeclarationStatement","src":"35:20:1"}]},"functionSelector":"26121ff0","id":11,"implemented":true,"kind":"function","modifiers":[],"name":"f","nameLocation":"22:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"23:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"33:0:1"},"scope":12,"src":"13:45:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":13,"src":"0:60:1","usedErrors":[]}],"src":"0:61:1"}
```
--------------------------------------------------------------------------------
/tests/ast/loop.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[6]},"id":7,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":6,"linearizedBaseContracts":[6],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":4,"nodeType":"Block","src":"42:74:1","statements":[{"AST":{"nodeType":"YulBlock","src":"61:49:1","statements":[{"body":{"nodeType":"YulBlock","src":"90:18:1","statements":[{"nodeType":"YulBreak","src":"92:5:1"},{"nodeType":"YulContinue","src":"98:8:1"}]},"condition":{"kind":"number","nodeType":"YulLiteral","src":"70:1:1","type":"","value":"1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"72:17:1","statements":[{"expression":{"arguments":[{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"84:1:1","type":"","value":"0"}],"functionName":{"name":"sload","nodeType":"YulIdentifier","src":"78:5:1"},"nodeType":"YulFunctionCall","src":"78:8:1"}],"functionName":{"name":"pop","nodeType":"YulIdentifier","src":"74:3:1"},"nodeType":"YulFunctionCall","src":"74:13:1"},"nodeType":"YulExpressionStatement","src":"74:13:1"}]},"pre":{"nodeType":"YulBlock","src":"67:2:1","statements":[]},"src":"63:45:1"}]},"evmVersion":"london","externalReferences":[],"id":3,"nodeType":"InlineAssembly","src":"52:58:1"}]},"functionSelector":"e2179b8e","id":5,"implemented":true,"kind":"function","modifiers":[],"name":"g","nameLocation":"26:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"27:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"42:0:1"},"scope":6,"src":"17:99:1","stateMutability":"view","virtual":false,"visibility":"public"}],"scope":7,"src":"0:118:1","usedErrors":[]}],"src":"0:119:1"}
```
--------------------------------------------------------------------------------
/tests/ast/var_access.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[9]},"id":10,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":9,"linearizedBaseContracts":[9],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":7,"nodeType":"Block","src":"42:51:1","statements":[{"assignments":[4],"declarations":[{"constant":false,"id":4,"mutability":"mutable","name":"x","nameLocation":"57:1:1","nodeType":"VariableDeclaration","scope":7,"src":"52:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":3,"name":"uint","nodeType":"ElementaryTypeName","src":"52:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":5,"nodeType":"VariableDeclarationStatement","src":"52:6:1"},{"AST":{"nodeType":"YulBlock","src":"77:10:1","statements":[{"nodeType":"YulAssignment","src":"79:6:1","value":{"kind":"number","nodeType":"YulLiteral","src":"84:1:1","type":"","value":"7"},"variableNames":[{"name":"x","nodeType":"YulIdentifier","src":"79:1:1"}]}]},"evmVersion":"london","externalReferences":[{"declaration":4,"isOffset":false,"isSlot":false,"src":"79:1:1","valueSize":1}],"id":6,"nodeType":"InlineAssembly","src":"68:19:1"}]},"functionSelector":"26121ff0","id":8,"implemented":true,"kind":"function","modifiers":[],"name":"f","nameLocation":"26:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"27:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"42:0:1"},"scope":9,"src":"17:76:1","stateMutability":"pure","virtual":false,"visibility":"public"}],"scope":10,"src":"0:95:1","usedErrors":[]}],"src":"0:96:1"}
```
--------------------------------------------------------------------------------
/aderyn_core/src/ast/impls/disp/types.rs:
--------------------------------------------------------------------------------
```rust
use crate::ast::*;
use std::fmt::Display;
impl Display for TypeName {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TypeName::ElementaryTypeName(elementary_type_name) => elementary_type_name.fmt(f),
TypeName::UserDefinedTypeName(user_defined_type_name) => user_defined_type_name.fmt(f),
TypeName::ArrayTypeName(array_type_name) => array_type_name.fmt(f),
TypeName::Mapping(mapping) => mapping.fmt(f),
TypeName::Raw(string) => string.fmt(f),
_ => unimplemented!(),
}
}
}
impl Display for ElementaryTypeName {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.name.as_str())?;
if let Some(state_mutability) = self.state_mutability
&& state_mutability != StateMutability::NonPayable
{
f.write_fmt(format_args!(" {state_mutability}"))?;
}
Ok(())
}
}
impl Display for UserDefinedTypeName {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(path_node) = self.path_node.as_ref() {
f.write_fmt(format_args!("{path_node}"))
} else {
f.write_fmt(format_args!("{}", self.name.as_deref().unwrap_or("")))
}
}
}
impl Display for ArrayTypeName {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!("{}", self.base_type))?;
f.write_str("[")?;
if let Some(length) = self.length.as_ref() {
f.write_fmt(format_args!("{length}"))?;
}
f.write_str("]")
}
}
impl Display for Mapping {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!("mapping({} => {})", self.key_type, self.value_type))
}
}
```
--------------------------------------------------------------------------------
/benchmarks/ecrecover/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[196.0,392.0,588.0,784.0,980.0,1176.0,1372.0,1568.0,1764.0,1960.0,2156.0,2352.0,2548.0,2744.0,2940.0,3136.0,3332.0,3528.0,3724.0,3920.0,4116.0,4312.0,4508.0,4704.0,4900.0,5096.0,5292.0,5488.0,5684.0,5880.0,6076.0,6272.0,6468.0,6664.0,6860.0,7056.0,7252.0,7448.0,7644.0,7840.0,8036.0,8232.0,8428.0,8624.0,8820.0,9016.0,9212.0,9408.0,9604.0,9800.0,9996.0,10192.0,10388.0,10584.0,10780.0,10976.0,11172.0,11368.0,11564.0,11760.0,11956.0,12152.0,12348.0,12544.0,12740.0,12936.0,13132.0,13328.0,13524.0,13720.0,13916.0,14112.0,14308.0,14504.0,14700.0,14896.0,15092.0,15288.0,15484.0,15680.0,15876.0,16072.0,16268.0,16464.0,16660.0,16856.0,17052.0,17248.0,17444.0,17640.0,17836.0,18032.0,18228.0,18424.0,18620.0,18816.0,19012.0,19208.0,19404.0,19600.0],"times":[965823.0,1923636.0,3654335.0,3971633.0,4862187.0,5831083.0,7166431.0,7298507.0,8663246.0,9524429.0,10704844.0,11588694.0,12533494.0,13475184.0,14369003.0,15007931.0,15862014.0,17062009.0,17987696.0,18844638.0,20035179.0,21050521.0,22029871.0,22950291.0,23945739.0,24887002.0,25821748.0,26728340.0,27931858.0,27923831.0,29646204.0,30665202.0,31093513.0,32145642.0,33842974.0,36137962.0,34849654.0,36056140.0,36521017.0,36884227.0,39388046.0,40998857.0,42187180.0,43527315.0,46813211.0,49896281.0,50281805.0,51055901.0,51801733.0,56402222.0,51053778.0,51998039.0,52654217.0,53479425.0,54153620.0,56322039.0,57726825.0,59638869.0,60658449.0,61624604.0,60707845.0,62693191.0,63863093.0,63997253.0,65611924.0,66538580.0,67661341.0,68574493.0,69953256.0,70399964.0,119679349.0,68713189.0,74510852.0,72920546.0,74655489.0,77338020.0,81484810.0,80582622.0,79992020.0,80146074.0,81661450.0,78689999.0,82245555.0,83328823.0,85756953.0,85907651.0,87177165.0,88525775.0,89301553.0,87729205.0,92398157.0,99749810.0,218113082.0,97901158.0,93848388.0,94935089.0,102275549.0,110374249.0,106070988.0,100299809.0]}
```
--------------------------------------------------------------------------------
/benchmarks/ecrecover/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[196.0,392.0,588.0,784.0,980.0,1176.0,1372.0,1568.0,1764.0,1960.0,2156.0,2352.0,2548.0,2744.0,2940.0,3136.0,3332.0,3528.0,3724.0,3920.0,4116.0,4312.0,4508.0,4704.0,4900.0,5096.0,5292.0,5488.0,5684.0,5880.0,6076.0,6272.0,6468.0,6664.0,6860.0,7056.0,7252.0,7448.0,7644.0,7840.0,8036.0,8232.0,8428.0,8624.0,8820.0,9016.0,9212.0,9408.0,9604.0,9800.0,9996.0,10192.0,10388.0,10584.0,10780.0,10976.0,11172.0,11368.0,11564.0,11760.0,11956.0,12152.0,12348.0,12544.0,12740.0,12936.0,13132.0,13328.0,13524.0,13720.0,13916.0,14112.0,14308.0,14504.0,14700.0,14896.0,15092.0,15288.0,15484.0,15680.0,15876.0,16072.0,16268.0,16464.0,16660.0,16856.0,17052.0,17248.0,17444.0,17640.0,17836.0,18032.0,18228.0,18424.0,18620.0,18816.0,19012.0,19208.0,19404.0,19600.0],"times":[965823.0,1923636.0,3654335.0,3971633.0,4862187.0,5831083.0,7166431.0,7298507.0,8663246.0,9524429.0,10704844.0,11588694.0,12533494.0,13475184.0,14369003.0,15007931.0,15862014.0,17062009.0,17987696.0,18844638.0,20035179.0,21050521.0,22029871.0,22950291.0,23945739.0,24887002.0,25821748.0,26728340.0,27931858.0,27923831.0,29646204.0,30665202.0,31093513.0,32145642.0,33842974.0,36137962.0,34849654.0,36056140.0,36521017.0,36884227.0,39388046.0,40998857.0,42187180.0,43527315.0,46813211.0,49896281.0,50281805.0,51055901.0,51801733.0,56402222.0,51053778.0,51998039.0,52654217.0,53479425.0,54153620.0,56322039.0,57726825.0,59638869.0,60658449.0,61624604.0,60707845.0,62693191.0,63863093.0,63997253.0,65611924.0,66538580.0,67661341.0,68574493.0,69953256.0,70399964.0,119679349.0,68713189.0,74510852.0,72920546.0,74655489.0,77338020.0,81484810.0,80582622.0,79992020.0,80146074.0,81661450.0,78689999.0,82245555.0,83328823.0,85756953.0,85907651.0,87177165.0,88525775.0,89301553.0,87729205.0,92398157.0,99749810.0,218113082.0,97901158.0,93848388.0,94935089.0,102275549.0,110374249.0,106070988.0,100299809.0]}
```
--------------------------------------------------------------------------------
/aderyn_core/src/context/flow/visualizer.rs:
--------------------------------------------------------------------------------
```rust
#[cfg(test)]
pub mod control_flow_tests {
use std::{collections::HashMap, fmt::Debug, path::Path, process::Command};
use crate::context::{flow::Cfg, workspace::WorkspaceContext};
use petgraph::{dot::Dot, prelude::Graph};
struct CustomString {
string: String,
}
impl Debug for CustomString {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "{}", self.string)
}
}
impl From<String> for CustomString {
fn from(value: String) -> Self {
Self { string: value }
}
}
pub fn output_graph(context: &WorkspaceContext, cfg: &Cfg, output: &str) {
let dot_file_path = format!("../tests/contract-playground/dot/{}.dot", output);
let svg_file_path = format!("../tests/contract-playground/dot/{}.svg", output);
let mut graph: Graph<CustomString, CustomString> = Graph::new();
let mut node_indices = HashMap::new();
for (node, value) in cfg.nodes.clone() {
let node_index = graph.add_node(value.nd.display(context).into());
node_indices.insert(node, node_index);
}
for (from, to_list) in &cfg.adj_list {
let f = node_indices.get(from).unwrap();
for to in to_list {
let t = node_indices.get(to).unwrap();
graph.add_edge(*f, *t, format!(" {}-->{}", from.peek(), to.peek()).into());
}
}
let dot = Dot::new(&graph);
_ = std::fs::write(Path::new(&dot_file_path), format!("{:?}", dot));
let mut cmd = Command::new("dot");
cmd.args(["-Tsvg", &dot_file_path]);
if let Ok(raw_output) = cmd.output()
&& let Ok(output_svg) = String::from_utf8(raw_output.stdout)
{
_ = std::fs::write(Path::new(&svg_file_path), output_svg);
}
}
}
```
--------------------------------------------------------------------------------
/aderyn_core/src/context/browser/peek_under.rs:
--------------------------------------------------------------------------------
```rust
use crate::{
ast::NodeID,
context::{browser::GetNextSibling, workspace::WorkspaceContext},
visitor::ast_visitor::{ASTConstVisitor, Node},
};
pub trait PeekUnder {
/// Peek for text outside the node and just above until previous sibling is reached
fn peek_under(&self, context: &WorkspaceContext) -> Option<String>;
}
#[derive(Default)]
struct NodeIDReceiver {
id: Option<NodeID>,
}
impl ASTConstVisitor for NodeIDReceiver {
fn visit_node_id(&mut self, node_id: Option<NodeID>) -> eyre::Result<()> {
self.id = node_id;
Ok(())
}
}
impl<T: Node + ?Sized> PeekUnder for T {
fn peek_under(&self, context: &WorkspaceContext) -> Option<String> {
// Setup a Node ID receiver
let mut node_id_receiver = NodeIDReceiver::default();
// Find the ID of the node this method is called upon
self.accept_id(&mut node_id_receiver).ok()?;
let current_node_id = node_id_receiver.id?;
let source_unit =
context.get_source_unit_from_child_node(context.nodes.get(¤t_node_id)?)?;
let content = source_unit.source.as_ref()?;
let (curr_offset, curr_len) = context.get_offset_and_length_of_node(current_node_id)?;
if let Some(next_sibling) = self.next_sibling(context) {
let (next_offset, _) = context.get_offset_and_length_of_node(next_sibling.id()?)?;
if curr_offset + curr_len < next_offset && next_offset < content.len() {
let required_content = &content[curr_offset + curr_len..next_offset];
return Some(required_content.to_string());
} else {
return None;
}
}
// If there is no next sibling we must content til the bottom of the file
let required_content = &content[curr_offset + curr_len..];
Some(required_content.to_string())
}
}
```
--------------------------------------------------------------------------------
/cli/reportgen.sh:
--------------------------------------------------------------------------------
```bash
#!/bin/bash
#### MARKDOWN REPORTS ######
# Basic report.md
cargo run -- -i src/ -x lib/ ./tests/contract-playground -o ./reports/report.md --skip-update-check &
# Adhoc sol files report.md
cargo run -- ./tests/adhoc-sol-files -o ./reports/adhoc-sol-files-report.md --skip-update-check &
# Aderyn.toml with nested root
cargo run -- ./tests/2024-05-Sablier -o ./reports/sablier-aderyn-toml-nested-root.md --skip-update-check &
# nft-report.md (Handle remappings)
cd tests/foundry-nft-f23 && forge install && cd ../.. &&
cargo run -- ./tests/foundry-nft-f23 -i src/ -x lib/ -o ./reports/nft-report.md --skip-update-check &
# ccip-functions-report.md (Handle remappings)
cargo run -- tests/ccip-contracts/contracts --src src/v0.8/functions/ -x "tests/,test/,mocks/" -o ./reports/ccip-functions-report.md &
# Extract src, scope and exclude from foundry profile in case of foundry project
FOUNDRY_PROFILE=uniswap cargo run tests/contract-playground/ -o ./reports/uniswap_profile.md &
# PRB Math (uses new solidity features)
cargo run -- tests/prb-math -o reports/prb-math-report.md --skip-update-check &
# TempleGold
cargo run -- tests/2024-07-templegold/protocol -o reports/templegold-report.md --skip-update-check &
cargo run -- tests/hardhat-js-playground -o reports/hardhat-playground-report.md --skip-update-check &
cargo run -- ./tests/foundry-nft-f23-icm -o ./reports/nft-report-icm.md --skip-update-check &
##### JSON REPORTS ########
# Basic report.json
cargo run -- -i src/ -x lib/ -o ./reports/report.json ./tests/contract-playground --skip-update-check &
# Adhoc sol files Highs only JSON report
cargo run -- ./tests/adhoc-sol-files -o ./reports/adhoc-sol-files-highs-only-report.json --skip-update-check --highs-only &
##### SARIF REPORTS ########
# Basic report.sarif
cargo run -- ./tests/contract-playground -o ./reports/report.sarif --skip-update-check &
wait
```
--------------------------------------------------------------------------------
/benchmarks/non-reentrant-before-others/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[280.0,560.0,840.0,1120.0,1400.0,1680.0,1960.0,2240.0,2520.0,2800.0,3080.0,3360.0,3640.0,3920.0,4200.0,4480.0,4760.0,5040.0,5320.0,5600.0,5880.0,6160.0,6440.0,6720.0,7000.0,7280.0,7560.0,7840.0,8120.0,8400.0,8680.0,8960.0,9240.0,9520.0,9800.0,10080.0,10360.0,10640.0,10920.0,11200.0,11480.0,11760.0,12040.0,12320.0,12600.0,12880.0,13160.0,13440.0,13720.0,14000.0,14280.0,14560.0,14840.0,15120.0,15400.0,15680.0,15960.0,16240.0,16520.0,16800.0,17080.0,17360.0,17640.0,17920.0,18200.0,18480.0,18760.0,19040.0,19320.0,19600.0,19880.0,20160.0,20440.0,20720.0,21000.0,21280.0,21560.0,21840.0,22120.0,22400.0,22680.0,22960.0,23240.0,23520.0,23800.0,24080.0,24360.0,24640.0,24920.0,25200.0,25480.0,25760.0,26040.0,26320.0,26600.0,26880.0,27160.0,27440.0,27720.0,28000.0],"times":[992448.0,1993724.0,3468342.0,4068648.0,5058810.0,6025398.0,7144451.0,7970411.0,8946879.0,9978087.0,10899445.0,11821586.0,12845673.0,13814965.0,14797816.0,15786528.0,16767623.0,17626822.0,18189134.0,19146111.0,20141704.0,21072560.0,22008522.0,22974795.0,23932135.0,24874800.0,25836572.0,26831926.0,27781449.0,28757982.0,29728215.0,30594609.0,31483069.0,32837845.0,33533220.0,34562466.0,35511599.0,35484401.0,36482063.0,37279442.0,38278599.0,39212921.0,40252955.0,41281345.0,42214760.0,42997012.0,43865567.0,44846477.0,45610824.0,46533256.0,47520730.0,48372950.0,49428205.0,50331484.0,51284090.0,51970821.0,53477078.0,54022599.0,54967053.0,55897022.0,56846464.0,57837644.0,58981513.0,58005788.0,58947567.0,60026727.0,61023062.0,61754293.0,62522852.0,63404235.0,64451853.0,65318374.0,66260633.0,67496800.0,68055483.0,68912603.0,69853490.0,70423322.0,71002720.0,71171570.0,72180804.0,72822744.0,73757593.0,74591398.0,75450994.0,76434970.0,77287596.0,78734287.0,79081920.0,79413062.0,80748503.0,81542201.0,82432608.0,83441995.0,84439378.0,85667682.0,85802616.0,86770949.0,87825918.0,103000615.0]}
```
--------------------------------------------------------------------------------
/benchmarks/non-reentrant-before-others/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[280.0,560.0,840.0,1120.0,1400.0,1680.0,1960.0,2240.0,2520.0,2800.0,3080.0,3360.0,3640.0,3920.0,4200.0,4480.0,4760.0,5040.0,5320.0,5600.0,5880.0,6160.0,6440.0,6720.0,7000.0,7280.0,7560.0,7840.0,8120.0,8400.0,8680.0,8960.0,9240.0,9520.0,9800.0,10080.0,10360.0,10640.0,10920.0,11200.0,11480.0,11760.0,12040.0,12320.0,12600.0,12880.0,13160.0,13440.0,13720.0,14000.0,14280.0,14560.0,14840.0,15120.0,15400.0,15680.0,15960.0,16240.0,16520.0,16800.0,17080.0,17360.0,17640.0,17920.0,18200.0,18480.0,18760.0,19040.0,19320.0,19600.0,19880.0,20160.0,20440.0,20720.0,21000.0,21280.0,21560.0,21840.0,22120.0,22400.0,22680.0,22960.0,23240.0,23520.0,23800.0,24080.0,24360.0,24640.0,24920.0,25200.0,25480.0,25760.0,26040.0,26320.0,26600.0,26880.0,27160.0,27440.0,27720.0,28000.0],"times":[992448.0,1993724.0,3468342.0,4068648.0,5058810.0,6025398.0,7144451.0,7970411.0,8946879.0,9978087.0,10899445.0,11821586.0,12845673.0,13814965.0,14797816.0,15786528.0,16767623.0,17626822.0,18189134.0,19146111.0,20141704.0,21072560.0,22008522.0,22974795.0,23932135.0,24874800.0,25836572.0,26831926.0,27781449.0,28757982.0,29728215.0,30594609.0,31483069.0,32837845.0,33533220.0,34562466.0,35511599.0,35484401.0,36482063.0,37279442.0,38278599.0,39212921.0,40252955.0,41281345.0,42214760.0,42997012.0,43865567.0,44846477.0,45610824.0,46533256.0,47520730.0,48372950.0,49428205.0,50331484.0,51284090.0,51970821.0,53477078.0,54022599.0,54967053.0,55897022.0,56846464.0,57837644.0,58981513.0,58005788.0,58947567.0,60026727.0,61023062.0,61754293.0,62522852.0,63404235.0,64451853.0,65318374.0,66260633.0,67496800.0,68055483.0,68912603.0,69853490.0,70423322.0,71002720.0,71171570.0,72180804.0,72822744.0,73757593.0,74591398.0,75450994.0,76434970.0,77287596.0,78734287.0,79081920.0,79413062.0,80748503.0,81542201.0,82432608.0,83441995.0,84439378.0,85667682.0,85802616.0,86770949.0,87825918.0,103000615.0]}
```
--------------------------------------------------------------------------------
/benchmarks/solmate-safe-transfer-lib/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[292.0,584.0,876.0,1168.0,1460.0,1752.0,2044.0,2336.0,2628.0,2920.0,3212.0,3504.0,3796.0,4088.0,4380.0,4672.0,4964.0,5256.0,5548.0,5840.0,6132.0,6424.0,6716.0,7008.0,7300.0,7592.0,7884.0,8176.0,8468.0,8760.0,9052.0,9344.0,9636.0,9928.0,10220.0,10512.0,10804.0,11096.0,11388.0,11680.0,11972.0,12264.0,12556.0,12848.0,13140.0,13432.0,13724.0,14016.0,14308.0,14600.0,14892.0,15184.0,15476.0,15768.0,16060.0,16352.0,16644.0,16936.0,17228.0,17520.0,17812.0,18104.0,18396.0,18688.0,18980.0,19272.0,19564.0,19856.0,20148.0,20440.0,20732.0,21024.0,21316.0,21608.0,21900.0,22192.0,22484.0,22776.0,23068.0,23360.0,23652.0,23944.0,24236.0,24528.0,24820.0,25112.0,25404.0,25696.0,25988.0,26280.0,26572.0,26864.0,27156.0,27448.0,27740.0,28032.0,28324.0,28616.0,28908.0,29200.0],"times":[997990.0,1965424.0,3467476.0,3914259.0,5013435.0,5849950.0,8941973.0,7953753.0,9139220.0,9267038.0,10351067.0,11506127.0,12466142.0,13432426.0,14554931.0,15615660.0,16465445.0,17574089.0,18281793.0,18806230.0,19954265.0,21117146.0,22342220.0,22412672.0,23543893.0,24830363.0,25502455.0,27406565.0,28531027.0,29834957.0,30803633.0,31911239.0,32681347.0,32736833.0,33084270.0,34494054.0,35838690.0,36034730.0,36615032.0,38544982.0,39650221.0,40810132.0,41741539.0,42672424.0,43744598.0,45042155.0,46377222.0,51629388.0,50213970.0,49856984.0,50843605.0,51223715.0,52119621.0,53104051.0,53377859.0,52798383.0,55488493.0,55455731.0,56405636.0,57280836.0,59130757.0,60302233.0,59718696.0,61358849.0,62098602.0,61635688.0,64719827.0,66091778.0,64895764.0,66002658.0,68735962.0,69681083.0,69527911.0,71146396.0,72526931.0,73547197.0,75907799.0,88131329.0,77797867.0,78074754.0,79322501.0,78949231.0,78396257.0,81027112.0,82590019.0,83499411.0,82420211.0,84005987.0,84576718.0,86282774.0,88489197.0,88551298.0,90946855.0,89759611.0,89851763.0,93681091.0,95236719.0,96721425.0,93288848.0,93752315.0]}
```
--------------------------------------------------------------------------------
/benchmarks/solmate-safe-transfer-lib/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[292.0,584.0,876.0,1168.0,1460.0,1752.0,2044.0,2336.0,2628.0,2920.0,3212.0,3504.0,3796.0,4088.0,4380.0,4672.0,4964.0,5256.0,5548.0,5840.0,6132.0,6424.0,6716.0,7008.0,7300.0,7592.0,7884.0,8176.0,8468.0,8760.0,9052.0,9344.0,9636.0,9928.0,10220.0,10512.0,10804.0,11096.0,11388.0,11680.0,11972.0,12264.0,12556.0,12848.0,13140.0,13432.0,13724.0,14016.0,14308.0,14600.0,14892.0,15184.0,15476.0,15768.0,16060.0,16352.0,16644.0,16936.0,17228.0,17520.0,17812.0,18104.0,18396.0,18688.0,18980.0,19272.0,19564.0,19856.0,20148.0,20440.0,20732.0,21024.0,21316.0,21608.0,21900.0,22192.0,22484.0,22776.0,23068.0,23360.0,23652.0,23944.0,24236.0,24528.0,24820.0,25112.0,25404.0,25696.0,25988.0,26280.0,26572.0,26864.0,27156.0,27448.0,27740.0,28032.0,28324.0,28616.0,28908.0,29200.0],"times":[997990.0,1965424.0,3467476.0,3914259.0,5013435.0,5849950.0,8941973.0,7953753.0,9139220.0,9267038.0,10351067.0,11506127.0,12466142.0,13432426.0,14554931.0,15615660.0,16465445.0,17574089.0,18281793.0,18806230.0,19954265.0,21117146.0,22342220.0,22412672.0,23543893.0,24830363.0,25502455.0,27406565.0,28531027.0,29834957.0,30803633.0,31911239.0,32681347.0,32736833.0,33084270.0,34494054.0,35838690.0,36034730.0,36615032.0,38544982.0,39650221.0,40810132.0,41741539.0,42672424.0,43744598.0,45042155.0,46377222.0,51629388.0,50213970.0,49856984.0,50843605.0,51223715.0,52119621.0,53104051.0,53377859.0,52798383.0,55488493.0,55455731.0,56405636.0,57280836.0,59130757.0,60302233.0,59718696.0,61358849.0,62098602.0,61635688.0,64719827.0,66091778.0,64895764.0,66002658.0,68735962.0,69681083.0,69527911.0,71146396.0,72526931.0,73547197.0,75907799.0,88131329.0,77797867.0,78074754.0,79322501.0,78949231.0,78396257.0,81027112.0,82590019.0,83499411.0,82420211.0,84005987.0,84576718.0,86282774.0,88489197.0,88551298.0,90946855.0,89759611.0,89851763.0,93681091.0,95236719.0,96721425.0,93288848.0,93752315.0]}
```
--------------------------------------------------------------------------------
/aderyn_core/src/stats.rs:
--------------------------------------------------------------------------------
```rust
use crate::context::workspace::WorkspaceContext;
use cloc::count_code_lines;
use ignore::get_lines_to_ignore;
use rayon::prelude::*;
use std::{
collections::HashMap,
path::{Path, PathBuf},
str::FromStr,
};
use token::tokenize;
pub mod cloc;
pub mod ignore;
pub mod token;
pub mod util;
#[derive(Debug)]
pub struct Stats {
pub code: usize,
pub ignore_lines: Vec<IgnoreLine>,
}
#[derive(Debug, Clone)]
pub enum When {
Always,
ForDetectorsWithNames(Vec<String>),
}
#[derive(Debug, Clone)]
pub struct IgnoreLine {
/// When to consider this ignore
pub when: When,
/// Which line number to ignore
pub which: usize,
}
pub fn collect_stats(
root: &Path,
skip_cloc: bool,
context: &WorkspaceContext,
) -> HashMap<String, Stats> {
context
.source_units()
.par_iter()
.map(|source_unit| {
let path = source_unit.absolute_path.clone().expect("absolute path not inserted");
let path = path.replace("//", "/"); // Condense entries that look like `contracts/templegold//AuctionBase.sol`
if !context.included.contains(&PathBuf::from_str(&path).unwrap()) {
return None;
}
let content = source_unit.source.as_ref().expect("source not filled");
let stats = get_stats(content, skip_cloc);
let full_path = root.join(&path).to_string_lossy().to_string();
Some((full_path, stats))
})
.flatten()
.collect()
}
pub fn get_stats(r_content: &str, skip_cloc: bool) -> Stats {
if r_content.is_empty() {
return Stats { code: 0, ignore_lines: vec![] };
}
let token_descriptors = tokenize(r_content);
let code_lines = if skip_cloc { 0 } else { count_code_lines(&token_descriptors) };
let ignore_lines = get_lines_to_ignore(&token_descriptors);
Stats { code: code_lines, ignore_lines }
}
```
--------------------------------------------------------------------------------
/benchmarks/hello_world/base/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[486.0,972.0,1458.0,1944.0,2430.0,2916.0,3402.0,3888.0,4374.0,4860.0,5346.0,5832.0,6318.0,6804.0,7290.0,7776.0,8262.0,8748.0,9234.0,9720.0,10206.0,10692.0,11178.0,11664.0,12150.0,12636.0,13122.0,13608.0,14094.0,14580.0,15066.0,15552.0,16038.0,16524.0,17010.0,17496.0,17982.0,18468.0,18954.0,19440.0,19926.0,20412.0,20898.0,21384.0,21870.0,22356.0,22842.0,23328.0,23814.0,24300.0,24786.0,25272.0,25758.0,26244.0,26730.0,27216.0,27702.0,28188.0,28674.0,29160.0,29646.0,30132.0,30618.0,31104.0,31590.0,32076.0,32562.0,33048.0,33534.0,34020.0,34506.0,34992.0,35478.0,35964.0,36450.0,36936.0,37422.0,37908.0,38394.0,38880.0,39366.0,39852.0,40338.0,40824.0,41310.0,41796.0,42282.0,42768.0,43254.0,43740.0,44226.0,44712.0,45198.0,45684.0,46170.0,46656.0,47142.0,47628.0,48114.0,48600.0],"times":[788180.0,1691293.0,2999922.0,3158559.0,4751140.0,6364066.0,6025609.0,8795520.0,8531404.0,10440194.0,9299148.0,14278618.0,13037953.0,13186902.0,15164235.0,15837606.0,15758954.0,18526200.0,19907184.0,19464387.0,19517016.0,21309115.0,22391452.0,23778345.0,24497595.0,23118104.0,25348868.0,26683758.0,25608432.0,27254969.0,27123967.0,29825806.0,30221264.0,33536345.0,31892332.0,32469207.0,34945202.0,35775520.0,35629185.0,37370253.0,38136944.0,39305474.0,38830647.0,40012586.0,45815123.0,43455003.0,43518502.0,42622537.0,48902888.0,49138823.0,51249688.0,52570579.0,56016659.0,52727713.0,51796975.0,51692763.0,50992881.0,59851418.0,57665927.0,63542608.0,62652184.0,61793470.0,65560086.0,62260559.0,65534485.0,67709819.0,70808706.0,70004323.0,69616481.0,70749161.0,71658287.0,71946262.0,72391728.0,75792637.0,77826668.0,77204830.0,79340007.0,78435508.0,80847248.0,81817995.0,79781103.0,83751134.0,83998488.0,86061395.0,88695449.0,86021681.0,87807690.0,88040736.0,89118278.0,92632230.0,94122146.0,93160938.0,93297812.0,96588751.0,94820452.0,98630408.0,99426410.0,99895278.0,101846214.0,101516657.0]}
```
--------------------------------------------------------------------------------
/benchmarks/hello_world/new/sample.json:
--------------------------------------------------------------------------------
```json
{"sampling_mode":"Linear","iters":[486.0,972.0,1458.0,1944.0,2430.0,2916.0,3402.0,3888.0,4374.0,4860.0,5346.0,5832.0,6318.0,6804.0,7290.0,7776.0,8262.0,8748.0,9234.0,9720.0,10206.0,10692.0,11178.0,11664.0,12150.0,12636.0,13122.0,13608.0,14094.0,14580.0,15066.0,15552.0,16038.0,16524.0,17010.0,17496.0,17982.0,18468.0,18954.0,19440.0,19926.0,20412.0,20898.0,21384.0,21870.0,22356.0,22842.0,23328.0,23814.0,24300.0,24786.0,25272.0,25758.0,26244.0,26730.0,27216.0,27702.0,28188.0,28674.0,29160.0,29646.0,30132.0,30618.0,31104.0,31590.0,32076.0,32562.0,33048.0,33534.0,34020.0,34506.0,34992.0,35478.0,35964.0,36450.0,36936.0,37422.0,37908.0,38394.0,38880.0,39366.0,39852.0,40338.0,40824.0,41310.0,41796.0,42282.0,42768.0,43254.0,43740.0,44226.0,44712.0,45198.0,45684.0,46170.0,46656.0,47142.0,47628.0,48114.0,48600.0],"times":[788180.0,1691293.0,2999922.0,3158559.0,4751140.0,6364066.0,6025609.0,8795520.0,8531404.0,10440194.0,9299148.0,14278618.0,13037953.0,13186902.0,15164235.0,15837606.0,15758954.0,18526200.0,19907184.0,19464387.0,19517016.0,21309115.0,22391452.0,23778345.0,24497595.0,23118104.0,25348868.0,26683758.0,25608432.0,27254969.0,27123967.0,29825806.0,30221264.0,33536345.0,31892332.0,32469207.0,34945202.0,35775520.0,35629185.0,37370253.0,38136944.0,39305474.0,38830647.0,40012586.0,45815123.0,43455003.0,43518502.0,42622537.0,48902888.0,49138823.0,51249688.0,52570579.0,56016659.0,52727713.0,51796975.0,51692763.0,50992881.0,59851418.0,57665927.0,63542608.0,62652184.0,61793470.0,65560086.0,62260559.0,65534485.0,67709819.0,70808706.0,70004323.0,69616481.0,70749161.0,71658287.0,71946262.0,72391728.0,75792637.0,77826668.0,77204830.0,79340007.0,78435508.0,80847248.0,81817995.0,79781103.0,83751134.0,83998488.0,86061395.0,88695449.0,86021681.0,87807690.0,88040736.0,89118278.0,92632230.0,94122146.0,93160938.0,93297812.0,96588751.0,94820452.0,98630408.0,99426410.0,99895278.0,101846214.0,101516657.0]}
```
--------------------------------------------------------------------------------
/tests/ast/call.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[6]},"id":7,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":6,"linearizedBaseContracts":[6],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":4,"nodeType":"Block","src":"37:59:1","statements":[{"AST":{"nodeType":"YulBlock","src":"56:34:1","statements":[{"expression":{"arguments":[{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"67:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"70:1:1","type":"","value":"1"},{"kind":"number","nodeType":"YulLiteral","src":"73:1:1","type":"","value":"2"},{"kind":"number","nodeType":"YulLiteral","src":"76:1:1","type":"","value":"3"},{"kind":"number","nodeType":"YulLiteral","src":"79:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"82:1:1","type":"","value":"5"},{"kind":"number","nodeType":"YulLiteral","src":"85:1:1","type":"","value":"6"}],"functionName":{"name":"call","nodeType":"YulIdentifier","src":"62:4:1"},"nodeType":"YulFunctionCall","src":"62:25:1"}],"functionName":{"name":"pop","nodeType":"YulIdentifier","src":"58:3:1"},"nodeType":"YulFunctionCall","src":"58:30:1"},"nodeType":"YulExpressionStatement","src":"58:30:1"}]},"evmVersion":"london","externalReferences":[],"id":3,"nodeType":"InlineAssembly","src":"47:43:1"}]},"functionSelector":"b582ec5f","id":5,"implemented":true,"kind":"function","modifiers":[],"name":"j","nameLocation":"26:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"27:2:1"},"returnParameters":{"id":2,"nodeType":"ParameterList","parameters":[],"src":"37:0:1"},"scope":6,"src":"17:79:1","stateMutability":"nonpayable","virtual":false,"visibility":"public"}],"scope":7,"src":"0:98:1","usedErrors":[]}],"src":"0:99:1"}
```
--------------------------------------------------------------------------------
/aderyn_core/src/detect/high/selfdestruct.rs:
--------------------------------------------------------------------------------
```rust
use std::{collections::BTreeMap, error::Error};
use crate::ast::NodeID;
use crate::{
capture,
context::workspace::WorkspaceContext,
detect::detector::{IssueDetector, IssueDetectorNamePool, IssueSeverity},
};
use eyre::Result;
#[derive(Default)]
pub struct SelfdestructDetector {
// Keys are: [0] source file name, [1] line number, [2] character location of node.
// Do not add items manually, use `capture!` to add nodes to this BTreeMap.
found_instances: BTreeMap<(String, usize, String), NodeID>,
}
impl IssueDetector for SelfdestructDetector {
fn detect(&mut self, context: &WorkspaceContext) -> Result<bool, Box<dyn Error>> {
for identifier in context.identifiers() {
if identifier.name == "selfdestruct" {
capture!(self, context, identifier);
}
}
Ok(!self.found_instances.is_empty())
}
fn severity(&self) -> IssueSeverity {
IssueSeverity::High
}
fn title(&self) -> String {
String::from("`selfdestruct` is Deprecated")
}
fn description(&self) -> String {
String::from("Remove the `selfdestruct` instruction from the code.")
}
fn instances(&self) -> BTreeMap<(String, usize, String), NodeID> {
self.found_instances.clone()
}
fn name(&self) -> String {
IssueDetectorNamePool::Selfdestruct.to_string()
}
}
#[cfg(test)]
mod selfdestruct_identifier_tests {
use crate::detect::{detector::IssueDetector, high::SelfdestructDetector};
#[test]
fn test_selfdestruct_identifier_tests() {
let context = crate::detect::test_utils::load_solidity_source_unit(
"../tests/contract-playground/src/UsingSelfdestruct.sol",
);
let mut detector = SelfdestructDetector::default();
let found = detector.detect(&context).unwrap();
assert!(found);
assert_eq!(detector.instances().len(), 1);
}
}
```
--------------------------------------------------------------------------------
/aderyn_core/src/context/capturable.rs:
--------------------------------------------------------------------------------
```rust
use crate::ast::{ContractDefinition, *};
use super::{
macros::generate_capturable_methods,
workspace::{ASTNode, WorkspaceContext},
};
generate_capturable_methods! {
Assignment,
BinaryOperation,
Block,
Conditional,
ContractDefinition,
ElementaryTypeNameExpression,
EnumDefinition,
EnumValue,
EventDefinition,
ExpressionStatement,
ErrorDefinition,
FunctionCall,
FunctionCallOptions,
FunctionDefinition,
ForStatement,
Identifier,
IdentifierPath,
IfStatement,
ImportDirective,
IndexAccess,
IndexRangeAccess,
InheritanceSpecifier,
InlineAssembly,
Literal,
MemberAccess,
NewExpression,
ModifierDefinition,
ModifierInvocation,
OverrideSpecifier,
ParameterList,
PragmaDirective,
Return,
SourceUnit,
StructDefinition,
StructuredDocumentation,
TupleExpression,
UnaryOperation,
UncheckedBlock,
UserDefinedValueTypeDefinition,
UsingForDirective,
VariableDeclaration,
VariableDeclarationStatement,
WhileStatement,
DoWhileStatement,
Break,
Continue,
PlaceholderStatement,
}
impl From<&&ContractDefinition> for Capturable {
fn from(value: &&ContractDefinition) -> Self {
#[allow(suspicious_double_ref_op)]
Self::ContractDefinition(value.clone().clone())
}
}
impl From<&&ModifierInvocation> for Capturable {
fn from(value: &&ModifierInvocation) -> Self {
#[allow(suspicious_double_ref_op)]
Self::ModifierInvocation(value.clone().clone())
}
}
impl From<YulFunctionCall> for Capturable {
fn from(value: YulFunctionCall) -> Self {
Self::YulFunctionCall(value)
}
}
impl From<&YulIdentifier> for Capturable {
fn from(value: &YulIdentifier) -> Self {
Self::YulIdentifier(value.clone())
}
}
impl From<YulLiteral> for Capturable {
fn from(value: YulLiteral) -> Self {
Self::YulLiteral(value)
}
}
```
--------------------------------------------------------------------------------
/aderyn_driver/src/runner.rs:
--------------------------------------------------------------------------------
```rust
use aderyn_core::{context::workspace::WorkspaceContext, detect::detector::IssueDetector};
use std::error::Error;
use crate::{
driver::CliArgsOutputConfig,
interface::{OutputInterface, lsp::LspReport, output_interface_router, tables},
process::WorkspaceContextWrapper,
};
use aderyn_core::report::*;
pub fn run_detector_mode(
cx_wrapper: &WorkspaceContextWrapper,
detectors: Vec<Box<dyn IssueDetector>>,
output_config: &CliArgsOutputConfig,
) -> Result<(), Box<dyn Error>> {
println!("Running {} detectors", detectors.len());
let detectors_used =
&detectors.iter().map(|d| (d.name(), d.severity().to_string())).collect::<Vec<_>>();
let report = detect_issues(&cx_wrapper.contexts, &cx_wrapper.root_path, detectors)?;
let output_file_path = output_config.output.clone();
let output_interface = if output_file_path.ends_with(".json") {
OutputInterface::Json
} else if output_file_path.ends_with(".sarif") {
OutputInterface::Sarif
} else if output_file_path.ends_with(".md") {
OutputInterface::Markdown
} else {
println!("Warning: Output file extension is unrecognized. Reverting to markdown..");
OutputInterface::default()
};
output_interface_router(output_interface, &report, cx_wrapper, detectors_used, output_config)?;
Ok(())
}
pub fn run_lsp_mode(
ctx_wrapper: &WorkspaceContextWrapper,
detectors: Vec<Box<dyn IssueDetector>>,
) -> Option<LspReport> {
let (root_rel_path, contexts) = (&ctx_wrapper.root_path, &ctx_wrapper.contexts);
match detect_issues(contexts, root_rel_path, detectors) {
Ok(report) => {
let (high_issues, low_issues) = report.detailed_issues(contexts);
Some(LspReport::from(low_issues, high_issues, root_rel_path))
}
Err(_) => None,
}
}
pub fn run_auditor_mode(contexts: &[WorkspaceContext]) -> Result<(), Box<dyn Error>> {
tables::print_audit_info_tables(contexts)
}
```
--------------------------------------------------------------------------------
/aderyn_driver/src/interface/mod.rs:
--------------------------------------------------------------------------------
```rust
pub mod json;
pub mod lsp;
pub mod markdown;
pub mod sarif;
pub mod tables;
pub mod util;
use std::{
fs::{File, remove_file},
io::{self, Result, Write},
path::Path,
};
use aderyn_core::report::Report;
use crate::{driver::CliArgsOutputConfig, process::WorkspaceContextWrapper};
#[derive(Default)]
pub enum OutputInterface {
Json,
#[default]
Markdown,
Sarif,
}
pub fn output_interface_router(
output_interface: OutputInterface,
report: &Report,
cx_wrapper: &WorkspaceContextWrapper,
detectors_used: &[(String, String)],
output_config: &CliArgsOutputConfig,
) -> Result<()> {
let get_writer = |filename: &str| -> io::Result<File> {
let file_path = Path::new(filename);
if let Some(parent_dir) = file_path.parent() {
std::fs::create_dir_all(parent_dir)?;
}
if Path::new(filename).exists() {
remove_file(filename)?; // If file exists, delete it
}
File::create(filename)
};
println!("Detectors run, printing report.");
let mut b: Box<dyn Write> = if output_config.stdout {
Box::new(io::stdout())
} else {
Box::new(get_writer(&output_config.output)?)
};
match output_interface {
OutputInterface::Json => {
json::print_report(
&mut b,
report,
&cx_wrapper.contexts,
output_config.stdout,
detectors_used,
)?;
}
OutputInterface::Markdown => {
markdown::print_report(
&mut b,
report,
cx_wrapper,
output_config.output.clone(),
output_config.no_snippets,
)?;
}
OutputInterface::Sarif => {
sarif::print_report(&mut b, report, output_config.stdout)?;
}
}
if !output_config.stdout {
println!("Report printed to {}", output_config.output);
}
Ok(())
}
```
--------------------------------------------------------------------------------
/aderyn_core/src/context/browser/peek_over.rs:
--------------------------------------------------------------------------------
```rust
use crate::{
ast::NodeID,
context::{browser::GetPreviousSibling, workspace::WorkspaceContext},
visitor::ast_visitor::{ASTConstVisitor, Node},
};
pub trait PeekOver {
/// Peek for text outside the node and just above until previous sibling is reached
fn peek_over(&self, context: &WorkspaceContext) -> Option<String>;
}
#[derive(Default)]
struct NodeIDReceiver {
id: Option<NodeID>,
}
impl ASTConstVisitor for NodeIDReceiver {
fn visit_node_id(&mut self, node_id: Option<NodeID>) -> eyre::Result<()> {
self.id = node_id;
Ok(())
}
}
impl<T: Node + ?Sized> PeekOver for T {
fn peek_over(&self, context: &WorkspaceContext) -> Option<String> {
// Setup a Node ID receiver
let mut node_id_receiver = NodeIDReceiver::default();
// Find the ID of the node this method is called upon
self.accept_id(&mut node_id_receiver).ok()?;
let current_node_id = node_id_receiver.id?;
let source_unit =
context.get_source_unit_from_child_node(context.nodes.get(¤t_node_id)?)?;
let content = source_unit.source.as_ref()?;
let (curr_offset, _) = context.get_offset_and_length_of_node(current_node_id)?;
if let Some(previous_sibling) = self.previous_sibling(context) {
let (prev_offset, prev_len) =
context.get_offset_and_length_of_node(previous_sibling.id()?)?;
if prev_offset + prev_len < curr_offset && curr_offset < content.len() {
let required_content = &content[prev_offset + prev_len..curr_offset];
return Some(required_content.to_string());
} else {
return None;
}
}
// If there is no previous sibling we must return content from the top of the file
if curr_offset < content.len() {
let required_content = &content[0..curr_offset];
return Some(required_content.to_string());
}
None
}
}
```
--------------------------------------------------------------------------------
/tests/ast/enum_value_declaration.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"A":[3],"f":[13]},"id":14,"nodeType":"SourceUnit","nodes":[{"canonicalName":"A","id":3,"members":[{"id":1,"name":"X","nameLocation":"9:1:1","nodeType":"EnumValue","src":"9:1:1"},{"id":2,"name":"Y","nameLocation":"12:1:1","nodeType":"EnumValue","src":"12:1:1"}],"name":"A","nameLocation":"5:1:1","nodeType":"EnumDefinition","src":"0:15:1"},{"body":{"id":12,"nodeType":"Block","src":"46:15:1","statements":[{"expression":{"expression":{"id":9,"name":"A","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":3,"src":"55:1:1","typeDescriptions":{"typeIdentifier":"t_type$_t_enum$_A_$3_$","typeString":"type(enum A)"}},"id":10,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"memberLocation":"57:1:1","memberName":"X","nodeType":"MemberAccess","referencedDeclaration":1,"src":"55:3:1","typeDescriptions":{"typeIdentifier":"t_enum$_A_$3","typeString":"enum A"}},"functionReturnParameters":8,"id":11,"nodeType":"Return","src":"48:10:1"}]},"id":13,"implemented":true,"kind":"freeFunction","modifiers":[],"name":"f","nameLocation":"25:1:1","nodeType":"FunctionDefinition","parameters":{"id":4,"nodeType":"ParameterList","parameters":[],"src":"26:2:1"},"returnParameters":{"id":8,"nodeType":"ParameterList","parameters":[{"constant":false,"id":7,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":13,"src":"43:1:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_enum$_A_$3","typeString":"enum A"},"typeName":{"id":6,"nodeType":"UserDefinedTypeName","pathNode":{"id":5,"name":"A","nameLocations":["43:1:1"],"nodeType":"IdentifierPath","referencedDeclaration":3,"src":"43:1:1"},"referencedDeclaration":3,"src":"43:1:1","typeDescriptions":{"typeIdentifier":"t_enum$_A_$3","typeString":"enum A"}},"visibility":"internal"}],"src":"42:3:1"},"scope":14,"src":"16:45:1","stateMutability":"pure","virtual":false,"visibility":"internal"}],"src":"0:62:1"}
```
--------------------------------------------------------------------------------
/aderyn_core/src/ast/impls/node/using_for_directives.rs:
--------------------------------------------------------------------------------
```rust
use crate::{ast::*, visitor::ast_visitor::*};
use eyre::Result;
impl Node for UsingForDirective {
fn accept(&self, visitor: &mut impl ASTConstVisitor) -> Result<()> {
if visitor.visit_using_for_directive(self)? {
// TODO there is a deviation. Missing FunctionsOrLibrary
if self.library_name.is_some() {
match self.library_name.as_ref().unwrap() {
UserDefinedTypeNameOrIdentifierPath::UserDefinedTypeName(_) => {}
UserDefinedTypeNameOrIdentifierPath::IdentifierPath(identifier_path) => {
identifier_path.accept(visitor)?;
}
};
}
if self.type_name.is_some() {
self.type_name.as_ref().unwrap().accept(visitor)?;
}
if let Some(function_list) = &self.function_list {
for func_item in function_list {
match func_item {
UsingForFunctionItem::Function(function) => {
function.function.accept(visitor)?;
}
UsingForFunctionItem::OverloadedOperator(overloaded_operator) => {
overloaded_operator.definition.accept(visitor)?;
}
}
}
}
self.accept_metadata(visitor)?;
}
visitor.end_visit_using_for_directive(self)
}
fn accept_metadata(&self, visitor: &mut impl ASTConstVisitor) -> Result<()> {
if self.library_name.is_some() {
match self.library_name.as_ref().unwrap() {
UserDefinedTypeNameOrIdentifierPath::UserDefinedTypeName(_) => {}
UserDefinedTypeNameOrIdentifierPath::IdentifierPath(identifier_path) => {
visitor.visit_immediate_children(self.id, vec![identifier_path.id])?;
}
};
}
Ok(())
}
macros::accept_id!();
}
```
--------------------------------------------------------------------------------
/tests/ast/nested_functions.json:
--------------------------------------------------------------------------------
```json
{"absolutePath":"a","exportedSymbols":{"C":[8]},"id":9,"nodeType":"SourceUnit","nodes":[{"abstract":false,"baseContracts":[],"canonicalName":"C","contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":8,"linearizedBaseContracts":[8],"name":"C","nameLocation":"9:1:1","nodeType":"ContractDefinition","nodes":[{"body":{"id":6,"nodeType":"Block","src":"57:95:1","statements":[{"AST":{"nodeType":"YulBlock","src":"72:76:1","statements":[{"body":{"nodeType":"YulBlock","src":"94:35:1","statements":[{"body":{"nodeType":"YulBlock","src":"118:3:1","statements":[]},"name":"f2","nodeType":"YulFunctionDefinition","src":"104:17:1"}]},"name":"f1","nodeType":"YulFunctionDefinition","src":"80:49:1"},{"nodeType":"YulAssignment","src":"136:6:1","value":{"kind":"number","nodeType":"YulLiteral","src":"141:1:1","type":"","value":"2"},"variableNames":[{"name":"x","nodeType":"YulIdentifier","src":"136:1:1"}]}]},"evmVersion":"london","externalReferences":[{"declaration":3,"isOffset":false,"isSlot":false,"src":"136:1:1","valueSize":1}],"id":5,"nodeType":"InlineAssembly","src":"63:85:1"}]},"functionSelector":"26121ff0","id":7,"implemented":true,"kind":"function","modifiers":[],"name":"f","nameLocation":"24:1:1","nodeType":"FunctionDefinition","parameters":{"id":1,"nodeType":"ParameterList","parameters":[],"src":"25:2:1"},"returnParameters":{"id":4,"nodeType":"ParameterList","parameters":[{"constant":false,"id":3,"mutability":"mutable","name":"x","nameLocation":"54:1:1","nodeType":"VariableDeclaration","scope":7,"src":"49:6:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint","nodeType":"ElementaryTypeName","src":"49:4:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"48:8:1"},"scope":8,"src":"15:137:1","stateMutability":"pure","virtual":false,"visibility":"public"}],"scope":9,"src":"0:154:1","usedErrors":[]}],"src":"0:155:1"}
```
--------------------------------------------------------------------------------
/aderyn_core/src/detect/high/yul_return.rs:
--------------------------------------------------------------------------------
```rust
use std::{collections::BTreeMap, error::Error};
use crate::ast::NodeID;
use crate::{
capture,
context::workspace::WorkspaceContext,
detect::detector::{IssueDetector, IssueDetectorNamePool, IssueSeverity},
};
use eyre::Result;
#[derive(Default)]
pub struct YulReturnDetector {
// Keys are: [0] source file name, [1] line number, [2] character location of node.
// Do not add items manually, use `capture!` to add nodes to this BTreeMap.
found_instances: BTreeMap<(String, usize, String), NodeID>,
}
impl IssueDetector for YulReturnDetector {
fn detect(&mut self, context: &WorkspaceContext) -> Result<bool, Box<dyn Error>> {
for function_call in context.yul_function_calls() {
if function_call.function_name.name == "return" {
capture!(self, context, function_call);
}
}
Ok(!self.found_instances.is_empty())
}
fn severity(&self) -> IssueSeverity {
IssueSeverity::High
}
fn title(&self) -> String {
String::from("Yul block contains `return`")
}
fn description(&self) -> String {
String::from(
"This causes the transaction execution to halt, and nothing after that call will execute including code following the assembly block.",
)
}
fn instances(&self) -> BTreeMap<(String, usize, String), NodeID> {
self.found_instances.clone()
}
fn name(&self) -> String {
IssueDetectorNamePool::YulReturn.to_string()
}
}
#[cfg(test)]
mod yul_return_detector_tests {
use crate::detect::{detector::IssueDetector, high::yul_return::YulReturnDetector};
#[test]
fn test_yul_return() {
let context = crate::detect::test_utils::load_solidity_source_unit(
"../tests/contract-playground/src/YulReturn.sol",
);
let mut detector = YulReturnDetector::default();
let found = detector.detect(&context).unwrap();
assert!(found);
assert_eq!(detector.instances().len(), 1);
}
}
```
--------------------------------------------------------------------------------
/bacon.toml:
--------------------------------------------------------------------------------
```toml
# This is a configuration file for the bacon tool
#
# Complete help on configuration: https://dystroy.org/bacon/config/
#
# You may check the current default at
# https://github.com/Canop/bacon/blob/main/defaults/default-bacon.toml
default_job = "clippy-display-warnings"
env.CARGO_TERM_COLOR = "always"
# Background jobs
# Lints
[jobs.clippy-display-warnings]
command = ["cargo", "clippy"]
need_stdout = false
[jobs.fmt-display-warnings]
command = ["cargo", "fmt", "--all", "--check"]
need_stdout = false
# Test
[job.test]
command = ["cargo", "test"]
need_stdout = false
# ===
# Non background jobs / ACTIONS
# Run aderyn on all integration tests
[jobs.generate-all-reports]
command = [
"cargo", "prep", "--all", "--parallel"
]
need_stdout = true
need_stderr = true
allow_warnings = true
background = false
on_change_strategy = "kill_then_restart"
# Bless PR
[jobs.blesspr]
command = [
"cargo", "blesspr"
]
need_stdout = true
need_stderr = true
allow_warnings = true
background = false
## Run aderyn on Contract playground
[jobs.contract-playground]
command = [
"cargo", "prep", "--cpg"
# put launch parameters for your program behind a `--` separator
]
need_stdout = true
need_stderr = true
allow_warnings = true
background = false
on_change_strategy = "kill_then_restart"
## Run Tests and report time
[jobs.test-report-time]
command = ["cargo", "test", "--", "-Zunstable-options", "--report-time"]
need_stdout = true
background = false
[jobs.nextest]
command = [
"cargo", "nextest", "run",
"--hide-progress-bar", "--failure-output", "final"
]
need_stdout = true
analyzer = "nextest"
background = false
## Compile Docs and open
[jobs.doc-open]
command = ["cargo", "doc", "--no-deps", "--open"]
need_stdout = false
background = false
on_success = "back" # so that we don't open the browser at each change
[keybindings]
c = "job:clippy-display-warnings"
f = "job:fmt-display-warnings"
r = "job:contract-playground"
alt-t = "job:test-report-time"
t = "job:test"
d = "job:doc-open"
a = "job:generate-all-reports"
alt-b = "job:blesspr"
```
--------------------------------------------------------------------------------
/aderyn_core/src/test_utils.rs:
--------------------------------------------------------------------------------
```rust
mod load_source_unit;
use crate::{
ast::{ContractDefinition, FunctionDefinition, FunctionKind, ModifierDefinition, NodeID},
context::{browser::ExtractVariableDeclarations, workspace::WorkspaceContext},
};
// Using `solc` to read AST given a source unit (i.e Solidity file)
pub use load_source_unit::{
load_multiple_solidity_source_units_into_single_context, load_playground_solidity_source_units,
load_solidity_source_unit,
};
impl WorkspaceContext {
pub fn find_contract_by_name(&self, name: &str) -> &ContractDefinition {
self.contract_definitions().into_iter().find(|c| c.name.as_str() == name).unwrap()
}
pub fn find_free_function_by_name(&self, name: &str) -> &FunctionDefinition {
self.function_definitions()
.iter()
.filter(|func| *func.kind() == FunctionKind::FreeFunction)
.find(|func| func.name == name)
.unwrap()
}
}
impl ContractDefinition {
pub fn find_function_by_name(&self, name: &str) -> &FunctionDefinition {
self.function_definitions().iter().find(|func| func.name == name).unwrap()
}
pub fn find_receive_function(&self) -> &FunctionDefinition {
self.function_definitions()
.iter()
.find(|func| *func.kind() == FunctionKind::Receive)
.unwrap()
}
pub fn find_fallback_function(&self) -> &FunctionDefinition {
self.function_definitions()
.iter()
.find(|func| *func.kind() == FunctionKind::Fallback)
.unwrap()
}
pub fn find_modifier_by_name(&self, name: &str) -> &ModifierDefinition {
self.modifier_definitions().iter().find(|modifier| modifier.name == name).unwrap()
}
pub fn find_state_variable_node_id_by_name(&self, name: &str) -> NodeID {
let variable_declarations = ExtractVariableDeclarations::from(self).extracted;
let variable = variable_declarations
.into_iter()
.filter(|v| v.state_variable && v.name == name)
.collect::<Vec<_>>();
variable.first().unwrap().id
}
}
```