├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── release.yml │ └── test.yml ├── .gitignore ├── .gitmodules ├── .readthedocs.yaml ├── CHANGELOG.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── MAINTAINERS.md ├── README.md ├── RELEASE_CHECKLIST.md ├── SECURITY.md ├── build.rs ├── clippy.toml ├── docs ├── Makefile ├── aqd.rst ├── code_gen_options.rst ├── conf.py ├── contributing.rst ├── examples.rst ├── examples │ ├── abi_encode_call.sol │ ├── abstract_contract.sol │ ├── abstract_contract_inheritance.sol │ ├── array_bounds_check_optimization.sol │ ├── array_type_dynamic.sol │ ├── array_type_dynamic_push.sol │ ├── array_type_dynamic_storage.sol │ ├── array_type_fixed_length.sol │ ├── array_type_initialized.sol │ ├── array_type_references.sol │ ├── assert.sol │ ├── base_contract_function_call.sol │ ├── common_subexpression_elimination.sol │ ├── contract_inheritance.sol │ ├── contract_multiple_inheritance.sol │ ├── contract_recursive_inheritance.sol │ ├── contract_storage.sol │ ├── contract_storage_accessor.sol │ ├── contract_storage_accessor_override.sol │ ├── contract_storage_clear.sol │ ├── contract_storage_immutable.sol │ ├── contract_type_cast_address.sol │ ├── dead_storage_elimination.sol │ ├── dynamic_bytes_type.sol │ ├── enum_type.sol │ ├── enum_type_external.sol │ ├── event_positional_fields.sol │ ├── events.sol │ ├── expression_unchecked.sol │ ├── function_arguments.sol │ ├── function_destructing_arguments.sol │ ├── function_modifier_arguments.sol │ ├── function_name_mangling.sol │ ├── function_overloading.sol │ ├── function_type.sol │ ├── functions.sol │ ├── inherited_constructor_arguments.sol │ ├── inherited_constructor_runtime_arguments.sol │ ├── inline_assembly.sol │ ├── inline_assembly_calldata.sol │ ├── inline_assembly_external_functions.sol │ ├── inline_assembly_storage.sol │ ├── library.sol │ ├── library_using_for.sol │ ├── mapping_type.sol │ ├── multiple_contracts.sol │ ├── polkadot │ │ ├── call_chain_extension.sol │ │ ├── call_flags.sol │ │ ├── constructor_named.sol │ │ ├── contract_gas_limit.sol │ │ ├── contract_new.sol │ │ ├── contract_payable.sol │ │ ├── contract_type.sol │ │ ├── expression_this.sol │ │ ├── expression_this_external_call.sol │ │ ├── function_call.sol │ │ ├── function_call_external.sol │ │ ├── function_call_external_gas.sol │ │ ├── function_fallback_and_receive.sol │ │ ├── function_modifier.sol │ │ ├── function_multiple_modifiers.sol │ │ ├── function_override_modifiers.sol │ │ ├── function_selector_override.sol │ │ ├── function_type_callback.sol │ │ ├── hash_type.sol │ │ ├── interface.sol │ │ ├── statement_try_catch_call.sol │ │ ├── statement_try_catch_constructor.sol │ │ └── statement_try_catch_no_error_handling.sol │ ├── print.sol │ ├── require.sol │ ├── retrieve_contract_code.sol │ ├── revert.sol │ ├── scoping.sol │ ├── shadowing.sol │ ├── solana │ │ ├── account_access.sol │ │ ├── accountinfo.sol │ │ ├── bobcat.sol │ │ ├── builtin_create_program_address.sol │ │ ├── builtin_try_find_program_address.sol │ │ ├── call_anchor.sol │ │ ├── constructor_annotations.sol │ │ ├── contract_address.sol │ │ ├── contract_call.sol │ │ ├── contract_new.sol │ │ ├── create_contract_with_metas.sol │ │ ├── expression_this.sol │ │ ├── expression_this_external_call.sol │ │ ├── function_call.sol │ │ ├── function_call_external.sol │ │ ├── function_call_external_accounts.sol │ │ ├── function_call_external_seeds.sol │ │ ├── function_type_callback.sol │ │ ├── payer_annotation.sol │ │ ├── program_id.sol │ │ └── use_authority.sol │ ├── statement_destructing.sol │ ├── statement_destructing_conditional.sol │ ├── statement_destructing_swapping.sol │ ├── statement_do_while.sol │ ├── statement_for.sol │ ├── statement_for_abort.sol │ ├── statement_if.sol │ ├── statement_if_else.sol │ ├── statement_while.sol │ ├── statement_while_break.sol │ ├── storage_ref_type.sol │ ├── strength_reduce.sol │ ├── string_type.sol │ ├── struct_type.sol │ ├── struct_type_arguments.sol │ ├── struct_type_arguments_external.sol │ ├── struct_type_variable_references.sol │ ├── super_contract_function_call.sol │ ├── tags.sol │ ├── type_operator.sol │ ├── unused_variable_elimination.sol │ ├── user.sol │ ├── user_defined_operators.sol │ ├── user_defined_type.sol │ ├── using.sol │ ├── using_global.sol │ ├── using_imports.sol │ ├── vector_to_slice_optimization.sol │ ├── virtual_functions.sol │ └── virtual_functions_override.sol ├── extension-config.png ├── extension-screenshot.png ├── extension.rst ├── hl_solang_horizontal-color.svg ├── index.rst ├── installing.rst ├── language │ ├── builtins.rst │ ├── constants.rst │ ├── contract_storage.rst │ ├── contracts.rst │ ├── events.rst │ ├── expressions.rst │ ├── file_structure.rst │ ├── functions.rst │ ├── imports.rst │ ├── inline_assembly.rst │ ├── interface_libraries.rst │ ├── introduction.rst │ ├── managing_values.rst │ ├── pragmas.rst │ ├── statements.rst │ ├── tags.rst │ ├── types.rst │ └── using.rst ├── make.bat ├── requirements.txt ├── running.rst ├── targets │ ├── polkadot.rst │ └── solana.rst ├── testing.rst └── yul_language │ ├── builtins.rst │ ├── functions.rst │ ├── statements.rst │ ├── types.rst │ └── yul.rst ├── examples ├── example.sol ├── incrementer.sol ├── polkadot │ ├── flipper.sol │ └── polkadot_config.toml └── solana │ ├── flipper.sol │ └── solana_config.toml ├── fmt ├── Cargo.toml ├── README.md ├── src │ ├── buffer.rs │ ├── chunk.rs │ ├── comments.rs │ ├── config.rs │ ├── formatter.rs │ ├── helpers.rs │ ├── inline_config.rs │ ├── lib.rs │ ├── macros.rs │ ├── solang_ext │ │ ├── ast_eq.rs │ │ ├── loc.rs │ │ ├── mod.rs │ │ └── safe_unwrap.rs │ ├── string.rs │ └── visit.rs ├── testdata │ ├── Annotation │ │ ├── fmt.sol │ │ └── original.sol │ ├── ArrayExpressions │ │ ├── fmt.sol │ │ └── original.sol │ ├── BlockComments │ │ ├── fmt.sol │ │ └── original.sol │ ├── BlockCommentsFunction │ │ ├── fmt.sol │ │ └── original.sol │ ├── ConditionalOperatorExpression │ │ ├── fmt.sol │ │ └── original.sol │ ├── ConstructorDefinition │ │ ├── fmt.sol │ │ └── original.sol │ ├── ConstructorModifierStyle │ │ ├── fmt.sol │ │ └── original.sol │ ├── ContractDefinition │ │ ├── bracket-spacing.fmt.sol │ │ ├── contract-new-lines.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── DoWhileStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── DocComments │ │ ├── fmt.sol │ │ ├── original.sol │ │ └── wrap-comments.fmt.sol │ ├── EmitStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── EnumDefinition │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── EnumVariants │ │ ├── fmt.sol │ │ └── original.sol │ ├── ErrorDefinition │ │ ├── fmt.sol │ │ └── original.sol │ ├── EventDefinition │ │ ├── fmt.sol │ │ └── original.sol │ ├── ForStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── FunctionCall │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── FunctionCallArgsStatement │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── FunctionDefinition │ │ ├── all.fmt.sol │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── override-spacing.fmt.sol │ │ └── params-first.fmt.sol │ ├── FunctionDefinitionWithFunctionReturns │ │ ├── fmt.sol │ │ └── original.sol │ ├── FunctionType │ │ ├── fmt.sol │ │ └── original.sol │ ├── HexUnderscore │ │ ├── bytes.fmt.sol │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve.fmt.sol │ │ └── remove.fmt.sol │ ├── IfStatement │ │ ├── block-multi.fmt.sol │ │ ├── block-single.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── IfStatement2 │ │ ├── fmt.sol │ │ └── original.sol │ ├── ImportDirective │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve-quote.fmt.sol │ │ └── single-quote.fmt.sol │ ├── InlineDisable │ │ ├── fmt.sol │ │ └── original.sol │ ├── IntTypes │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve.fmt.sol │ │ └── short.fmt.sol │ ├── LiteralExpression │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve-quote.fmt.sol │ │ └── single-quote.fmt.sol │ ├── MappingType │ │ ├── fmt.sol │ │ └── original.sol │ ├── ModifierDefinition │ │ ├── fmt.sol │ │ ├── original.sol │ │ └── override-spacing.fmt.sol │ ├── NamedFunctionCallExpression │ │ ├── fmt.sol │ │ └── original.sol │ ├── NumberLiteralUnderscore │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve.fmt.sol │ │ ├── remove.fmt.sol │ │ └── thousands.fmt.sol │ ├── OperatorExpressions │ │ ├── fmt.sol │ │ └── original.sol │ ├── PragmaDirective │ │ ├── fmt.sol │ │ └── original.sol │ ├── Repros │ │ ├── fmt.sol │ │ └── original.sol │ ├── ReturnStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── RevertNamedArgsStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── RevertStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── SimpleComments │ │ ├── fmt.sol │ │ ├── original.sol │ │ └── wrap-comments.fmt.sol │ ├── SortedImports │ │ ├── fmt.sol │ │ └── original.sol │ ├── StatementBlock │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── StructDefinition │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── ThisExpression │ │ ├── fmt.sol │ │ └── original.sol │ ├── TrailingComma │ │ ├── fmt.sol │ │ └── original.sol │ ├── TryStatement │ │ ├── fmt.sol │ │ └── original.sol │ ├── TypeDefinition │ │ ├── fmt.sol │ │ └── original.sol │ ├── UnitExpression │ │ ├── fmt.sol │ │ └── original.sol │ ├── UsingDirective │ │ ├── fmt.sol │ │ └── original.sol │ ├── VariableAssignment │ │ ├── bracket-spacing.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── VariableDefinition │ │ ├── fmt.sol │ │ ├── original.sol │ │ └── override-spacing.fmt.sol │ ├── WhileStatement │ │ ├── block-multi.fmt.sol │ │ ├── block-single.fmt.sol │ │ ├── fmt.sol │ │ └── original.sol │ ├── Yul │ │ ├── fmt.sol │ │ └── original.sol │ └── YulStrings │ │ ├── fmt.sol │ │ ├── original.sol │ │ ├── preserve-quote.fmt.sol │ │ └── single-quote.fmt.sol └── tests │ └── formatter.rs ├── integration ├── anchor │ ├── .gitignore │ ├── .prettierignore │ ├── Anchor.toml │ ├── Cargo.toml │ ├── id.json │ ├── package.json │ ├── programs │ │ └── anchor │ │ │ ├── Cargo.toml │ │ │ ├── Xargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── target │ │ └── deploy │ │ │ └── anchor-keypair.json │ ├── tests │ │ ├── anchor.ts │ │ ├── call_anchor.sol │ │ └── call_anchor.spec.ts │ └── tsconfig.json ├── polkadot │ ├── .gitignore │ ├── ConstructorDispatch.sol │ ├── UniswapV2ERC20.sol │ ├── UniswapV2ERC20.spec.ts │ ├── UniswapV2Factory.sol │ ├── UniswapV2Factory.spec.ts │ ├── UniswapV2Pair.sol │ ├── UniswapV2Pair.spec.ts │ ├── UpgradeableProxy.sol │ ├── array_struct_mapping_storage.sol │ ├── array_struct_mapping_storage.spec.ts │ ├── arrays.sol │ ├── arrays.spec.ts │ ├── asserts.sol │ ├── asserts.spec.ts │ ├── balances.sol │ ├── balances.spec.ts │ ├── build.sh │ ├── builtins.sol │ ├── builtins.spec.ts │ ├── builtins2.sol │ ├── builtins2.spec.ts │ ├── call_flags.sol │ ├── call_flags.spec.ts │ ├── caller_is_root.sol │ ├── caller_is_root.spec.ts │ ├── chain_extension.sol │ ├── chain_extension.spec.ts │ ├── constructor_dispatch.spec.ts │ ├── create_contract.sol │ ├── create_contract.spec.ts │ ├── createpair.sol │ ├── debug_buffer_format.sol │ ├── debug_buffer_format.spec.ts │ ├── delegate_call.sol │ ├── delegate_call.spec.ts │ ├── destruct.sol │ ├── destruct.spec.ts │ ├── events.sol │ ├── events.spec.ts │ ├── external_call.sol │ ├── external_call.spec.ts │ ├── flipper.sol │ ├── flipper.spec.ts │ ├── index.ts │ ├── ink │ │ └── caller │ │ │ ├── .gitignore │ │ │ ├── Cargo.toml │ │ │ └── lib.rs │ ├── ink_cross_calls.spec.ts │ ├── inkee.sol │ ├── interfaces │ │ ├── IERC20.sol │ │ ├── IUniswapV2Callee.sol │ │ ├── IUniswapV2ERC20.sol │ │ ├── IUniswapV2Factory.sol │ │ └── IUniswapV2Pair.sol │ ├── is_contract.sol │ ├── is_contract.spec.ts │ ├── issue666.sol │ ├── issue666.spec.ts │ ├── libraries │ │ ├── Math.sol │ │ ├── SafeMath.sol │ │ └── UQ112x112.sol │ ├── mgs_sender.sol │ ├── msg_sender.spec.ts │ ├── msg_sender_event.sol │ ├── overloading.sol │ ├── overloading.spec.ts │ ├── package.json │ ├── primitives.sol │ ├── primitives.spec.ts │ ├── release_version.sol │ ├── release_version.spec.ts │ ├── runtime_errors.sol │ ├── runtime_errors.spec.ts │ ├── set_code_hash.sol │ ├── set_code_hash.spec.ts │ ├── store.sol │ ├── store.spec.ts │ ├── structs.sol │ ├── structs.spec.ts │ ├── test │ │ └── ERC20.sol │ ├── tornado.spec.ts │ ├── tornado │ │ ├── contracts │ │ │ ├── Hasher.sol │ │ │ ├── MerkleTreeWithHistory.sol │ │ │ ├── NativeTornado.sol │ │ │ ├── Tornado.sol │ │ │ └── Verifier.sol │ │ └── tornado.js │ ├── try_catch.sol │ ├── try_catch.spec.ts │ ├── tsconfig.json │ └── upgradeable_proxy.spec.ts ├── solana │ ├── .gitignore │ ├── .mocharc.json │ ├── Child.key │ ├── Creature.key │ ├── MyCreature.key │ ├── Seed1.key │ ├── Seed2.key │ ├── UserStats.key │ ├── UserStats.sol │ ├── account_data.sol │ ├── account_data.spec.ts │ ├── arrays.sol │ ├── balances.sol │ ├── balances.spec.ts │ ├── builtins.sol │ ├── builtins.spec.ts │ ├── calls.spec.ts │ ├── create_contract.sol │ ├── create_contract.spec.ts │ ├── errors.sol │ ├── errors.spec.ts │ ├── events.sol │ ├── events.spec.ts │ ├── external_call.sol │ ├── flipper.sol │ ├── minbalance.sol │ ├── minbalance.spec.ts │ ├── overflow.sol │ ├── overflow.spec.ts │ ├── oznfc.sol │ ├── oznfc.spec.ts │ ├── package.json │ ├── primitives.sol │ ├── runtime_errors.sol │ ├── runtime_errors.spec.ts │ ├── setup.ts │ ├── simple.spec.ts │ ├── simple_collectible.sol │ ├── simple_collectible.spec.ts │ ├── storage.sol │ ├── system_instruction.spec.ts │ ├── system_instruction_example.sol │ ├── token.sol │ ├── token.spec.ts │ ├── tsconfig.json │ ├── user_stats.spec.ts │ ├── verify_sig.sol │ └── verify_sig.spec.ts ├── soroban │ ├── .gitignore │ ├── a.sol │ ├── a_invalid.sol │ ├── auth_framework.spec.js │ ├── b.sol │ ├── c.sol │ ├── callee.sol │ ├── caller.sol │ ├── counter.sol │ ├── counter.spec.js │ ├── cross_contract.spec.js │ ├── package.json │ ├── runtime_error.sol │ ├── runtime_error.spec.js │ ├── rust │ │ ├── Cargo.toml │ │ └── contracts │ │ │ └── hello-world │ │ │ ├── Cargo.toml │ │ │ └── src │ │ │ └── lib.rs │ ├── setup.js │ ├── storage_types.sol │ ├── storage_types.spec.js │ └── test_helpers.js └── subxt-tests │ ├── .gitignore │ ├── Cargo.toml │ ├── README.md │ ├── metadata.scale │ └── src │ ├── cases │ ├── array_struct_mapping_storage.rs │ ├── arrays.rs │ ├── asserts.rs │ ├── balances.rs │ ├── builtins.rs │ ├── builtins2.rs │ ├── create_contract.rs │ ├── destruct.rs │ ├── events.rs │ ├── external_call.rs │ ├── flipper.rs │ ├── issue666.rs │ ├── mod.rs │ ├── msg_sender.rs │ ├── primitives.rs │ ├── randomizer.rs │ ├── store.rs │ ├── structs.rs │ ├── uniswapv2_erc20.rs │ ├── uniswapv2_factory.rs │ └── uniswapv2_pair.rs │ └── lib.rs ├── solana-library ├── minimum_balance.sol ├── spl_token.sol └── system_instruction.sol ├── solang-parser ├── Cargo.toml ├── README.md ├── build.rs └── src │ ├── diagnostics.rs │ ├── doccomment.rs │ ├── helpers │ ├── fmt.rs │ ├── loc.rs │ ├── mod.rs │ └── ord.rs │ ├── lexer.rs │ ├── lib.rs │ ├── pt.rs │ ├── solidity.lalrpop │ └── tests.rs ├── src ├── abi │ ├── anchor.rs │ ├── ethereum.rs │ ├── mod.rs │ ├── polkadot.rs │ └── tests.rs ├── bin │ ├── cli │ │ ├── mod.rs │ │ └── test.rs │ ├── doc │ │ └── mod.rs │ ├── idl │ │ └── mod.rs │ ├── languageserver │ │ └── mod.rs │ └── solang.rs ├── codegen │ ├── array_boundary.rs │ ├── cfg.rs │ ├── constant_folding.rs │ ├── constructor.rs │ ├── dead_storage.rs │ ├── dispatch │ │ ├── mod.rs │ │ ├── polkadot.rs │ │ ├── solana.rs │ │ └── soroban.rs │ ├── encoding │ │ ├── borsh_encoding.rs │ │ ├── buffer_validator.rs │ │ ├── mod.rs │ │ ├── scale_encoding.rs │ │ └── soroban_encoding.rs │ ├── events │ │ ├── mod.rs │ │ ├── polkadot.rs │ │ └── solana.rs │ ├── expression.rs │ ├── mod.rs │ ├── polkadot.rs │ ├── reaching_definitions.rs │ ├── revert.rs │ ├── solana_accounts │ │ ├── account_collection.rs │ │ ├── account_management.rs │ │ └── mod.rs │ ├── solana_deploy.rs │ ├── statements │ │ ├── mod.rs │ │ └── try_catch.rs │ ├── storage.rs │ ├── strength_reduce │ │ ├── expression_values.rs │ │ ├── mod.rs │ │ ├── reaching_values.rs │ │ ├── tests.rs │ │ └── value.rs │ ├── subexpression_elimination │ │ ├── anticipated_expressions.rs │ │ ├── available_expression.rs │ │ ├── available_expression_set.rs │ │ ├── available_variable.rs │ │ ├── common_subexpression_tracker.rs │ │ ├── expression.rs │ │ ├── instruction.rs │ │ ├── mod.rs │ │ ├── operator.rs │ │ └── tests.rs │ ├── tests.rs │ ├── undefined_variable.rs │ ├── unused_variable.rs │ ├── vartable.rs │ ├── vector_to_slice.rs │ └── yul │ │ ├── builtin.rs │ │ ├── expression.rs │ │ ├── mod.rs │ │ ├── statements.rs │ │ └── tests │ │ ├── expression.rs │ │ └── mod.rs ├── emit │ ├── binary.rs │ ├── cfg.rs │ ├── expression.rs │ ├── functions.rs │ ├── instructions.rs │ ├── loop_builder.rs │ ├── math.rs │ ├── mod.rs │ ├── polkadot │ │ ├── mod.rs │ │ ├── storage.rs │ │ └── target.rs │ ├── solana │ │ ├── mod.rs │ │ └── target.rs │ ├── soroban │ │ ├── mod.rs │ │ └── target.rs │ ├── storage.rs │ └── strings.rs ├── file_resolver.rs ├── lib.rs ├── linker │ ├── bpf.rs │ ├── linker.cpp │ ├── mod.rs │ ├── polkadot_wasm.rs │ └── soroban_wasm.rs ├── lir │ ├── converter │ │ ├── expression.rs │ │ ├── instruction.rs │ │ ├── lir_type.rs │ │ ├── mod.rs │ │ └── vartable.rs │ ├── expressions.rs │ ├── instructions.rs │ ├── lir_type.rs │ ├── mod.rs │ ├── printer │ │ ├── expression.rs │ │ ├── instruction.rs │ │ └── mod.rs │ └── vartable.rs ├── sema │ ├── address.rs │ ├── ast.rs │ ├── builtin.rs │ ├── builtin_structs.rs │ ├── contracts.rs │ ├── diagnostics.rs │ ├── dotgraphviz.rs │ ├── eval.rs │ ├── expression │ │ ├── arithmetic.rs │ │ ├── assign.rs │ │ ├── constructor.rs │ │ ├── function_call.rs │ │ ├── integers.rs │ │ ├── literals.rs │ │ ├── member_access.rs │ │ ├── mod.rs │ │ ├── resolve_expression.rs │ │ ├── retrieve_type.rs │ │ ├── strings.rs │ │ ├── subscript.rs │ │ ├── tests.rs │ │ └── variable.rs │ ├── external_functions.rs │ ├── file.rs │ ├── format.rs │ ├── function_annotation.rs │ ├── functions.rs │ ├── mod.rs │ ├── mutability.rs │ ├── namespace.rs │ ├── pragma.rs │ ├── solana_accounts.rs │ ├── statements.rs │ ├── symtable.rs │ ├── tags.rs │ ├── tests │ │ ├── data_account.rs │ │ └── mod.rs │ ├── types.rs │ ├── unused_variable.rs │ ├── using.rs │ ├── variables.rs │ └── yul │ │ ├── ast.rs │ │ ├── block.rs │ │ ├── builtin.rs │ │ ├── expression.rs │ │ ├── for_loop.rs │ │ ├── functions.rs │ │ ├── mod.rs │ │ ├── statements.rs │ │ ├── switch.rs │ │ ├── tests │ │ ├── block.rs │ │ ├── expression.rs │ │ ├── for_loop.rs │ │ ├── functions.rs │ │ ├── mod.rs │ │ ├── mutability.rs │ │ ├── statements.rs │ │ ├── switch.rs │ │ ├── types.rs │ │ └── unused_variable.rs │ │ ├── types.rs │ │ └── unused_variable.rs └── standard_json.rs ├── stdlib ├── .clang-format ├── .gitignore ├── Makefile ├── bigint.c ├── format.c ├── heap.c ├── ripemd160.c ├── solana.c ├── solana_sdk.h ├── stdlib.c └── stdlib.h ├── testdata ├── ink │ └── mother.json └── solang_import_resolution_tests │ ├── .gitignore │ ├── 01_solang_remap_target │ ├── resources │ │ └── node_modules │ │ │ └── lib │ │ │ └── Lib.sol │ └── run.sh │ ├── 02_solang_incorrect_direct_imports │ ├── resources │ │ └── node_modules │ │ │ └── lib │ │ │ └── Lib.sol │ └── run.sh │ ├── 03_ambiguous_imports_should_fail │ ├── resources │ │ └── node_modules │ │ │ └── lib │ │ │ └── Lib.sol │ └── run.sh │ ├── 04_multiple_map_path_segments │ ├── resources │ │ └── node_modules │ │ │ └── lib │ │ │ └── nested │ │ │ └── Lib.sol │ └── run.sh │ ├── 05_import_path_order_should_not_matter │ ├── contracts │ │ ├── nested1 │ │ │ └── A.sol │ │ └── nested2 │ │ │ └── A.sol │ └── run.sh │ ├── 06_redundant_remaps │ ├── resources │ │ └── node_modules │ │ │ └── lib │ │ │ └── Lib.sol │ └── run.sh │ ├── README.md │ ├── run.sh │ └── util.sh ├── tests ├── .gitignore ├── borsh_encoding.rs ├── builtins.rs ├── cli.rs ├── codegen.rs ├── codegen_testcases │ ├── import_test.sol │ ├── solidity │ │ ├── abi_encode_v2.sol │ │ ├── accounts_for_default_constructor.sol │ │ ├── address_cast.sol │ │ ├── anticipated_expressions.sol │ │ ├── array_boundary_opt.sol │ │ ├── array_elimination.sol │ │ ├── array_of_struct.sol │ │ ├── borsh_decoding_complex_types.sol │ │ ├── borsh_decoding_simple_types.sol │ │ ├── borsh_encoding_complex_types.sol │ │ ├── borsh_encoding_simple_types.sol │ │ ├── common_subexpression_elimination.sol │ │ ├── concat.sol │ │ ├── const.sol │ │ ├── const_fail.sol │ │ ├── constant_folding.sol │ │ ├── constructor_with_metas.sol │ │ ├── dead_storage.sol │ │ ├── dead_storage_off.sol │ │ ├── do_while_break_2.sol │ │ ├── do_while_break_2_fail.sol │ │ ├── encode_decode_double_dynamic_array.sol │ │ ├── global_strings.sol │ │ ├── import_ext_call.sol │ │ ├── llvm_type.sol │ │ ├── load_account_info_members.sol │ │ ├── modifier_opt.sol │ │ ├── multiple.sol │ │ ├── named_mappings.sol │ │ ├── payer_access.sol │ │ ├── polkadot_call_flags.sol │ │ ├── polkadot_delegate_call.sol │ │ ├── polkadot_dispatch.sol │ │ ├── public_function_overrides.sol │ │ ├── revert_require_solana.sol │ │ ├── scale.sol │ │ ├── selector_adds_non_base_function.sol │ │ ├── slice1.sol │ │ ├── solana_base_versus_external.sol │ │ ├── solana_bump.sol │ │ ├── solana_payer_account.sol │ │ ├── storage_reference_return.sol │ │ ├── strength_reduce.sol │ │ ├── struct_member_shift.sol │ │ ├── temp1.sol │ │ ├── temp2.sol │ │ ├── try_catch.sol │ │ ├── unchecked_cse.sol │ │ ├── unused_returns.sol │ │ └── unused_variable_elimination.sol │ └── yul │ │ ├── binary_arithmetic_builtins.sol │ │ ├── common_builtins.sol │ │ ├── common_subexpression_elimination.sol │ │ ├── cse_switch.sol │ │ ├── evm_builtin.sol │ │ ├── expression.sol │ │ ├── external_function.sol │ │ ├── functions.sol │ │ ├── statements.sol │ │ ├── switch.sol │ │ └── switch_simplify.sol ├── contract.rs ├── contract_testcases │ ├── evm │ │ ├── bad_pragmas.sol │ │ ├── builtin_overloaded.sol │ │ ├── builtins │ │ │ ├── abi_decode_unit_1.sol │ │ │ ├── abi_decode_unit_2.sol │ │ │ ├── address_code_01.sol │ │ │ ├── address_code_02.sol │ │ │ └── address_code_03.sol │ │ ├── bytes_cast.sol │ │ ├── call │ │ │ ├── call.sol │ │ │ ├── call_01.sol │ │ │ └── call_02.sol │ │ ├── comment_tests.sol │ │ ├── concat.sol │ │ ├── contract-shadows-global.sol │ │ ├── dead_storage_different_types.sol │ │ ├── dup1.sol │ │ ├── ecrecover.sol │ │ ├── error.sol │ │ ├── ev.sol │ │ ├── events_v0.5.sol │ │ ├── events_v0.6.sol │ │ ├── experimental.sol │ │ ├── int_resolve_unknown.sol │ │ ├── interface_inheritance.sol │ │ ├── issue1534.sol │ │ ├── llvm_type.sol │ │ ├── memory_safe.sol │ │ ├── named_mappings.sol │ │ ├── octal.sol │ │ ├── old_style_call_args.sol │ │ ├── overloaded.sol │ │ ├── pragmas.dot │ │ ├── pragmas.sol │ │ ├── public_internal_function.sol │ │ ├── public_mapping.sol │ │ ├── rubixi.sol │ │ ├── selector_override.sol │ │ ├── standalone_call.sol │ │ ├── super-resolves-to-multiple.sol │ │ ├── this.sol │ │ ├── type.sol │ │ ├── unresolved_constants.sol │ │ └── virtual_receive.sol │ ├── polkadot │ │ ├── account_info.sol │ │ ├── annotations │ │ │ ├── constructor_seeds.sol │ │ │ ├── selector_override.sol │ │ │ ├── selector_override_inherited.sol │ │ │ ├── solana_annotations.sol │ │ │ ├── solana_seeds.sol │ │ │ └── unexpected_annotations.sol │ │ ├── arrays │ │ │ ├── array_dimensions.sol │ │ │ ├── array_dimensions_01.sol │ │ │ ├── array_dimensions_02.sol │ │ │ ├── array_dimensions_03.sol │ │ │ ├── array_dimensions_04.sol │ │ │ ├── data_locations.sol │ │ │ ├── data_locations_01.sol │ │ │ ├── data_locations_02.sol │ │ │ ├── data_locations_03.sol │ │ │ ├── data_locations_04.sol │ │ │ ├── data_locations_05.sol │ │ │ ├── data_locations_06.sol │ │ │ ├── data_locations_07.sol │ │ │ ├── data_locations_08.sol │ │ │ ├── dynamic_array_pop.sol │ │ │ ├── dynamic_array_push.sol │ │ │ ├── fixed_bytes_subscript_not_assign.sol │ │ │ ├── lucas.sol │ │ │ ├── memory_dynamic_array_deref.sol │ │ │ ├── memory_dynamic_array_deref_01.sol │ │ │ ├── memory_dynamic_array_new.sol │ │ │ ├── memory_dynamic_array_new_01.sol │ │ │ ├── memory_dynamic_array_new_02.sol │ │ │ ├── memory_dynamic_array_new_03.sol │ │ │ ├── memory_dynamic_array_new_04.sol │ │ │ ├── missing_array_index.sol │ │ │ ├── missing_array_index_01.sol │ │ │ ├── multi_dim.sol │ │ │ ├── push_array_literal.sol │ │ │ ├── push_array_phi_node.sol │ │ │ ├── storage_delete.sol │ │ │ ├── storage_delete_01.sol │ │ │ ├── storage_dynamic_array_pop.sol │ │ │ ├── storage_dynamic_array_pop_01.sol │ │ │ ├── storage_dynamic_array_pop_02.sol │ │ │ ├── storage_dynamic_array_push.sol │ │ │ ├── storage_dynamic_array_push_01.sol │ │ │ └── storage_dynamic_array_push_02.sol │ │ ├── builtins │ │ │ ├── abi_decode.sol │ │ │ ├── abi_decode_01.sol │ │ │ ├── abi_decode_02.sol │ │ │ ├── abi_decode_03.sol │ │ │ ├── abi_decode_04.sol │ │ │ ├── abi_decode_05.sol │ │ │ ├── abi_encode_with_selector.sol │ │ │ ├── abi_encode_with_signature.sol │ │ │ ├── address_code_01.sol │ │ │ ├── address_code_02.sol │ │ │ ├── block.sol │ │ │ ├── block_01.sol │ │ │ ├── block_02.sol │ │ │ ├── block_03.sol │ │ │ ├── block_04.sol │ │ │ ├── block_05.sol │ │ │ ├── call.sol │ │ │ ├── call_01.sol │ │ │ ├── call_02.sol │ │ │ ├── call_03.sol │ │ │ ├── functions.sol │ │ │ ├── functions_01.sol │ │ │ ├── functions_02.sol │ │ │ ├── msg.sol │ │ │ ├── msg_01.sol │ │ │ ├── tx.sol │ │ │ ├── tx_01.sol │ │ │ ├── tx_02.sol │ │ │ └── tx_03.sol │ │ ├── calls │ │ │ ├── call_flags_01.sol │ │ │ ├── call_flags_02.sol │ │ │ ├── delegate_call.sol │ │ │ ├── payable_functions.sol │ │ │ ├── payable_functions_01.sol │ │ │ ├── payable_functions_02.sol │ │ │ ├── payable_functions_03.sol │ │ │ ├── try_catch_constructor.sol │ │ │ ├── try_catch_constructor_01.sol │ │ │ ├── try_catch_constructor_02.sol │ │ │ ├── try_catch_constructor_03.sol │ │ │ ├── try_catch_constructor_04.sol │ │ │ ├── try_catch_constructor_05.sol │ │ │ ├── try_catch_constructor_06.sol │ │ │ ├── try_catch_constructor_07.sol │ │ │ ├── try_catch_constructor_08.sol │ │ │ ├── try_catch_external_calls.sol │ │ │ ├── try_catch_external_calls_01.sol │ │ │ ├── try_catch_external_calls_02.sol │ │ │ ├── try_catch_external_calls_03.sol │ │ │ ├── try_catch_external_calls_04.sol │ │ │ └── try_catch_external_calls_05.sol │ │ ├── constructor_names.sol │ │ ├── contracts │ │ │ ├── constructor_call.sol │ │ │ ├── contract_name.sol │ │ │ ├── contract_name_01.sol │ │ │ ├── contract_name_02.sol │ │ │ ├── contract_name_03.sol │ │ │ ├── contract_name_04.sol │ │ │ ├── contract_name_05.sol │ │ │ ├── contract_name_06.sol │ │ │ ├── contract_name_07.sol │ │ │ ├── contract_name_08.sol │ │ │ ├── contract_public_functions_01.sol │ │ │ ├── contract_public_functions_02.sol │ │ │ ├── contract_public_functions_03.sol │ │ │ ├── contract_type.sol │ │ │ ├── contract_type_01.sol │ │ │ ├── contract_type_02.sol │ │ │ ├── contract_type_03.sol │ │ │ ├── contract_type_04.sol │ │ │ ├── contract_type_05.sol │ │ │ ├── creation_code.sol │ │ │ ├── creation_code_01.sol │ │ │ ├── external_call.sol │ │ │ ├── external_call_01.sol │ │ │ ├── external_call_02.sol │ │ │ ├── external_call_03.sol │ │ │ ├── overloaded_constructor.sol │ │ │ ├── overloaded_constructor2.sol │ │ │ └── program_id.sol │ │ ├── doccomments_everywhere.sol │ │ ├── enums │ │ │ ├── incorrect_fields.sol │ │ │ ├── incorrect_fields_01.sol │ │ │ ├── test_cast_errors.sol │ │ │ ├── test_cast_errors_01.sol │ │ │ └── test_cast_errors_02.sol │ │ ├── errors │ │ │ ├── custom_error_01.sol │ │ │ ├── custom_error_02.sol │ │ │ ├── custom_error_03.sol │ │ │ ├── custom_error_04.sol │ │ │ └── custom_error_05.sol │ │ ├── events │ │ │ ├── emit.sol │ │ │ ├── emit_01.sol │ │ │ ├── emit_02.sol │ │ │ ├── emit_03.sol │ │ │ ├── emit_04.sol │ │ │ ├── emit_05.sol │ │ │ ├── emit_06.sol │ │ │ ├── event_decl.sol │ │ │ ├── event_decl_01.sol │ │ │ ├── event_decl_02.sol │ │ │ ├── event_decl_03.sol │ │ │ ├── event_decl_04.sol │ │ │ ├── event_decl_05.sol │ │ │ ├── event_decl_06.sol │ │ │ ├── event_decl_07.sol │ │ │ ├── event_decl_08.sol │ │ │ ├── event_decl_09.sol │ │ │ ├── event_decl_10.sol │ │ │ ├── event_decl_11.sol │ │ │ ├── inherited.sol │ │ │ ├── selector.sol │ │ │ ├── signatures.sol │ │ │ ├── signatures_01.sol │ │ │ ├── signatures_02.sol │ │ │ └── signatures_03.sol │ │ ├── expressions │ │ │ ├── assign_chain.sol │ │ │ ├── bad_new_args.sol │ │ │ ├── destructure.sol │ │ │ ├── destructure_01.sol │ │ │ ├── destructure_02.sol │ │ │ ├── destructure_03.sol │ │ │ ├── power.sol │ │ │ ├── power_01.sol │ │ │ ├── power_02.sol │ │ │ ├── test_cast_errors.sol │ │ │ ├── test_cast_errors_01.sol │ │ │ ├── test_cast_errors_02.sol │ │ │ ├── test_cast_errors_03.sol │ │ │ └── test_cast_errors_04.sol │ │ ├── first │ │ │ └── simple_solidiy_compile_and_run.sol │ │ ├── format │ │ │ ├── parse.sol │ │ │ ├── parse_01.sol │ │ │ ├── parse_02.sol │ │ │ ├── parse_03.sol │ │ │ ├── parse_04.sol │ │ │ ├── parse_05.sol │ │ │ ├── parse_06.sol │ │ │ ├── parse_07.sol │ │ │ └── parse_08.sol │ │ ├── function_types │ │ │ ├── assign.sol │ │ │ ├── assign_01.sol │ │ │ ├── assign_02.sol │ │ │ ├── assign_03.sol │ │ │ ├── assign_04.sol │ │ │ ├── decls.sol │ │ │ ├── decls_01.sol │ │ │ ├── decls_02.sol │ │ │ ├── decls_03.sol │ │ │ ├── decls_04.sol │ │ │ ├── decls_05.sol │ │ │ ├── decls_06.sol │ │ │ ├── decls_07.sol │ │ │ ├── decls_08.sol │ │ │ ├── ext.sol │ │ │ ├── ext_01.sol │ │ │ ├── ext_02.sol │ │ │ ├── recursive_01.sol │ │ │ ├── recursive_02.sol │ │ │ ├── recursive_03.sol │ │ │ └── variable_or_func_type.sol │ │ ├── functions │ │ │ ├── args_and_returns.sol │ │ │ ├── args_and_returns_01.sol │ │ │ ├── args_and_returns_02.sol │ │ │ ├── args_and_returns_03.sol │ │ │ ├── constructor_override_01.sol │ │ │ ├── constructor_override_02.sol │ │ │ ├── constructor_override_03.sol │ │ │ ├── constructor_override_04.sol │ │ │ ├── constructors.sol │ │ │ ├── constructors_01.sol │ │ │ ├── external_call_args.sol │ │ │ ├── fallback.sol │ │ │ ├── for_forever.sol │ │ │ ├── global_functions.sol │ │ │ ├── global_functions_01.sol │ │ │ ├── global_functions_02.sol │ │ │ ├── global_functions_03.sol │ │ │ ├── global_functions_04.sol │ │ │ ├── global_functions_05.sol │ │ │ ├── global_functions_06.sol │ │ │ ├── global_functions_07.sol │ │ │ ├── global_functions_08.sol │ │ │ ├── global_functions_09.sol │ │ │ ├── mangling_01.sol │ │ │ ├── mangling_02.sol │ │ │ ├── mangling_03.sol │ │ │ ├── mutability.sol │ │ │ ├── mutability_01.sol │ │ │ ├── mutability_02.sol │ │ │ ├── mutability_03.sol │ │ │ ├── mutability_04.sol │ │ │ ├── mutability_05.sol │ │ │ ├── mutability_06.sol │ │ │ ├── mutability_07.sol │ │ │ ├── mutability_08.sol │ │ │ ├── mutability_09.sol │ │ │ ├── mutability_10.sol │ │ │ ├── mutability_11.sol │ │ │ ├── mutability_12.sol │ │ │ ├── mutability_13.sol │ │ │ ├── mutability_14.sol │ │ │ ├── mutability_15.sol │ │ │ ├── named_argument_call.sol │ │ │ ├── named_argument_call_01.sol │ │ │ ├── named_argument_call_02.sol │ │ │ ├── named_argument_call_03.sol │ │ │ ├── named_argument_call_04.sol │ │ │ ├── payable.sol │ │ │ ├── payable_01.sol │ │ │ ├── payable_02.sol │ │ │ ├── payable_03.sol │ │ │ ├── positional_argument_call.sol │ │ │ ├── positional_argument_call_01.sol │ │ │ ├── positional_argument_call_02.sol │ │ │ ├── return_not_returns.sol │ │ │ ├── scopes.sol │ │ │ ├── scopes_01.sol │ │ │ ├── shadowing.sol │ │ │ ├── stray_semicolon.sol │ │ │ ├── stray_semicolon_01.sol │ │ │ ├── virtual_function_call_01.sol │ │ │ └── virtual_function_call_02.sol │ │ ├── inheritance │ │ │ ├── base_contract.sol │ │ │ ├── base_contract_01.sol │ │ │ ├── base_contract_access_via_name.sol │ │ │ ├── base_contract_on_constructor.sol │ │ │ ├── base_contract_on_constructor_01.sol │ │ │ ├── base_contract_on_constructor_02.sol │ │ │ ├── base_contract_on_constructor_03.sol │ │ │ ├── base_contract_on_constructor_04.sol │ │ │ ├── base_contract_on_constructor_05.sol │ │ │ ├── base_contract_on_constructor_06.sol │ │ │ ├── base_contract_on_constructor_07.sol │ │ │ ├── base_contract_on_constructor_08.sol │ │ │ ├── base_contracts_access_named_args_via_name.sol │ │ │ ├── call_inherited_function.sol │ │ │ ├── call_inherited_function_01.sol │ │ │ ├── call_inherited_function_02.sol │ │ │ ├── cast_contract.sol │ │ │ ├── cast_contract_01.sol │ │ │ ├── inherit.sol │ │ │ ├── inherit_01.sol │ │ │ ├── inherit_02.sol │ │ │ ├── inherit_03.sol │ │ │ ├── inherit_04.sol │ │ │ ├── inherit_05.sol │ │ │ ├── inherit_types.sol │ │ │ ├── inherit_types_01.sol │ │ │ ├── inherit_types_02.sol │ │ │ ├── inherit_types_03.sol │ │ │ ├── inherit_types_04.sol │ │ │ ├── inherit_types_05.sol │ │ │ ├── inherit_variables.sol │ │ │ ├── inherit_variables_01.sol │ │ │ ├── inherit_variables_02.sol │ │ │ ├── inherit_variables_03.sol │ │ │ ├── inherit_variables_04.sol │ │ │ ├── multiple_override.sol │ │ │ ├── multiple_override_01.sol │ │ │ ├── multiple_override_02.sol │ │ │ ├── multiple_override_03.sol │ │ │ ├── multiple_override_04.sol │ │ │ ├── multiple_override_05.sol │ │ │ ├── multiple_override_06.sol │ │ │ ├── mutability.sol │ │ │ ├── mutability_01.sol │ │ │ ├── simple_interface.sol │ │ │ ├── test_abstract.sol │ │ │ ├── test_abstract_01.sol │ │ │ ├── test_interface.sol │ │ │ ├── test_interface_01.sol │ │ │ ├── test_interface_02.sol │ │ │ ├── test_interface_03.sol │ │ │ ├── test_interface_04.sol │ │ │ ├── test_interface_05.sol │ │ │ ├── test_interface_06.sol │ │ │ ├── test_interface_07.sol │ │ │ ├── test_interface_08.sol │ │ │ ├── test_interface_09.sol │ │ │ ├── test_override.sol │ │ │ ├── test_override_01.sol │ │ │ ├── test_override_02.sol │ │ │ ├── test_override_03.sol │ │ │ ├── test_override_04.sol │ │ │ ├── test_override_05.sol │ │ │ ├── test_override_06.sol │ │ │ ├── test_override_07.sol │ │ │ ├── test_override_08.sol │ │ │ ├── test_override_09.sol │ │ │ ├── test_super.sol │ │ │ ├── test_super_01.sol │ │ │ ├── test_super_02.sol │ │ │ ├── test_virtual.sol │ │ │ ├── test_virtual_01.sol │ │ │ ├── test_virtual_02.sol │ │ │ ├── visibility.sol │ │ │ ├── visibility_01.sol │ │ │ └── visibility_02.sol │ │ ├── libraries │ │ │ ├── restrictions.sol │ │ │ ├── restrictions_01.sol │ │ │ ├── restrictions_02.sol │ │ │ ├── restrictions_03.sol │ │ │ ├── restrictions_04.sol │ │ │ ├── restrictions_05.sol │ │ │ ├── restrictions_06.sol │ │ │ ├── restrictions_07.sol │ │ │ ├── restrictions_08.sol │ │ │ ├── using.sol │ │ │ ├── using_01.sol │ │ │ ├── using_02.sol │ │ │ ├── using_03.sol │ │ │ ├── using_04.sol │ │ │ ├── using_05.sol │ │ │ ├── using_06.sol │ │ │ ├── using_07.sol │ │ │ ├── using_08.sol │ │ │ └── using_09.sol │ │ ├── loops │ │ │ └── test_infinite_loop.sol │ │ ├── mappings │ │ │ ├── bad_mapping_declares.sol │ │ │ ├── bad_mapping_declares_01.sol │ │ │ ├── bad_mapping_declares_02.sol │ │ │ ├── bad_mapping_declares_03.sol │ │ │ ├── bad_mapping_declares_04.sol │ │ │ ├── bad_mapping_declares_05.sol │ │ │ ├── bad_mapping_declares_06.sol │ │ │ ├── bad_mapping_declares_07.sol │ │ │ ├── bad_mapping_declares_08.sol │ │ │ └── bad_mapping_declares_09.sol │ │ ├── modifier │ │ │ ├── declare.sol │ │ │ ├── declare_01.sol │ │ │ ├── declare_02.sol │ │ │ ├── declare_03.sol │ │ │ ├── declare_04.sol │ │ │ ├── declare_05.sol │ │ │ ├── declare_06.sol │ │ │ ├── declare_07.sol │ │ │ ├── declare_08.sol │ │ │ ├── declare_09.sol │ │ │ ├── function_modifier.sol │ │ │ ├── function_modifier_01.sol │ │ │ ├── function_modifier_02.sol │ │ │ ├── mutability.sol │ │ │ ├── mutability_01.sol │ │ │ └── mutability_02.sol │ │ ├── primitives │ │ │ ├── address.sol │ │ │ ├── address_01.sol │ │ │ ├── address_02.sol │ │ │ ├── address_03.sol │ │ │ ├── address_04.sol │ │ │ ├── address_05.sol │ │ │ ├── address_06.sol │ │ │ ├── address_07.sol │ │ │ ├── address_08.sol │ │ │ ├── address_09.sol │ │ │ ├── address_payable_type.sol │ │ │ ├── address_payable_type_01.sol │ │ │ ├── address_payable_type_02.sol │ │ │ ├── address_payable_type_03.sol │ │ │ ├── address_payable_type_04.sol │ │ │ ├── address_payable_type_05.sol │ │ │ ├── address_payable_type_06.sol │ │ │ ├── address_payable_type_07.sol │ │ │ ├── bytes_01.sol │ │ │ ├── bytes_02.sol │ │ │ ├── test_literal_overflow.sol │ │ │ ├── test_literal_overflow_01.sol │ │ │ ├── test_literal_overflow_02.sol │ │ │ ├── test_literal_overflow_03.sol │ │ │ ├── test_literal_overflow_04.sol │ │ │ ├── test_literal_overflow_05.sol │ │ │ ├── test_literal_overflow_06.sol │ │ │ ├── test_literal_overflow_07.sol │ │ │ ├── test_literal_overflow_08.sol │ │ │ ├── test_literal_overflow_09.sol │ │ │ ├── test_literal_overflow_10.sol │ │ │ ├── test_literal_overflow_11.sol │ │ │ ├── type_name.sol │ │ │ ├── units.sol │ │ │ ├── units_01.sol │ │ │ └── units_02.sol │ │ ├── storage │ │ │ └── double_index_storage.sol │ │ ├── strings │ │ │ ├── basic_tests.sol │ │ │ ├── basic_tests_01.sol │ │ │ ├── basic_tests_02.sol │ │ │ ├── basic_tests_03.sol │ │ │ ├── basic_tests_04.sol │ │ │ ├── string_escape.sol │ │ │ ├── string_escape_01.sol │ │ │ ├── string_escape_02.sol │ │ │ ├── string_escape_03.sol │ │ │ ├── string_escape_04.sol │ │ │ ├── string_escape_05.sol │ │ │ └── string_escape_06.sol │ │ ├── structs │ │ │ ├── parse_structs.sol │ │ │ ├── parse_structs_01.sol │ │ │ ├── parse_structs_02.sol │ │ │ ├── parse_structs_03.sol │ │ │ ├── parse_structs_04.sol │ │ │ ├── parse_structs_05.sol │ │ │ ├── parse_structs_07.sol │ │ │ ├── parse_structs_08.sol │ │ │ ├── parse_structs_09.sol │ │ │ ├── parse_structs_10.sol │ │ │ ├── parse_structs_11.sol │ │ │ ├── parse_structs_12.sol │ │ │ ├── parse_structs_13.sol │ │ │ ├── parse_structs_14.sol │ │ │ ├── parse_structs_15.sol │ │ │ ├── parse_structs_16.sol │ │ │ ├── parse_structs_17.sol │ │ │ ├── parse_structs_18.sol │ │ │ ├── parse_structs_19.sol │ │ │ ├── parse_structs_20.sol │ │ │ ├── parse_structs_21.sol │ │ │ ├── parse_structs_22.sol │ │ │ └── parse_structs_23.sol │ │ ├── tags │ │ │ ├── contract.sol │ │ │ ├── contract_01.sol │ │ │ ├── contract_02.sol │ │ │ ├── enum_tag.sol │ │ │ ├── enum_tag_01.sol │ │ │ ├── event_tag.sol │ │ │ ├── event_tag_01.sol │ │ │ ├── event_tag_02.sol │ │ │ ├── event_tag_03.sol │ │ │ ├── event_tag_04.sol │ │ │ ├── functions.sol │ │ │ ├── functions_01.sol │ │ │ ├── functions_02.sol │ │ │ ├── functions_03.sol │ │ │ ├── functions_04.sol │ │ │ ├── functions_05.sol │ │ │ ├── functions_06.sol │ │ │ ├── functions_07.sol │ │ │ ├── functions_08.sol │ │ │ ├── functions_09.sol │ │ │ ├── functions_10.sol │ │ │ ├── inheritdoc.sol │ │ │ ├── struct_tag.sol │ │ │ ├── struct_tag_01.sol │ │ │ ├── struct_tag_02.sol │ │ │ ├── struct_tag_03.sol │ │ │ ├── variables.sol │ │ │ └── variables_01.sol │ │ ├── value │ │ │ ├── balance.sol │ │ │ ├── balance_01.sol │ │ │ ├── balance_02.sol │ │ │ ├── external_call_value.sol │ │ │ ├── external_call_value_01.sol │ │ │ ├── external_call_value_02.sol │ │ │ ├── external_call_value_03.sol │ │ │ ├── external_call_value_04.sol │ │ │ ├── external_call_value_05.sol │ │ │ ├── external_call_value_06.sol │ │ │ ├── external_call_value_07.sol │ │ │ ├── external_call_value_08.sol │ │ │ ├── external_call_value_09.sol │ │ │ ├── external_call_value_10.sol │ │ │ ├── external_call_value_11.sol │ │ │ ├── this_address.sol │ │ │ ├── this_address_01.sol │ │ │ ├── this_address_02.sol │ │ │ ├── this_address_03.sol │ │ │ └── this_address_04.sol │ │ ├── variables │ │ │ ├── ext_fn_call_is_reading_variable_01.sol │ │ │ ├── ext_fn_call_is_reading_variable_02.sol │ │ │ ├── global_constants.sol │ │ │ ├── global_constants_01.sol │ │ │ ├── global_constants_02.sol │ │ │ ├── global_constants_03.sol │ │ │ ├── global_constants_04.sol │ │ │ ├── immutable.sol │ │ │ ├── immutable_01.sol │ │ │ ├── immutable_02.sol │ │ │ ├── immutable_03.sol │ │ │ ├── immutable_04.sol │ │ │ ├── immutable_05.sol │ │ │ ├── override_attribute.sol │ │ │ ├── override_attribute_01.sol │ │ │ ├── override_attribute_02.sol │ │ │ ├── override_attribute_03.sol │ │ │ ├── override_attribute_04.sol │ │ │ ├── override_attribute_05.sol │ │ │ ├── test_variable_errors.sol │ │ │ ├── test_variable_initializer_errors.sol │ │ │ ├── test_variable_initializer_errors_01.sol │ │ │ ├── test_variable_initializer_errors_02.sol │ │ │ ├── test_variable_initializer_errors_03.sol │ │ │ ├── test_variable_initializer_errors_04.sol │ │ │ ├── variable_size.sol │ │ │ ├── variable_size_01.sol │ │ │ └── variable_size_02.sol │ │ └── yul │ │ │ ├── ptr_to_int.sol │ │ │ └── unreachable_after_asm.sol │ └── solana │ │ ├── abstract_interface.sol │ │ ├── accessor │ │ ├── accessor_is_external.sol │ │ ├── constant.sol │ │ └── constant_01.sol │ │ ├── account_info.sol │ │ ├── account_meta.sol │ │ ├── accounts │ │ ├── account_collision.sol │ │ ├── accounts_required.sol │ │ ├── constructor_in_loop.sol │ │ ├── data_account.sol │ │ ├── data_account_visibility.sol │ │ ├── double_calls.sol │ │ ├── incorrect_annotations.sol │ │ ├── repated_declaration.sol │ │ └── unrecognized_account.sol │ │ ├── address_cast.sol │ │ ├── address_member_call.sol │ │ ├── annotations │ │ ├── abstract_function.sol │ │ ├── account_name_collision.sol │ │ ├── accounts_on_interface.sol │ │ ├── annotations_bad.sol │ │ ├── at_whitespace.sol │ │ ├── bad_accounts.sol │ │ ├── constructor_external_function.sol │ │ ├── constructor_seeds.sol │ │ ├── constructor_seeds_bad.sol │ │ ├── invalid_space.sol │ │ ├── not_enough_space.sol │ │ ├── not_enough_space_2.sol │ │ └── parameter_annotation.sol │ │ ├── asm_reserved_words.sol │ │ ├── assign_array_in_array.sol │ │ ├── bad_seeds_on_external_call.sol │ │ ├── call │ │ ├── abi_encode_call.sol │ │ ├── call_args_three_ways.sol │ │ ├── calltys.sol │ │ ├── calltys_01.sol │ │ └── calltys_02.sol │ │ ├── comment.sol │ │ ├── comment_tests.sol │ │ ├── constant │ │ ├── not_constant.sol │ │ └── not_constant_01.sol │ │ ├── contract_var_base_function_init.sol │ │ ├── contracts │ │ ├── abstract_constructor.sol │ │ ├── circular_reference.sol │ │ ├── constructor_freestanding.sol │ │ ├── contract_as_variables.sol │ │ └── contract_call_freestanding.sol │ │ ├── create_contract │ │ ├── base_contract.sol │ │ ├── base_contract_01.sol │ │ ├── base_contract_02.sol │ │ ├── syntax.sol │ │ └── syntax_01.sol │ │ ├── destructure_assign_struct_member.sol │ │ ├── destructure_assign_struct_member_2.sol │ │ ├── dup1.sol │ │ ├── empty_import.sol │ │ ├── empty_vector.sol │ │ ├── error.sol │ │ ├── error2.sol │ │ ├── event.sol │ │ ├── expressions │ │ ├── address_send_transfer_balance.sol │ │ ├── bytes32_0.sol │ │ ├── bytes32_0_01.sol │ │ ├── bytes32_0_02.sol │ │ ├── const_in_type.sol │ │ ├── contract_no_init.sol │ │ ├── interfaceid.sol │ │ ├── overflow_constant_propagation.sol │ │ ├── pushpop.sol │ │ ├── pushpop_01.sol │ │ ├── selector_in_free_function.sol │ │ ├── selector_in_free_function_01.sol │ │ ├── selector_in_free_function_02.sol │ │ ├── slice.sol │ │ ├── tx.sol │ │ ├── tx_01.sol │ │ └── units.sol │ │ ├── for_if_no_else.sol │ │ ├── functions │ │ ├── external_functions.sol │ │ ├── mutability.sol │ │ ├── overload_functions.sol │ │ ├── overload_inheritance.sol │ │ ├── override.sol │ │ ├── push_pop_fixed_length_array.sol │ │ ├── selector_override.sol │ │ └── selectors-must-be-different.sol │ │ ├── garbage_function_args.sol │ │ ├── hash │ │ ├── constants_hash_tests.sol │ │ └── constants_hash_tests_01.sol │ │ ├── immutable_function.sol │ │ ├── immutable_function_type.sol │ │ ├── import_contracts_via_object.sol │ │ ├── import_free_function.sol │ │ ├── import_free_function_chain.sol │ │ ├── issues678.sol │ │ ├── keep_on_resolving.sol │ │ ├── large_contract.sol │ │ ├── large_exponent.sol │ │ ├── large_ints.sol │ │ ├── large_negative_ints.sol │ │ ├── mapping_deletion.sol │ │ ├── multidimensional_array.sol │ │ ├── mutability.sol │ │ ├── negative_exponent.sol │ │ ├── now.sol │ │ ├── power.sol │ │ ├── rational │ │ └── rational.sol │ │ ├── rational_comparison.sol │ │ ├── rational_comparison2.sol │ │ ├── returns │ │ ├── return_err.sol │ │ ├── return_err_01.sol │ │ ├── return_err_02.sol │ │ ├── return_err_03.sol │ │ └── return_err_04.sol │ │ ├── shift_struct_member.sol │ │ ├── simple.sol │ │ ├── struct_member_wrong_ty.sol │ │ ├── structs │ │ ├── parse_structs.sol │ │ ├── parse_structs_06.sol │ │ ├── recursive_01.sol │ │ ├── recursive_02.sol │ │ └── recursive_04.sol │ │ ├── tags.sol │ │ ├── type_called_error.sol │ │ ├── type_decl.sol │ │ ├── type_decl_broken.sol │ │ ├── type_decl_broken_more.sol │ │ ├── type_decl_broken_used_as_event.sol │ │ ├── type_decl_import.sol │ │ ├── unused_storage_variables.sol │ │ ├── unused_variable.sol │ │ ├── user_oper │ │ ├── user_defined_oper_correct.sol │ │ └── user_defined_oper_incorrect.sol │ │ ├── using_functions.sol │ │ ├── using_import.sol │ │ ├── using_interface.sol │ │ ├── using_list.sol │ │ ├── using_literal.sol │ │ └── yul │ │ ├── function_cal_cond.sol │ │ ├── parse.sol │ │ ├── return_in_asm.sol │ │ └── yul_switch.sol ├── doc_examples.rs ├── evm.rs ├── evm_tests │ ├── mod.rs │ └── pragma.rs ├── imports.rs ├── imports_testcases │ ├── Dummy.json │ ├── bad_escape.sol │ ├── dummy.sol │ ├── import.sol │ ├── import_map.sol │ ├── imports │ │ ├── bar.sol │ │ ├── bar_backslash.sol │ │ ├── rel.sol │ │ └── relative_import.sol │ └── imports2 │ │ └── bar.sol ├── lir.rs ├── lir_tests │ ├── convert_lir.rs │ ├── expr_to_string.rs │ ├── helpers.rs │ ├── insn_to_string.rs │ ├── lir_to_string.rs │ └── mod.rs ├── optimization_testcases │ ├── calls │ │ ├── 00003fb72d8027d21e886333379cf82eb039a306.json │ │ ├── 009f874f8cfb6123d6cf364d2ced5ba806d5fb77.json │ │ ├── 01912a01e27ada51b7fbb06c68b4455ec3fabe53.json │ │ ├── 04157d79addbc40f2319c9a6f7c699f0d48baa59.json │ │ ├── 045e0e69de8d9a77becbc0cfce4babc22622fcab.json │ │ ├── 05022d729c815530935b56ac21bcc1be6269a001.json │ │ ├── 06bffd9376e93226ea504196c6e7caf214df94b5.json │ │ ├── 072148dbf36aa512f9af83ff505bcd6e0bd0db88.json │ │ ├── 07c00b83bb6b7e4125b285c8de9ae2cf1235874d.json │ │ ├── 085b1aef14cc42bfdc5ac6580b31222db911acf1.json │ │ ├── 0b44e918cca54edfcac366aef5a9bf1f0a1c7c3d.json │ │ ├── 0b861c68e4bbeaced7eb156d793b1977b050a7e1.json │ │ ├── 0d952729595225874465b84595290c097436eefb.json │ │ ├── 108c217fb3a9513fabd3d7e3fbd8d33af5c9efe0.json │ │ ├── 10b7d3c2c1e294b765bc2f6b3db06ebe6ecc4d3d.json │ │ ├── 114cff92661e65f9576b26c162c095ea636ee037.json │ │ ├── 1186789b5546043bfa1215b5fa42463a2de3bda5.json │ │ ├── 1436450537ce8f9bdf31401d6ac19290be579b94.json │ │ ├── 1480a99c4daefe43a746f54f814498df3ee43068.json │ │ ├── 1705a7f6d65dbc964702ce2870e3ca47681ffcd9.json │ │ ├── 183f1a962081515d90bf08301c5440fba2d38105.json │ │ ├── 183fb340e3ad4511a7f1d848b3192733191a2696.json │ │ ├── 19cd7f490b5f85e9370f17a5b538de60335f0493.json │ │ ├── 1a58b2647e77f77fc6075c62e6b11297852e4684.json │ │ ├── 1b0ed1e820fbf800143184f09631c5b1f0eaef1a.json │ │ ├── 1b127f90389f26a7ace08cc374bd1a6fdf58c3ba.json │ │ ├── 1b48a88a5bf4f7c25325c3c2151c9c3f4f1c14b6.json │ │ ├── 1c46da1372eaf2bbc6146911f817548828e0e390.json │ │ ├── 1f717f2fb2614d29eda874e8edd85d8642762ea3.json │ │ ├── 2089b1eb0d82d0c85981dc0f665b30a936168da5.json │ │ ├── 211f2c4d8ebbdb43c4ac71663bb6909424aa4b6c.json │ │ ├── 23028377c3680af88f1feb6b1c0a8340ffd9a480.json │ │ ├── 233f083f32b6348c1c8fada94a522c571198cf28.json │ │ ├── 23ed85894b789c90d3a9dc0d7a31de888e366cdb.json │ │ ├── 24351719c172cf07bb8421f9747dead23f491714.json │ │ ├── 275fb0432215e7dade97de5bb9a82f91ca26ec34.json │ │ ├── 27723aacedc0f4455bce42c3e26408355f9b5728.json │ │ ├── 279927ef3806c03dd850574c8fd80265c97e51f7.json │ │ ├── 28de2bbe3ec13103adb4c52053e615a4d25a3338.json │ │ ├── 299e8f22fa0f1b4c3ebf7f187a2ab0fa5b389280.json │ │ ├── 2a336dc4196af8922fe76563b83ec2732fbecaa8.json │ │ ├── 2ae422b2ae1b2ce11bd89a7534e5e1c659d1da0a.json │ │ ├── 2cbeb0eb869eea8abe4be352f6605cad3cc2b3ce.json │ │ ├── 2f3f9eccd8173aa694a1c7785ecce4ac49d0f6b5.json │ │ ├── 2fe6b11e0db08e497b6434870b7b6598a6c879f5.json │ │ ├── 308a8684f989f21c6c703b7c75aa6fe072299ab0.json │ │ ├── 34370c63f673d8551b0b727d4b2e3946de49e3a8.json │ │ ├── 357db7992fd6cc672ff0018367e15db1d175ca25.json │ │ ├── 36127835bbc05a3efef22f763a2acfbc9a1c1c48.json │ │ ├── 3750bfe8de73a81c36ac193885bea0ce578b9ba5.json │ │ ├── 37df0f87d6adaad5401f43ee565c6d136d4f9b16.json │ │ ├── 393a8d95417fdbf79828dcf1bb4f3338a5b7ace1.json │ │ ├── 395009ea8efbb6faed7303314eff9de4c319ca59.json │ │ ├── 39a7aa4c107b7411ee28434d60a45497cc573a6e.json │ │ ├── 39b72c56c4c66beb997bffa7c74cf75d920f89a1.json │ │ ├── 39e410cb7e9d80b2f2fdea5c82d63d5d09c5e2fd.json │ │ ├── 3e51357b7c03a58802590fb6338c1d2c42988c42.json │ │ ├── 3e77586d59c07d86f5d4ce839db9eaa9ae2d5dc7.json │ │ ├── 3ee60d0e61b9db1884299bf3b262ff72343d720a.json │ │ ├── 41c48961d23dceffdfe3056f20bdefdca9cc41f1.json │ │ ├── 4213430920860032c48fd6c975067fce40c7f0b4.json │ │ ├── 44096d94f1d5b45be9377c369131f9fe5285c8af.json │ │ ├── 4436c9a329a237e548071dc48184167fbe1d3d3e.json │ │ ├── 45b8c83ba563385f95345549716b166105c3eb26.json │ │ ├── 461c892e5409ec2e0ad5690b689b231bb26429c9.json │ │ ├── 474529f38a76b3e269346d6746d734c9c34ef6cd.json │ │ ├── 475211134b5dfc05b7a0c40b7497c38840946840.json │ │ ├── 4949edd43b86a7574a5d2ebfe4bef1f0efa3a04b.json │ │ ├── 4a3ebf81559622ff90978ee0601c0ebc7143cedb.json │ │ ├── 4de3287ff443c958eccefd23c9ca7aac2ea84e7e.json │ │ ├── 4e351ae6156e78d5bca8ed877580138c792a8bb2.json │ │ ├── 4e6316ed1940a6808e50992bcdfcf4ef057c5d3f.json │ │ ├── 51310a0c4760ecd6751c916245de2ef625696f7b.json │ │ ├── 529c1423724f38b8cecfef31de9ba953e94beec6.json │ │ ├── 52d765a6081956d6a5b69de28d316ec732400b96.json │ │ ├── 5438f1233cd04507f29620220f4945217cf0b8f6.json │ │ ├── 564d9bac74a8db9ce4e6d6449fef48e5c6c9a859.json │ │ ├── 5806b03335f34b5d861945e76a2200ae18af19e4.json │ │ ├── 5835bc96e662018e3111972dca85b4ce00f25c42.json │ │ ├── 59cdc8f2d6da65d5a0f028f5f1b3a3111b9ce6b2.json │ │ ├── 5c2c94b10f96717805edd40e84094a76f3c6e2fc.json │ │ ├── 6154ca0cc65577a19069e2101afdcbb8f77953a7.json │ │ ├── 61902f37a1151bf5058540a3182272d342249de3.json │ │ ├── 66829b56e6eaab46172029b817a16d45315551ee.json │ │ ├── 66864d1956150d7a2d3f6df340ca04cf38eba29e.json │ │ ├── 66e10a0624b4c6600abeca82625a7b25a1bae7ed.json │ │ ├── 66f00f9ebc48cfe4baa0247dc66473b60aad9cde.json │ │ ├── 67cc5aadb90619492948e3f10925e843e34a5314.json │ │ ├── 68faa3ee568609cb2e738c0e92b26e3dc7ea0f68.json │ │ ├── 6cbfc1852136b43ae5227fafc1afcebd085da63e.json │ │ ├── 6d43b70b6022f2dad09eceb938394a90f79ba990.json │ │ ├── 6de94cb4e318015a4109acad0b583963c0b5f5a1.json │ │ ├── 6ed453a65aa173ae32979d7a646da813d1b97fbb.json │ │ ├── 6eeb7392b5b692b61e3f291c3c1fb5dd55d876a5.json │ │ ├── 724b06d399988bbe84ef9be8e113a57f3e80c7cb.json │ │ ├── 733d059b3eb1a2136f2dc654c5adf31fd43c3f83.json │ │ ├── 76de50e0c391f652d51eb63bac244710512ee89d.json │ │ ├── 77fdc91214244a38f5fb6870f7e60de76a9ab35a.json │ │ ├── 791bb65dc5ba996cdd30c63e5a51eca2c7735e08.json │ │ ├── 7a0c041ef08866b1e6380f418e4cc32c8728a41b.json │ │ ├── 7af75dc3316b77d4041e19909e65de21b9ff62dc.json │ │ ├── 7b187aa814a2250ecca1e685234f6541170f3619.json │ │ ├── 7c7797ab6e67d6bc0af9c7cc1f24ed042a541200.json │ │ ├── 7d7dc194b6dbc95d2d773b6e3f51fe6844125ace.json │ │ ├── 7e8bf6ee5bd652a26314a7e00793f4145e0d00d8.json │ │ ├── 7f41f4f46d3d322620b1d417186aa1613bc0a473.json │ │ ├── 80069f05d6dd215ef91cad39f3875388b523d147.json │ │ ├── 802e618a7975e75e87f358681fec1d101430cc1a.json │ │ ├── 80dbbd6ba72a5fe2aaa0fe5accb1a96ddce6f3dd.json │ │ ├── 818f31ac3a827391551f5c24a8271221b76e9aae.json │ │ ├── 823f01a5cd5f6d4f2a22a971ee31f5ee3cac63e6.json │ │ ├── 83171888c38223fe6243794deaacf94d5d88e665.json │ │ ├── 8322a21a93a295ab7ddea0863ba8316efa00e23a.json │ │ ├── 8359f5fd91cbd73e401c4fa07c736eb1941506fa.json │ │ ├── 860ef953b51db702764accaf0372e8541044d395.json │ │ ├── 87204607493f46c1edd4eff4058478c6c677d40c.json │ │ ├── 881e8fd0c136fd169e6e606154c4092645698adb.json │ │ ├── 88f634b1727cbd8426c18d9a1955ae49bde4dfb5.json │ │ ├── 89a0e8cab61b379690b1bde8befe1ff5c9c7d9e0.json │ │ ├── 8a0c71d790d982d8fa7c77627b016a061783e9d0.json │ │ ├── 8b8e17e7af35d41efbe338916381acce838cad7c.json │ │ ├── 8cdd055f303190e33feab07c1d26e18e2b2d19ff.json │ │ ├── 8efe35b20f88a3135d94e2c018565182c251a7f8.json │ │ ├── 9056235f82b40734cbaa97c8e05a99f7fd991c67.json │ │ ├── 9175fe362a6d85e2249c30d23b984b46e30e6afc.json │ │ ├── 9200301bb4291ee2b943489960791980b2d40df5.json │ │ ├── 931d9bdad38883386a0f7e414c65a6f7da74247a.json │ │ ├── 936f207995a74ee99dd48a16a1227826102bdb15.json │ │ ├── 94d82dd931e2741e6bc553cfaf6c872c7d93caaf.json │ │ ├── 962b57666aad63d25bfd65011201358e0f1f0d0e.json │ │ ├── 966b45901973cfc548d5e0b3293997159280e559.json │ │ ├── 97b3f1ab351112408f7ce9fc93014f86e71ef7ab.json │ │ ├── 97fbb6591e1f5ee17b236138e868a55992410e47.json │ │ ├── 9868a4a358753f952483ff9446df573ad63ef7ab.json │ │ ├── 9905644736cef514b632bd5cb0bfaf652094cf59.json │ │ ├── 9a0892303ceb4a83c2b45a55d118dc63ccca2431.json │ │ ├── 9a840e5a900a4755c9f4e24d4ac5063f7573c7f5.json │ │ ├── 9c8c0605a059e2c6b63999ce08195542e34599ad.json │ │ ├── 9d27869e559900797d9a83fac93d23cc9db1552e.json │ │ ├── 9fc78c1fa5aff7765a9f1a1abfc7fb6c65bff6f2.json │ │ ├── a013e38f16b0d7f4fb05d2a127342a0a89e025b2.json │ │ ├── a0d621f97edd4164882e407b9de6ae7665c4dc65.json │ │ ├── a1755c708820498a2de9240456abbb35c34a2ff2.json │ │ ├── a245852a7d1e3503247ad5de3dee33612c36a031.json │ │ ├── a46210dd258260b3e582dca559720a2d84c32ede.json │ │ ├── a8f198bc49b907a4a4c03ac5ca66266c7b0a9515.json │ │ ├── aa41cc370ba24cc327fc40897fb58d3c2093aef3.json │ │ ├── aa963886733ef70f2e1496cbe3410e94c6a91062.json │ │ ├── abc8aaa6bb239a4097572ca4e288c4e5445514c0.json │ │ ├── acf852e680a99ffbfcf79f5f43f3bfd6874f1a90.json │ │ ├── b004e7c9bc3d0c4e9d7de943b4f72fa7b06c8772.json │ │ ├── b00e0467136e0337dbf84f61aa16fc8e55424734.json │ │ ├── b3f48670db4244bd9205576041222f55bdf4d895.json │ │ ├── b3fee2023e9a76c682874d28c8dcc0d74060a267.json │ │ ├── b48ee45beee70a66bc540380eaf3a22c337d55b2.json │ │ ├── b5bfd19f5b4dbcb249ef40a32a190d7a8f8f272f.json │ │ ├── b6339ad75e9175a6bf332a2881001b6c928734e2.json │ │ ├── b6815ad6728a400f03505126507da28ad14a7fc0.json │ │ ├── b6d0fed2a1b1e9c732240df94dc527f010df333f.json │ │ ├── b77cbdcbbdde3297a06c04433ff8b0e434cc8af3.json │ │ ├── bd0105421af89a7dd01472ded68763ce05472c4a.json │ │ ├── c01d3fb92201170c6ea76757b5aeec8739b49f4f.json │ │ ├── c082ae3df9b12cf3b735591f079aba2b1569b5bb.json │ │ ├── c133a1780d32b90ee025f73949f3f9ac3acb3ab6.json │ │ ├── c3e2644c6c24c298e8bb797a486f4f9095b1d620.json │ │ ├── c5a9864389b06010da706c8c54b5298325dc9f18.json │ │ ├── c74c0544ae2be3926d6372c8ef0ebcb0c73d4202.json │ │ ├── c8be3af3cd4d1de4f7c593aca451cdaaf773dfa6.json │ │ ├── c8be40ed3e19675e8bb7da033d34dec6e3fd69c1.json │ │ ├── cb202fd29504596f34d106cf2e4a2c6e7dd1e342.json │ │ ├── cc08f9ec0e4722640a7fb27071e80930d24eb5fe.json │ │ ├── cf513f37390ae5e084fffb2dcbddb9d473fae1c0.json │ │ ├── d1fcbc6bd1cd95c8aefa829222778652f3b071f6.json │ │ ├── d35db07be1efca5a31af0071f31b59a48e159de8.json │ │ ├── d44a63046cbb99c608e9b068c769d9cef1447d4a.json │ │ ├── d5b814cc2fa66754346e40dc8b251ac4986e7399.json │ │ ├── d5e017b7a453bc93ca099ed03f30f7222551e74a.json │ │ ├── d5fcef4384d4a78f6fb3c5eeb0879710d5bb4f77.json │ │ ├── d6d16b20493dde0b10a8f6b5de9457c848432f09.json │ │ ├── d84e56174854f9597fa113e1171352bb81978317.json │ │ ├── d8eec36f43659f261d919c5fa0dfba62f468edd4.json │ │ ├── d94affcc88abe8a1a3ed5386b4a940b723be7db9.json │ │ ├── dcbc98ea779d3da1e1a4082b5a7bf8c9b3c9a676.json │ │ ├── dde6f64e54ff5e4e8a4ee8b92c4cb5795e7db7b4.json │ │ ├── ddedf3014da6b43df1b98fa853322deac995a462.json │ │ ├── de54f08de5ab75a96b9f66ac027bc1fab5a07b95.json │ │ ├── df104d03e10021159e5e748569129577612018d4.json │ │ ├── df669f73686d42bc9aad1ec7c7787fab9a5d0303.json │ │ ├── e42c846a82462397e89f59fd3bca2040be710888.json │ │ ├── e56b8df39161bc827ae9cf4e2dbd5fef0595a7f2.json │ │ ├── e6be413345005926a1566033739efeb348ca235d.json │ │ ├── e7874fc411a46f2477d9e9e29d0c038042bcae70.json │ │ ├── e7bd22dc4f321e4b664018e35dae2a532509e834.json │ │ ├── e8235f0a47bb27b03cb7bcaf17956665a8538e5f.json │ │ ├── eb8a44f265b648283a3cf3c543774fd08c1e87fb.json │ │ ├── ef1e1ce13c38587a9c230a08044018b036761dab.json │ │ ├── ef75ba9ddf247a845a7877ec440da64de2218b85.json │ │ ├── f08c8a56899f6b77e7879d59251253fca8d9f754.json │ │ ├── f17898828d079c6c1d9bc440e2882d88fe6b0cd2.json │ │ ├── f1b0806a397e4cafafc35a17ddfb1a5087d235a4.json │ │ ├── f26f361cd77728914df3ce056c57b54b64c46f22.json │ │ ├── f3d7ec27fca74c323df31987afeb677c24247ea1.json │ │ ├── f46807c38c2116c0f3192e9a8d2bede4f34846d2.json │ │ ├── f4e891aae79bb2cd68e9cf76d8dbc420e5197df2.json │ │ ├── f55f7748da0f98e7d70a232cc46770d72c1ceb01.json │ │ ├── f646b924357689419072fddf402c3ad3c10cd095.json │ │ ├── f787bc14b1c47f81e0f087c0a76e219cdc06bcc7.json │ │ ├── f7b10dca988117f9488ac334a7d2b95c3eef081d.json │ │ ├── f86a50d3a862d7bf019361693beee00826cdbd49.json │ │ ├── f99cd43842e6742d4ce46e6db9186f19e8d473ca.json │ │ ├── fc6dc16d6082a81fed67f782d717aa4be6690a4a.json │ │ ├── fcab22ddefebfba4bfa412396359ee806572989a.json │ │ └── fe05b53c4ac23f3d54a9ed778ddf72ea6d909551.json │ └── programs │ │ ├── 00003fb72d8027d21e886333379cf82eb039a306.sol │ │ ├── 009f874f8cfb6123d6cf364d2ced5ba806d5fb77.sol │ │ ├── 01912a01e27ada51b7fbb06c68b4455ec3fabe53.sol │ │ ├── 04157d79addbc40f2319c9a6f7c699f0d48baa59.sol │ │ ├── 045e0e69de8d9a77becbc0cfce4babc22622fcab.sol │ │ ├── 05022d729c815530935b56ac21bcc1be6269a001.sol │ │ ├── 06bffd9376e93226ea504196c6e7caf214df94b5.sol │ │ ├── 072148dbf36aa512f9af83ff505bcd6e0bd0db88.sol │ │ ├── 07c00b83bb6b7e4125b285c8de9ae2cf1235874d.sol │ │ ├── 085b1aef14cc42bfdc5ac6580b31222db911acf1.sol │ │ ├── 0b44e918cca54edfcac366aef5a9bf1f0a1c7c3d.sol │ │ ├── 0b861c68e4bbeaced7eb156d793b1977b050a7e1.sol │ │ ├── 0d952729595225874465b84595290c097436eefb.sol │ │ ├── 108c217fb3a9513fabd3d7e3fbd8d33af5c9efe0.sol │ │ ├── 10b7d3c2c1e294b765bc2f6b3db06ebe6ecc4d3d.sol │ │ ├── 114cff92661e65f9576b26c162c095ea636ee037.sol │ │ ├── 1186789b5546043bfa1215b5fa42463a2de3bda5.sol │ │ ├── 1436450537ce8f9bdf31401d6ac19290be579b94.sol │ │ ├── 1480a99c4daefe43a746f54f814498df3ee43068.sol │ │ ├── 1705a7f6d65dbc964702ce2870e3ca47681ffcd9.sol │ │ ├── 183f1a962081515d90bf08301c5440fba2d38105.sol │ │ ├── 183fb340e3ad4511a7f1d848b3192733191a2696.sol │ │ ├── 19cd7f490b5f85e9370f17a5b538de60335f0493.sol │ │ ├── 1a58b2647e77f77fc6075c62e6b11297852e4684.sol │ │ ├── 1b0ed1e820fbf800143184f09631c5b1f0eaef1a.sol │ │ ├── 1b127f90389f26a7ace08cc374bd1a6fdf58c3ba.sol │ │ ├── 1b48a88a5bf4f7c25325c3c2151c9c3f4f1c14b6.sol │ │ ├── 1c46da1372eaf2bbc6146911f817548828e0e390.sol │ │ ├── 1f717f2fb2614d29eda874e8edd85d8642762ea3.sol │ │ ├── 2089b1eb0d82d0c85981dc0f665b30a936168da5.sol │ │ ├── 211f2c4d8ebbdb43c4ac71663bb6909424aa4b6c.sol │ │ ├── 23028377c3680af88f1feb6b1c0a8340ffd9a480.sol │ │ ├── 233f083f32b6348c1c8fada94a522c571198cf28.sol │ │ ├── 23ed85894b789c90d3a9dc0d7a31de888e366cdb.sol │ │ ├── 24351719c172cf07bb8421f9747dead23f491714.sol │ │ ├── 275fb0432215e7dade97de5bb9a82f91ca26ec34.sol │ │ ├── 27723aacedc0f4455bce42c3e26408355f9b5728.sol │ │ ├── 279927ef3806c03dd850574c8fd80265c97e51f7.sol │ │ ├── 28de2bbe3ec13103adb4c52053e615a4d25a3338.sol │ │ ├── 299e8f22fa0f1b4c3ebf7f187a2ab0fa5b389280.sol │ │ ├── 2a336dc4196af8922fe76563b83ec2732fbecaa8.sol │ │ ├── 2ae422b2ae1b2ce11bd89a7534e5e1c659d1da0a.sol │ │ ├── 2cbeb0eb869eea8abe4be352f6605cad3cc2b3ce.sol │ │ ├── 2f3f9eccd8173aa694a1c7785ecce4ac49d0f6b5.sol │ │ ├── 2fe6b11e0db08e497b6434870b7b6598a6c879f5.sol │ │ ├── 308a8684f989f21c6c703b7c75aa6fe072299ab0.sol │ │ ├── 34370c63f673d8551b0b727d4b2e3946de49e3a8.sol │ │ ├── 357db7992fd6cc672ff0018367e15db1d175ca25.sol │ │ ├── 36127835bbc05a3efef22f763a2acfbc9a1c1c48.sol │ │ ├── 3750bfe8de73a81c36ac193885bea0ce578b9ba5.sol │ │ ├── 37df0f87d6adaad5401f43ee565c6d136d4f9b16.sol │ │ ├── 393a8d95417fdbf79828dcf1bb4f3338a5b7ace1.sol │ │ ├── 395009ea8efbb6faed7303314eff9de4c319ca59.sol │ │ ├── 39a7aa4c107b7411ee28434d60a45497cc573a6e.sol │ │ ├── 39b72c56c4c66beb997bffa7c74cf75d920f89a1.sol │ │ ├── 39e410cb7e9d80b2f2fdea5c82d63d5d09c5e2fd.sol │ │ ├── 3e51357b7c03a58802590fb6338c1d2c42988c42.sol │ │ ├── 3e77586d59c07d86f5d4ce839db9eaa9ae2d5dc7.sol │ │ ├── 3ee60d0e61b9db1884299bf3b262ff72343d720a.sol │ │ ├── 41c48961d23dceffdfe3056f20bdefdca9cc41f1.sol │ │ ├── 4213430920860032c48fd6c975067fce40c7f0b4.sol │ │ ├── 44096d94f1d5b45be9377c369131f9fe5285c8af.sol │ │ ├── 4436c9a329a237e548071dc48184167fbe1d3d3e.sol │ │ ├── 45b8c83ba563385f95345549716b166105c3eb26.sol │ │ ├── 461c892e5409ec2e0ad5690b689b231bb26429c9.sol │ │ ├── 474529f38a76b3e269346d6746d734c9c34ef6cd.sol │ │ ├── 475211134b5dfc05b7a0c40b7497c38840946840.sol │ │ ├── 4949edd43b86a7574a5d2ebfe4bef1f0efa3a04b.sol │ │ ├── 4a3ebf81559622ff90978ee0601c0ebc7143cedb.sol │ │ ├── 4de3287ff443c958eccefd23c9ca7aac2ea84e7e.sol │ │ ├── 4e351ae6156e78d5bca8ed877580138c792a8bb2.sol │ │ ├── 4e6316ed1940a6808e50992bcdfcf4ef057c5d3f.sol │ │ ├── 51310a0c4760ecd6751c916245de2ef625696f7b.sol │ │ ├── 529c1423724f38b8cecfef31de9ba953e94beec6.sol │ │ ├── 52d765a6081956d6a5b69de28d316ec732400b96.sol │ │ ├── 5438f1233cd04507f29620220f4945217cf0b8f6.sol │ │ ├── 564d9bac74a8db9ce4e6d6449fef48e5c6c9a859.sol │ │ ├── 5806b03335f34b5d861945e76a2200ae18af19e4.sol │ │ ├── 5835bc96e662018e3111972dca85b4ce00f25c42.sol │ │ ├── 59cdc8f2d6da65d5a0f028f5f1b3a3111b9ce6b2.sol │ │ ├── 5c2c94b10f96717805edd40e84094a76f3c6e2fc.sol │ │ ├── 6154ca0cc65577a19069e2101afdcbb8f77953a7.sol │ │ ├── 61902f37a1151bf5058540a3182272d342249de3.sol │ │ ├── 66829b56e6eaab46172029b817a16d45315551ee.sol │ │ ├── 66864d1956150d7a2d3f6df340ca04cf38eba29e.sol │ │ ├── 66e10a0624b4c6600abeca82625a7b25a1bae7ed.sol │ │ ├── 66f00f9ebc48cfe4baa0247dc66473b60aad9cde.sol │ │ ├── 67cc5aadb90619492948e3f10925e843e34a5314.sol │ │ ├── 68faa3ee568609cb2e738c0e92b26e3dc7ea0f68.sol │ │ ├── 6cbfc1852136b43ae5227fafc1afcebd085da63e.sol │ │ ├── 6d43b70b6022f2dad09eceb938394a90f79ba990.sol │ │ ├── 6de94cb4e318015a4109acad0b583963c0b5f5a1.sol │ │ ├── 6ed453a65aa173ae32979d7a646da813d1b97fbb.sol │ │ ├── 6eeb7392b5b692b61e3f291c3c1fb5dd55d876a5.sol │ │ ├── 724b06d399988bbe84ef9be8e113a57f3e80c7cb.sol │ │ ├── 733d059b3eb1a2136f2dc654c5adf31fd43c3f83.sol │ │ ├── 76de50e0c391f652d51eb63bac244710512ee89d.sol │ │ ├── 77fdc91214244a38f5fb6870f7e60de76a9ab35a.sol │ │ ├── 791bb65dc5ba996cdd30c63e5a51eca2c7735e08.sol │ │ ├── 7a0c041ef08866b1e6380f418e4cc32c8728a41b.sol │ │ ├── 7af75dc3316b77d4041e19909e65de21b9ff62dc.sol │ │ ├── 7b187aa814a2250ecca1e685234f6541170f3619.sol │ │ ├── 7c7797ab6e67d6bc0af9c7cc1f24ed042a541200.sol │ │ ├── 7d7dc194b6dbc95d2d773b6e3f51fe6844125ace.sol │ │ ├── 7e8bf6ee5bd652a26314a7e00793f4145e0d00d8.sol │ │ ├── 7f41f4f46d3d322620b1d417186aa1613bc0a473.sol │ │ ├── 80069f05d6dd215ef91cad39f3875388b523d147.sol │ │ ├── 802e618a7975e75e87f358681fec1d101430cc1a.sol │ │ ├── 80dbbd6ba72a5fe2aaa0fe5accb1a96ddce6f3dd.sol │ │ ├── 818f31ac3a827391551f5c24a8271221b76e9aae.sol │ │ ├── 823f01a5cd5f6d4f2a22a971ee31f5ee3cac63e6.sol │ │ ├── 83171888c38223fe6243794deaacf94d5d88e665.sol │ │ ├── 8322a21a93a295ab7ddea0863ba8316efa00e23a.sol │ │ ├── 8359f5fd91cbd73e401c4fa07c736eb1941506fa.sol │ │ ├── 860ef953b51db702764accaf0372e8541044d395.sol │ │ ├── 87204607493f46c1edd4eff4058478c6c677d40c.sol │ │ ├── 881e8fd0c136fd169e6e606154c4092645698adb.sol │ │ ├── 88f634b1727cbd8426c18d9a1955ae49bde4dfb5.sol │ │ ├── 89a0e8cab61b379690b1bde8befe1ff5c9c7d9e0.sol │ │ ├── 8a0c71d790d982d8fa7c77627b016a061783e9d0.sol │ │ ├── 8b8e17e7af35d41efbe338916381acce838cad7c.sol │ │ ├── 8cdd055f303190e33feab07c1d26e18e2b2d19ff.sol │ │ ├── 8efe35b20f88a3135d94e2c018565182c251a7f8.sol │ │ ├── 9056235f82b40734cbaa97c8e05a99f7fd991c67.sol │ │ ├── 9175fe362a6d85e2249c30d23b984b46e30e6afc.sol │ │ ├── 9200301bb4291ee2b943489960791980b2d40df5.sol │ │ ├── 931d9bdad38883386a0f7e414c65a6f7da74247a.sol │ │ ├── 936f207995a74ee99dd48a16a1227826102bdb15.sol │ │ ├── 94d82dd931e2741e6bc553cfaf6c872c7d93caaf.sol │ │ ├── 962b57666aad63d25bfd65011201358e0f1f0d0e.sol │ │ ├── 966b45901973cfc548d5e0b3293997159280e559.sol │ │ ├── 97b3f1ab351112408f7ce9fc93014f86e71ef7ab.sol │ │ ├── 97fbb6591e1f5ee17b236138e868a55992410e47.sol │ │ ├── 9868a4a358753f952483ff9446df573ad63ef7ab.sol │ │ ├── 9905644736cef514b632bd5cb0bfaf652094cf59.sol │ │ ├── 9a0892303ceb4a83c2b45a55d118dc63ccca2431.sol │ │ ├── 9a840e5a900a4755c9f4e24d4ac5063f7573c7f5.sol │ │ ├── 9c8c0605a059e2c6b63999ce08195542e34599ad.sol │ │ ├── 9d27869e559900797d9a83fac93d23cc9db1552e.sol │ │ ├── 9fc78c1fa5aff7765a9f1a1abfc7fb6c65bff6f2.sol │ │ ├── a013e38f16b0d7f4fb05d2a127342a0a89e025b2.sol │ │ ├── a0d621f97edd4164882e407b9de6ae7665c4dc65.sol │ │ ├── a1755c708820498a2de9240456abbb35c34a2ff2.sol │ │ ├── a245852a7d1e3503247ad5de3dee33612c36a031.sol │ │ ├── a46210dd258260b3e582dca559720a2d84c32ede.sol │ │ ├── a8f198bc49b907a4a4c03ac5ca66266c7b0a9515.sol │ │ ├── aa41cc370ba24cc327fc40897fb58d3c2093aef3.sol │ │ ├── aa963886733ef70f2e1496cbe3410e94c6a91062.sol │ │ ├── abc8aaa6bb239a4097572ca4e288c4e5445514c0.sol │ │ ├── acf852e680a99ffbfcf79f5f43f3bfd6874f1a90.sol │ │ ├── b004e7c9bc3d0c4e9d7de943b4f72fa7b06c8772.sol │ │ ├── b00e0467136e0337dbf84f61aa16fc8e55424734.sol │ │ ├── b3f48670db4244bd9205576041222f55bdf4d895.sol │ │ ├── b3fee2023e9a76c682874d28c8dcc0d74060a267.sol │ │ ├── b48ee45beee70a66bc540380eaf3a22c337d55b2.sol │ │ ├── b5bfd19f5b4dbcb249ef40a32a190d7a8f8f272f.sol │ │ ├── b6339ad75e9175a6bf332a2881001b6c928734e2.sol │ │ ├── b6815ad6728a400f03505126507da28ad14a7fc0.sol │ │ ├── b6d0fed2a1b1e9c732240df94dc527f010df333f.sol │ │ ├── b77cbdcbbdde3297a06c04433ff8b0e434cc8af3.sol │ │ ├── bd0105421af89a7dd01472ded68763ce05472c4a.sol │ │ ├── c01d3fb92201170c6ea76757b5aeec8739b49f4f.sol │ │ ├── c082ae3df9b12cf3b735591f079aba2b1569b5bb.sol │ │ ├── c133a1780d32b90ee025f73949f3f9ac3acb3ab6.sol │ │ ├── c3e2644c6c24c298e8bb797a486f4f9095b1d620.sol │ │ ├── c5a9864389b06010da706c8c54b5298325dc9f18.sol │ │ ├── c74c0544ae2be3926d6372c8ef0ebcb0c73d4202.sol │ │ ├── c8be3af3cd4d1de4f7c593aca451cdaaf773dfa6.sol │ │ ├── c8be40ed3e19675e8bb7da033d34dec6e3fd69c1.sol │ │ ├── cb202fd29504596f34d106cf2e4a2c6e7dd1e342.sol │ │ ├── cc08f9ec0e4722640a7fb27071e80930d24eb5fe.sol │ │ ├── cf513f37390ae5e084fffb2dcbddb9d473fae1c0.sol │ │ ├── d1fcbc6bd1cd95c8aefa829222778652f3b071f6.sol │ │ ├── d35db07be1efca5a31af0071f31b59a48e159de8.sol │ │ ├── d44a63046cbb99c608e9b068c769d9cef1447d4a.sol │ │ ├── d5b814cc2fa66754346e40dc8b251ac4986e7399.sol │ │ ├── d5e017b7a453bc93ca099ed03f30f7222551e74a.sol │ │ ├── d5fcef4384d4a78f6fb3c5eeb0879710d5bb4f77.sol │ │ ├── d6d16b20493dde0b10a8f6b5de9457c848432f09.sol │ │ ├── d84e56174854f9597fa113e1171352bb81978317.sol │ │ ├── d8eec36f43659f261d919c5fa0dfba62f468edd4.sol │ │ ├── d94affcc88abe8a1a3ed5386b4a940b723be7db9.sol │ │ ├── dcbc98ea779d3da1e1a4082b5a7bf8c9b3c9a676.sol │ │ ├── dde6f64e54ff5e4e8a4ee8b92c4cb5795e7db7b4.sol │ │ ├── ddedf3014da6b43df1b98fa853322deac995a462.sol │ │ ├── de54f08de5ab75a96b9f66ac027bc1fab5a07b95.sol │ │ ├── df104d03e10021159e5e748569129577612018d4.sol │ │ ├── df669f73686d42bc9aad1ec7c7787fab9a5d0303.sol │ │ ├── e42c846a82462397e89f59fd3bca2040be710888.sol │ │ ├── e56b8df39161bc827ae9cf4e2dbd5fef0595a7f2.sol │ │ ├── e6be413345005926a1566033739efeb348ca235d.sol │ │ ├── e7874fc411a46f2477d9e9e29d0c038042bcae70.sol │ │ ├── e7bd22dc4f321e4b664018e35dae2a532509e834.sol │ │ ├── e8235f0a47bb27b03cb7bcaf17956665a8538e5f.sol │ │ ├── eb8a44f265b648283a3cf3c543774fd08c1e87fb.sol │ │ ├── ef1e1ce13c38587a9c230a08044018b036761dab.sol │ │ ├── ef75ba9ddf247a845a7877ec440da64de2218b85.sol │ │ ├── f08c8a56899f6b77e7879d59251253fca8d9f754.sol │ │ ├── f17898828d079c6c1d9bc440e2882d88fe6b0cd2.sol │ │ ├── f1b0806a397e4cafafc35a17ddfb1a5087d235a4.sol │ │ ├── f26f361cd77728914df3ce056c57b54b64c46f22.sol │ │ ├── f3d7ec27fca74c323df31987afeb677c24247ea1.sol │ │ ├── f46807c38c2116c0f3192e9a8d2bede4f34846d2.sol │ │ ├── f4e891aae79bb2cd68e9cf76d8dbc420e5197df2.sol │ │ ├── f55f7748da0f98e7d70a232cc46770d72c1ceb01.sol │ │ ├── f646b924357689419072fddf402c3ad3c10cd095.sol │ │ ├── f787bc14b1c47f81e0f087c0a76e219cdc06bcc7.sol │ │ ├── f7b10dca988117f9488ac334a7d2b95c3eef081d.sol │ │ ├── f86a50d3a862d7bf019361693beee00826cdbd49.sol │ │ ├── f99cd43842e6742d4ce46e6db9186f19e8d473ca.sol │ │ ├── fc6dc16d6082a81fed67f782d717aa4be6690a4a.sol │ │ ├── fcab22ddefebfba4bfa412396359ee806572989a.sol │ │ └── fe05b53c4ac23f3d54a9ed778ddf72ea6d909551.sol ├── polkadot.rs ├── polkadot_tests │ ├── abi.rs │ ├── array_boundary_check.rs │ ├── arrays.rs │ ├── builtins.rs │ ├── calls.rs │ ├── contracts.rs │ ├── debug_buffer_format.rs │ ├── enums.rs │ ├── errors.rs │ ├── events.rs │ ├── expressions.rs │ ├── first.rs │ ├── format.rs │ ├── function_types.rs │ ├── functions.rs │ ├── imports.rs │ ├── inheritance.rs │ ├── libraries.rs │ ├── loops.rs │ ├── mappings.rs │ ├── mod.rs │ ├── modifier.rs │ ├── primitives.rs │ ├── statements.rs │ ├── storage.rs │ ├── strings.rs │ ├── structs.rs │ ├── value.rs │ ├── variables.rs │ └── yul.rs ├── solana.rs ├── solana_tests │ ├── abi.rs │ ├── abi_decode.rs │ ├── abi_encode.rs │ ├── accessor.rs │ ├── account_access.rs │ ├── account_info.rs │ ├── account_serialization.rs │ ├── arrays.rs │ ├── balance.rs │ ├── base58_encoding.rs │ ├── builtin.rs │ ├── call.rs │ ├── constant.rs │ ├── create_contract.rs │ ├── destructure.rs │ ├── events.rs │ ├── expressions.rs │ ├── hash.rs │ ├── mappings.rs │ ├── math.rs │ ├── metas.rs │ ├── mod.rs │ ├── modifiers.rs │ ├── optimizations.rs │ ├── primitives.rs │ ├── rational.rs │ ├── returns.rs │ ├── runtime_errors.rs │ ├── signature_verify.rs │ ├── simple.rs │ ├── storage.rs │ ├── strings.rs │ ├── structs.rs │ ├── tags.rs │ ├── unused_variable_elimination.rs │ ├── using.rs │ ├── vector_to_slice.rs │ └── yul.rs ├── solang_import_resolution_tests.rs ├── soroban.rs ├── soroban_testcases │ ├── auth.rs │ ├── cross_contract_calls.rs │ ├── math.rs │ ├── mod.rs │ ├── print.rs │ ├── storage.rs │ └── ttl.rs ├── undefined_variable_detection.rs ├── unused_variable_detection.rs └── wasm_host_attr │ ├── Cargo.toml │ └── src │ └── lib.rs └── vscode ├── .eslintrc.json ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── hl_solang.png ├── package.json ├── snippets └── solidity.json ├── solidity.configuration.json ├── src ├── client │ └── extension.ts ├── server │ └── server.ts ├── test │ ├── runTest.ts │ └── suite │ │ ├── extension.test.ts │ │ ├── helper.ts │ │ └── index.ts ├── testFixture │ ├── completion.sol │ ├── defs.sol │ ├── format.sol │ ├── four.sol │ ├── hover1.sol │ ├── impls.sol │ ├── one.sol │ ├── rename.sol │ ├── three.sol │ └── two.sol └── utils │ ├── download.ts │ ├── downloadFile.ts │ ├── downloadWithRetryDialog.ts │ ├── executableVersion.ts │ ├── expandPathResolving.ts │ ├── fetchLatestRelease.ts │ ├── getPlatform.ts │ └── getServer.ts ├── syntaxes └── solidity.json └── tsconfig.json /.dockerignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | build 3 | target 4 | .gitnore 5 | *.wasm 6 | *.sol 7 | *.json 8 | *.abi 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /docs/build 2 | Cargo.lock 3 | /target 4 | **/*.rs.bk 5 | *.ll 6 | /tests/.tmp* 7 | /tests/create_me/ 8 | /test_snapshots/ 9 | 10 | .helix/ 11 | .vscode/ 12 | 13 | /test_snapshots 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "testdata/solidity"] 2 | path = testdata/solidity 3 | url = https://github.com/ethereum/solidity 4 | [submodule "integration/polkadot/tornado/tornado-cli"] 5 | path = integration/polkadot/tornado/tornado-cli 6 | url = https://github.com/tornadocash/tornado-cli.git 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | We very much welcome contributions to the Solang project. 4 | 5 | Please visit the 6 | [contributors guide](http://solang.readthedocs.io/en/latest/contributing.html) in the docs. 7 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | too-many-arguments-threshold = 13 2 | cognitive-complexity-threshold = 37 3 | disallowed-names = ["binary"] 4 | -------------------------------------------------------------------------------- /docs/examples/abi_encode_call.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function f1() public { 3 | bytes foo = abi.encodeCall(c.bar, (102, true)); 4 | } 5 | 6 | function bar(int256 a, bool b) public {} 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/abstract_contract.sol: -------------------------------------------------------------------------------- 1 | abstract contract a { 2 | function func2() public virtual; 3 | } 4 | -------------------------------------------------------------------------------- /docs/examples/abstract_contract_inheritance.sol: -------------------------------------------------------------------------------- 1 | abstract contract a is b { 2 | constructor() {} 3 | } 4 | 5 | contract b { 6 | int256 public j; 7 | 8 | constructor(int256 _j) {} 9 | } 10 | 11 | contract c is a { 12 | int256 public k; 13 | 14 | constructor(int256 k) b(k * 2) {} 15 | } 16 | -------------------------------------------------------------------------------- /docs/examples/array_bounds_check_optimization.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function test() public returns (int256[]) { 3 | int256[] array = new int256[](3); 4 | array[1] = 1; 5 | return array; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/array_type_dynamic.sol: -------------------------------------------------------------------------------- 1 | contract dynamicarray { 2 | function test(uint32 size) public { 3 | int64[] memory a = new int64[](size); 4 | 5 | for (uint32 i = 0; i < size; i++) { 6 | a[i] = 1 << i; 7 | } 8 | 9 | assert(a.length == size); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/array_type_initialized.sol: -------------------------------------------------------------------------------- 1 | contract primes { 2 | function primenumber(uint32 n) public pure returns (uint64) { 3 | uint64[10] primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]; 4 | 5 | return primes[n]; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/assert.sol: -------------------------------------------------------------------------------- 1 | abstract contract x { 2 | constructor(address foobar) { 3 | if (foobar == address(0)) { 4 | revert("foobar must a valid address"); 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/contract_inheritance.sol: -------------------------------------------------------------------------------- 1 | contract a is b, c { 2 | constructor() {} 3 | } 4 | 5 | contract b { 6 | int256 foo; 7 | 8 | function func2() public {} 9 | 10 | constructor() {} 11 | } 12 | 13 | contract c { 14 | int256 bar; 15 | 16 | constructor() {} 17 | 18 | function func1() public {} 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/contract_recursive_inheritance.sol: -------------------------------------------------------------------------------- 1 | contract a is b { 2 | constructor() {} 3 | } 4 | 5 | contract b is c { 6 | int256 foo; 7 | 8 | function func2() public {} 9 | 10 | constructor() {} 11 | } 12 | 13 | contract c { 14 | int256 bar; 15 | 16 | constructor() {} 17 | 18 | function func1() public {} 19 | } 20 | -------------------------------------------------------------------------------- /docs/examples/contract_storage.sol: -------------------------------------------------------------------------------- 1 | contract hitcount { 2 | uint256 public counter = 1; 3 | 4 | function hit() public { 5 | counter++; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/contract_storage_accessor_override.sol: -------------------------------------------------------------------------------- 1 | contract foo is bar { 2 | int256 public override baz; 3 | } 4 | 5 | contract bar { 6 | function baz() public virtual returns (int256) { 7 | return 512; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/examples/contract_storage_immutable.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | uint256 public immutable bar; 3 | 4 | constructor(uint256 v) { 5 | bar = v; 6 | } 7 | 8 | function hit() public { 9 | // this is not permitted 10 | // bar++; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/examples/contract_type_cast_address.sol: -------------------------------------------------------------------------------- 1 | contract example { 2 | function get_address() public returns (address) { 3 | return address(this); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/dynamic_bytes_type.sol: -------------------------------------------------------------------------------- 1 | contract b { 2 | function test() public { 3 | bytes a = hex"0000_00fa"; 4 | bytes b = new bytes(4); 5 | 6 | b[3] = hex"fa"; 7 | 8 | assert(a == b); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/examples/events.sol: -------------------------------------------------------------------------------- 1 | event CounterpartySigned ( 2 | address indexed party, 3 | address counter_party, 4 | uint contract_no 5 | ); 6 | 7 | contract Signer { 8 | function sign(address counter_party, uint contract_no) public { 9 | emit CounterpartySigned(address(this), counter_party, contract_no); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/expression_unchecked.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function f(int64 n) public { 3 | unchecked { 4 | int64 j = n - 1; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/function_modifier_arguments.sol: -------------------------------------------------------------------------------- 1 | contract example { 2 | modifier check_price(int64 price) { 3 | if (price >= 50) { 4 | _; 5 | } 6 | } 7 | 8 | function foo(int64 price) public check_price(price) { 9 | // ... 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/multiple_contracts.sol: -------------------------------------------------------------------------------- 1 | contract A { 2 | /// foo simply returns true 3 | function foo() public returns (bool) { 4 | return true; 5 | } 6 | } 7 | 8 | contract B { 9 | /// bar simply returns false 10 | function bar() public returns (bool) { 11 | return false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/polkadot/constructor_named.sol: -------------------------------------------------------------------------------- 1 | abstract contract Foo { 2 | constructor my_new_foo() {} 3 | } 4 | -------------------------------------------------------------------------------- /docs/examples/polkadot/expression_this.sol: -------------------------------------------------------------------------------- 1 | contract kadowari { 2 | function nomi() public { 3 | kadowari c = this; 4 | address a = address(this); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/examples/polkadot/expression_this_external_call.sol: -------------------------------------------------------------------------------- 1 | contract kadowari { 2 | function nomi() public { 3 | this.nokogiri(102); 4 | } 5 | 6 | function nokogiri(int256 a) public { 7 | // ... 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/examples/polkadot/function_call_external_gas.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function bar() public { 3 | other o = new other(); 4 | 5 | o.feh{value: 102, gas: 5000}(102); 6 | } 7 | } 8 | 9 | contract other { 10 | function feh(uint32 x) public payable { 11 | // ... 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/polkadot/function_modifier.sol: -------------------------------------------------------------------------------- 1 | contract example { 2 | address owner; 3 | 4 | modifier only_owner() { 5 | require(msg.sender == owner); 6 | _; 7 | // insert post conditions here 8 | } 9 | 10 | function foo() public only_owner { 11 | // ... 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/polkadot/hash_type.sol: -------------------------------------------------------------------------------- 1 | import "polkadot"; 2 | 3 | contract c { 4 | bytes32 current; 5 | 6 | function set(Hash h) public returns (Hash) { 7 | current = Hash.unwrap(h); 8 | return Hash.wrap(current); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/examples/print.sol: -------------------------------------------------------------------------------- 1 | abstract contract c { 2 | constructor() { 3 | print("Hello, world!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/require.sol: -------------------------------------------------------------------------------- 1 | abstract contract x { 2 | constructor(address foobar) { 3 | require(foobar != address(0), "foobar must a valid address"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/retrieve_contract_code.sol: -------------------------------------------------------------------------------- 1 | contract example { 2 | function test() public { 3 | bytes runtime = type(other).runtimeCode; 4 | } 5 | } 6 | 7 | contract other { 8 | function foo() public returns (bool) { 9 | return true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/revert.sol: -------------------------------------------------------------------------------- 1 | abstract contract c { 2 | constructor(int256 x) { 3 | assert(x > 0); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/scoping.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo() public { 3 | // new block is introduced with { and ends with } 4 | { 5 | uint256 a; 6 | 7 | a = 102; 8 | } 9 | 10 | // ERROR: a is out of scope 11 | // uint256 b = a + 5; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/shadowing.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | uint256 foo = 102; 3 | uint256 bar; 4 | 5 | function foobar() public { 6 | // AVOID: this shadows the contract storage variable foo 7 | uint256 foo = 5; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/examples/solana/bobcat.sol: -------------------------------------------------------------------------------- 1 | @program_id("z7FbDfQDfucxJz5o8jrGLgvSbdoeSqX5VrxBb5TVjHq") 2 | interface bobcat { 3 | @selector([0xaf, 0xaf, 0x6d, 0x1f, 0x0d, 0x98, 0x9b, 0xed]) 4 | function pounce() view external returns(int64); 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/solana/constructor_annotations.sol: -------------------------------------------------------------------------------- 1 | @program_id("Foo5mMfYo5RhRcWa4NZ2bwFn4Kdhe8rNK5jchxsKrivA") 2 | contract Foo { 3 | 4 | @space(500 + 12) 5 | @seed("Foo") 6 | @payer(payer) 7 | constructor(@seed bytes seed_val, @bump bytes1 bump_val) { 8 | // ... 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/examples/solana/expression_this.sol: -------------------------------------------------------------------------------- 1 | contract kadowari { 2 | function nomi() public { 3 | // Contracts are not allowed as variables on Solana 4 | address a = address(this); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/examples/solana/expression_this_external_call.sol: -------------------------------------------------------------------------------- 1 | @program_id("H3AthiA2C1pcMahg17nEwqr9628gkXUnnzWJJ3iSDekL") 2 | contract kadowari { 3 | function nomi() public { 4 | this.nokogiri{accounts: []}(102); 5 | } 6 | 7 | function nokogiri(int256 a) public { 8 | // ... 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/examples/statement_destructing.sol: -------------------------------------------------------------------------------- 1 | contract destructure { 2 | function func() internal returns (bool, int32, string) { 3 | return (true, 5, "abcd"); 4 | } 5 | 6 | function test() public { 7 | string s; 8 | (bool b, , s) = func(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/examples/statement_destructing_conditional.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function test(bool cond) public { 3 | (int32 a, int32 b, int32 c) = cond ? (1, 2, 3) : (4, 5, 6); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/examples/statement_destructing_swapping.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function test() public { 3 | (int32 a, int32 b, int32 c) = (1, 2, 3); 4 | 5 | (b, , a) = (a, 5, b); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/statement_for.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo() public { 3 | for (uint256 i = 0; i <= 1000; i += 100) { 4 | // ... 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/statement_for_abort.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo(uint256 n) public { 3 | // all three omitted 4 | for (;;) { 5 | // there must be a way out 6 | if (n == 0) { 7 | break; 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/statement_if.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo(uint32 n) public { 3 | if (n > 10) { 4 | // do something 5 | } 6 | 7 | // ERROR: unlike C integers can not be used as a condition 8 | // if (n) { 9 | // // ... 10 | // } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/examples/statement_if_else.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo(uint32 n) public { 3 | if (n > 10) { 4 | // do something 5 | } else { 6 | // do something different 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/examples/statement_while.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo(uint256 n) public { 3 | while (n >= 10) { 4 | n -= 9; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/strength_reduce.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function f() public { 3 | for (uint256 i = 0; i < 10; i++) { 4 | // this multiply can be done with a 64 bit instruction 5 | g(i * 100); 6 | } 7 | } 8 | 9 | function g(uint256 v) internal { 10 | // ... 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/examples/tags.sol: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Hello, World! 3 | * @notice Just an example. 4 | * @author Sean Young 5 | */ 6 | contract c { 7 | /// @param name The name which will be greeted 8 | function say_hello(string name) public { 9 | print(string.concat("Hello, ", name, "!")); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/type_operator.sol: -------------------------------------------------------------------------------- 1 | contract example { 2 | int16 stored; 3 | 4 | function func(int256 x) public { 5 | if (x < type(int16).min || x > type(int16).max) { 6 | revert("value will not fit"); 7 | } 8 | 9 | stored = int16(x); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/unused_variable_elimination.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function test1(int256 a) public pure returns (int256) { 3 | int256 x = 5; 4 | x++; 5 | if (a > 0) { 6 | x = 5; 7 | } 8 | 9 | a = (x = 3) + a * 4; 10 | 11 | return a; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/examples/user.sol: -------------------------------------------------------------------------------- 1 | struct User { string name; uint count; } 2 | function clear_count(User memory user) { 3 | user.count = 0; 4 | } 5 | using {clear_count} for User global; 6 | -------------------------------------------------------------------------------- /docs/examples/user_defined_type.sol: -------------------------------------------------------------------------------- 1 | type Value is uint128; 2 | 3 | contract Foo { 4 | function inc_and_wrap(int128 v) public returns (Value) { 5 | return Value.wrap(uint128(v + 1)); 6 | } 7 | 8 | function dec_and_unwrap(Value v) public returns (uint128) { 9 | return Value.unwrap(v) - 1; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/examples/using_global.sol: -------------------------------------------------------------------------------- 1 | struct User { 2 | string name; 3 | uint count; 4 | } 5 | 6 | function clear_count(User memory user) { 7 | user.count = 0; 8 | } 9 | 10 | using {clear_count} for User global; 11 | -------------------------------------------------------------------------------- /docs/examples/using_imports.sol: -------------------------------------------------------------------------------- 1 | import {User} from "./user.sol"; 2 | 3 | contract c { 4 | function foo(User memory user) public { 5 | user.clear_count(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/examples/virtual_functions.sol: -------------------------------------------------------------------------------- 1 | contract a is b { 2 | function func(int256 a) public override returns (int256) { 3 | return a + 11; 4 | } 5 | } 6 | 7 | contract b { 8 | function func(int256 a) public virtual returns (int256) { 9 | return a + 10; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/extension-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-solang/solang/12a6d83b91f7f5a4cc48156e1112638e733e143a/docs/extension-config.png -------------------------------------------------------------------------------- /docs/extension-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-solang/solang/12a6d83b91f7f5a4cc48156e1112638e733e143a/docs/extension-screenshot.png -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | docutils>=0.17 2 | sphinx_rtd_theme>=0.5.2 3 | pygments-lexer-solidity>=0.7.0 4 | sphinx-a4doc>=1.2.1 5 | sphinx>=2.1.0 6 | sphinx-tabs>=3.4.1 7 | 8 | -------------------------------------------------------------------------------- /fmt/testdata/EnumDefinition/original.sol: -------------------------------------------------------------------------------- 1 | contract EnumDefinitions { 2 | enum Empty { 3 | 4 | } 5 | enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } 6 | enum States { State1, State2, State3, State4, State5, State6, State7, State8, State9 } 7 | } -------------------------------------------------------------------------------- /fmt/testdata/FunctionDefinitionWithFunctionReturns/original.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | contract ReturnFnFormat { 5 | function returnsFunction() 6 | internal 7 | pure 8 | returns ( 9 | function() 10 | internal pure returns (uint256) 11 | ) 12 | {} 13 | } -------------------------------------------------------------------------------- /fmt/testdata/HexUnderscore/bytes.fmt.sol: -------------------------------------------------------------------------------- 1 | // config: hex_underscore = "bytes" 2 | contract HexLiteral { 3 | function test() external { 4 | hex"01_23_00_00"; 5 | hex"01_23_00_00"; 6 | hex"01_23_00_00"; 7 | hex""; 8 | hex"60_01_60_02_53"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /fmt/testdata/HexUnderscore/fmt.sol: -------------------------------------------------------------------------------- 1 | contract HexLiteral { 2 | function test() external { 3 | hex"01230000"; 4 | hex"01230000"; 5 | hex"01230000"; 6 | hex""; 7 | hex"6001600253"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /fmt/testdata/HexUnderscore/original.sol: -------------------------------------------------------------------------------- 1 | contract HexLiteral { 2 | function test() external { 3 | hex"0123_0000"; 4 | hex"01230000"; 5 | hex"0123_00_00"; 6 | hex""; 7 | hex"6001_6002_53"; 8 | } 9 | } -------------------------------------------------------------------------------- /fmt/testdata/HexUnderscore/preserve.fmt.sol: -------------------------------------------------------------------------------- 1 | // config: hex_underscore = "preserve" 2 | contract HexLiteral { 3 | function test() external { 4 | hex"0123_0000"; 5 | hex"01230000"; 6 | hex"0123_00_00"; 7 | hex""; 8 | hex"6001_6002_53"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /fmt/testdata/HexUnderscore/remove.fmt.sol: -------------------------------------------------------------------------------- 1 | // config: hex_underscore = "remove" 2 | contract HexLiteral { 3 | function test() external { 4 | hex"01230000"; 5 | hex"01230000"; 6 | hex"01230000"; 7 | hex""; 8 | hex"6001600253"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /fmt/testdata/IfStatement2/fmt.sol: -------------------------------------------------------------------------------- 1 | contract IfStatement { 2 | function test() external { 3 | bool anotherLongCondition; 4 | 5 | if (condition && ((condition || anotherLongCondition))) execute(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fmt/testdata/IfStatement2/original.sol: -------------------------------------------------------------------------------- 1 | contract IfStatement { 2 | 3 | function test() external { 4 | bool anotherLongCondition; 5 | 6 | if (condition && ((condition || anotherLongCondition) 7 | ) 8 | ) execute(); 9 | } 10 | } -------------------------------------------------------------------------------- /fmt/testdata/PragmaDirective/fmt.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.17; 2 | pragma experimental ABIEncoderV2; 3 | 4 | contract Contract {} 5 | 6 | // preserves lines 7 | pragma solidity 0.8.17; 8 | 9 | pragma experimental ABIEncoderV2; 10 | -------------------------------------------------------------------------------- /fmt/testdata/PragmaDirective/original.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.17; 2 | pragma experimental ABIEncoderV2; 3 | 4 | contract Contract {} 5 | 6 | // preserves lines 7 | pragma solidity 0.8.17; 8 | 9 | pragma experimental ABIEncoderV2; -------------------------------------------------------------------------------- /fmt/testdata/StatementBlock/original.sol: -------------------------------------------------------------------------------- 1 | contract Contract { 2 | function test() { unchecked { a += 1; } 3 | 4 | unchecked { 5 | a += 1; 6 | } 7 | 2 + 2; 8 | 9 | unchecked { a += 1; 10 | } 11 | unchecked {} 12 | 13 | 1 + 1; 14 | 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /fmt/testdata/StructDefinition/bracket-spacing.fmt.sol: -------------------------------------------------------------------------------- 1 | // config: bracket_spacing = true 2 | struct Foo { } 3 | 4 | struct Bar { 5 | uint256 foo; 6 | string bar; 7 | } 8 | 9 | struct MyStruct { 10 | // first 1 11 | // first 2 12 | uint256 field1; 13 | // second 14 | uint256 field2; 15 | } 16 | -------------------------------------------------------------------------------- /fmt/testdata/StructDefinition/fmt.sol: -------------------------------------------------------------------------------- 1 | struct Foo {} 2 | 3 | struct Bar { 4 | uint256 foo; 5 | string bar; 6 | } 7 | 8 | struct MyStruct { 9 | // first 1 10 | // first 2 11 | uint256 field1; 12 | // second 13 | uint256 field2; 14 | } 15 | -------------------------------------------------------------------------------- /fmt/testdata/StructDefinition/original.sol: -------------------------------------------------------------------------------- 1 | struct Foo { 2 | } struct Bar { uint foo ;string bar ; } 3 | 4 | struct MyStruct { 5 | // first 1 6 | // first 2 7 | uint256 field1; 8 | // second 9 | uint256 field2; 10 | } 11 | -------------------------------------------------------------------------------- /fmt/testdata/TypeDefinition/fmt.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.8; 2 | 3 | type Hello is uint256; 4 | 5 | contract TypeDefinition { 6 | event Moon(Hello world); 7 | 8 | function demo(Hello world) public { 9 | world = Hello.wrap(Hello.unwrap(world) + 1337); 10 | emit Moon(world); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /fmt/testdata/TypeDefinition/original.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.8; 2 | 3 | type Hello is uint; 4 | 5 | contract TypeDefinition { 6 | event Moon(Hello world); 7 | 8 | function demo(Hello world) public { 9 | world = Hello.wrap(Hello.unwrap(world) + 1337); 10 | emit Moon(world); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /integration/anchor/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .anchor 3 | .DS_Store 4 | target/bpfel-unknown-unknown 5 | target/debug 6 | target/idl 7 | target/release 8 | target/types 9 | target/deploy/*.so 10 | **/*.rs.bk 11 | node_modules 12 | test-ledger 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /integration/anchor/.prettierignore: -------------------------------------------------------------------------------- 1 | 2 | .anchor 3 | .DS_Store 4 | target 5 | node_modules 6 | dist 7 | build 8 | test-ledger 9 | -------------------------------------------------------------------------------- /integration/anchor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "programs/*" 4 | ] 5 | 6 | [profile.release] 7 | overflow-checks = true 8 | lto = "fat" 9 | codegen-units = 1 10 | [profile.release.build-override] 11 | opt-level = 3 12 | incremental = false 13 | codegen-units = 1 14 | -------------------------------------------------------------------------------- /integration/anchor/id.json: -------------------------------------------------------------------------------- 1 | [95,177,155,238,169,94,167,151,190,138,244,231,178,206,127,162,222,2,218,144,48,157,140,53,3,245,68,234,0,52,206,111,247,41,228,226,6,2,72,238,153,164,129,142,85,222,98,186,109,176,77,230,168,43,9,188,234,101,196,25,239,70,0,118] -------------------------------------------------------------------------------- /integration/anchor/programs/anchor/Xargo.toml: -------------------------------------------------------------------------------- 1 | [target.bpfel-unknown-unknown.dependencies.std] 2 | features = [] 3 | -------------------------------------------------------------------------------- /integration/anchor/target/deploy/anchor-keypair.json: -------------------------------------------------------------------------------- 1 | [35,63,41,124,25,172,141,233,108,165,165,90,72,55,247,5,164,1,93,106,53,65,40,180,39,11,136,207,119,11,42,11,14,161,44,189,165,144,141,253,72,225,0,54,150,104,202,189,112,204,57,95,200,217,59,208,125,72,84,44,177,130,208,184] -------------------------------------------------------------------------------- /integration/anchor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": ["mocha", "chai"], 4 | "typeRoots": ["./node_modules/@types"], 5 | "lib": ["es2015"], 6 | "module": "commonjs", 7 | "target": "es6", 8 | "esModuleInterop": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /integration/polkadot/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.contract 3 | *.wasm 4 | node_modules 5 | package-lock.json -------------------------------------------------------------------------------- /integration/polkadot/asserts.sol: -------------------------------------------------------------------------------- 1 | 2 | contract asserts { 3 | int64 public var = 1; 4 | 5 | function test_assert() public { 6 | var = 2; 7 | assert(false); 8 | } 9 | 10 | function test_assert_rpc() public pure returns (int64) { 11 | revert("I refuse"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /integration/polkadot/createpair.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | import "./UniswapV2Pair.sol"; 3 | 4 | contract Creator { 5 | address public pair; 6 | 7 | constructor() public { 8 | pair = address(new UniswapV2Pair()); 9 | } 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /integration/polkadot/destruct.sol: -------------------------------------------------------------------------------- 1 | contract destruct { 2 | function hello() public pure returns (string) { 3 | return "Hello"; 4 | } 5 | 6 | function selfterminate(address payable deposit) public { 7 | selfdestruct(deposit); 8 | } 9 | } -------------------------------------------------------------------------------- /integration/polkadot/interfaces/IUniswapV2Callee.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2Callee { 4 | function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; 5 | } 6 | -------------------------------------------------------------------------------- /integration/polkadot/is_contract.sol: -------------------------------------------------------------------------------- 1 | import "polkadot"; 2 | 3 | // Partial mock of the ink! "mother" integration test. 4 | contract IsContractOracle { 5 | function contract_oracle(address _address) public view returns (bool) { 6 | return is_contract(_address); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /integration/polkadot/mgs_sender.sol: -------------------------------------------------------------------------------- 1 | contract mytoken { 2 | function test(address account, bool sender) public view returns (address) { 3 | if (sender) { 4 | return msg.sender; 5 | } 6 | return msg.sender; 7 | } 8 | } -------------------------------------------------------------------------------- /integration/polkadot/msg_sender_event.sol: -------------------------------------------------------------------------------- 1 | contract mytokenEvent { 2 | event Debugging(address b); 3 | 4 | function test() public { 5 | emit Debugging(msg.sender); 6 | } 7 | } -------------------------------------------------------------------------------- /integration/polkadot/release_version.sol: -------------------------------------------------------------------------------- 1 | contract release { 2 | function print_then_error(int8 num) public returns (int8) { 3 | print("Hello!"); 4 | int8 ovf = num + 120; 5 | return ovf; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /integration/polkadot/test/ERC20.sol: -------------------------------------------------------------------------------- 1 | pragma solidity =0.5.16; 2 | 3 | import '../UniswapV2ERC20.sol'; 4 | 5 | contract ERC20 is UniswapV2ERC20 { 6 | constructor(uint _totalSupply) public { 7 | _mint(msg.sender, _totalSupply); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /integration/solana/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.so 3 | *.key 4 | *.json 5 | !tsconfig.json 6 | !package.json 7 | node_modules 8 | package-lock.json 9 | -------------------------------------------------------------------------------- /integration/solana/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension": ["ts"], 3 | "node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"] 4 | } 5 | -------------------------------------------------------------------------------- /integration/solana/Child.key: -------------------------------------------------------------------------------- 1 | [22,29,109,207,133,109,106,221,182,216,89,188,142,249,161,83,134,165,136,17,124,166,96,251,103,228,77,206,204,96,147,190,173,222,40,214,197,105,119,113,187,36,166,104,19,98,36,199,170,200,232,186,151,76,40,129,72,73,115,178,231,98,251,116] -------------------------------------------------------------------------------- /integration/solana/Creature.key: -------------------------------------------------------------------------------- 1 | [178,34,166,253,17,119,204,242,46,85,115,254,58,182,101,68,87,86,70,255,200,116,164,189,217,196,212,236,2,233,123,242,176,39,248,225,251,241,236,215,8,185,170,27,236,112,83,100,77,75,37,15,98,9,111,75,82,213,162,183,123,34,183,181] -------------------------------------------------------------------------------- /integration/solana/MyCreature.key: -------------------------------------------------------------------------------- 1 | [142,133,49,70,40,211,189,33,145,137,236,147,103,244,109,168,121,51,95,90,157,169,250,130,147,236,48,186,86,232,131,133,114,29,179,43,64,68,123,172,216,9,188,236,189,2,240,61,50,213,75,83,51,86,132,242,189,155,182,170,210,173,98,33] -------------------------------------------------------------------------------- /integration/solana/Seed1.key: -------------------------------------------------------------------------------- 1 | [23,157,201,18,20,73,143,33,228,129,196,230,82,232,158,45,161,7,155,190,142,201,163,209,114,238,64,20,4,65,198,101,6,146,22,251,35,126,14,127,195,135,51,66,141,46,223,162,129,179,5,46,225,220,0,166,81,132,251,10,36,29,96,190] -------------------------------------------------------------------------------- /integration/solana/Seed2.key: -------------------------------------------------------------------------------- 1 | [68,37,175,111,194,101,182,111,251,59,38,86,245,131,7,63,97,185,7,226,227,201,115,75,70,5,115,77,201,226,70,38,6,146,22,245,26,166,41,195,23,73,206,57,201,114,245,11,45,240,66,60,15,155,141,208,59,145,236,114,51,251,36,60] -------------------------------------------------------------------------------- /integration/solana/UserStats.key: -------------------------------------------------------------------------------- 1 | [71,111,159,74,62,29,145,33,39,96,158,63,115,65,118,23,2,210,104,73,172,92,61,142,21,132,76,189,217,64,174,182,227,224,93,34,40,170,119,26,112,243,87,225,85,23,105,182,7,158,10,174,153,76,114,42,141,51,72,20,71,17,191,223] -------------------------------------------------------------------------------- /integration/solana/errors.sol: -------------------------------------------------------------------------------- 1 | contract errors { 2 | function do_revert(bool yes) pure public returns (int) { 3 | if (yes) { 4 | print("Going to revert"); 5 | revert("Do the revert thing"); 6 | } else { 7 | return 3124445; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /integration/solana/verify_sig.sol: -------------------------------------------------------------------------------- 1 | 2 | contract verify_sig { 3 | function verify(address addr, bytes message, bytes signature) public view returns (bool) { 4 | return signatureVerify(addr, message, signature); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /integration/soroban/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.key 3 | *.json 4 | !tsconfig.json 5 | !package.json 6 | node_modules 7 | package-lock.json 8 | *.txt 9 | *.toml 10 | *.wasm 11 | *.abi 12 | target/ 13 | .stellar/ 14 | -------------------------------------------------------------------------------- /integration/soroban/c.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function get_num(address a) public returns (uint64) { 3 | a.requireAuth(); 4 | return 2; 5 | } 6 | } -------------------------------------------------------------------------------- /integration/soroban/callee.sol: -------------------------------------------------------------------------------- 1 | contract callee { 2 | function add (uint64 a, uint64 b, uint64 c) public returns (uint64) { 3 | print("add called in Solidity"); 4 | return a + b +c; 5 | } 6 | } -------------------------------------------------------------------------------- /integration/soroban/caller.sol: -------------------------------------------------------------------------------- 1 | contract caller { 2 | function add (address addr, uint64 a, uint64 b, uint64 c) public returns (uint64) { 3 | bytes payload = abi.encode("add", a, b, c); 4 | (bool suc, bytes returndata) = addr.call(payload); 5 | uint64 result = abi.decode(returndata, (uint64)); 6 | return result; 7 | } 8 | } -------------------------------------------------------------------------------- /integration/soroban/counter.sol: -------------------------------------------------------------------------------- 1 | contract counter { 2 | uint64 public count = 10; 3 | 4 | function increment() public returns (uint64) { 5 | count += 1; 6 | return count; 7 | } 8 | 9 | function decrement() public returns (uint64) { 10 | count -= 1; 11 | return count; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /integration/soroban/runtime_error.sol: -------------------------------------------------------------------------------- 1 | contract Error { 2 | uint64 count = 1; 3 | 4 | /// @notice Calling this function twice will cause an overflow 5 | function decrement() public returns (uint64){ 6 | count -= 1; 7 | return count; 8 | } 9 | } -------------------------------------------------------------------------------- /integration/subxt-tests/.gitignore: -------------------------------------------------------------------------------- 1 | contracts/ 2 | target/ 3 | -------------------------------------------------------------------------------- /integration/subxt-tests/metadata.scale: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-solang/solang/12a6d83b91f7f5a4cc48156e1112638e733e143a/integration/subxt-tests/metadata.scale -------------------------------------------------------------------------------- /solang-parser/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | fn main() { 4 | lalrpop::Configuration::new() 5 | .use_cargo_dir_conventions() 6 | .emit_rerun_directives(true) 7 | .process() 8 | .unwrap(); 9 | } 10 | -------------------------------------------------------------------------------- /solang-parser/src/helpers/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | //! Helper functions and traits for parse tree types. 4 | 5 | mod fmt; 6 | 7 | mod loc; 8 | pub use loc::{CodeLocation, OptionalCodeLocation}; 9 | 10 | mod ord; 11 | -------------------------------------------------------------------------------- /src/codegen/yul/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | mod expression; 4 | -------------------------------------------------------------------------------- /stdlib/.clang-format: -------------------------------------------------------------------------------- 1 | ReflowComments: false 2 | BasedOnStyle: Microsoft 3 | SortIncludes: Never -------------------------------------------------------------------------------- /stdlib/.gitignore: -------------------------------------------------------------------------------- 1 | wasm/ 2 | bpf/ -------------------------------------------------------------------------------- /testdata/solang_import_resolution_tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | **/.solang_out*/ 3 | **/Contract.json 4 | -------------------------------------------------------------------------------- /testdata/solang_import_resolution_tests/05_import_path_order_should_not_matter/contracts/nested1/A.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract A { 6 | function add(uint256 a, uint256 b) public pure returns (uint256) { 7 | return a * b; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /testdata/solang_import_resolution_tests/05_import_path_order_should_not_matter/contracts/nested2/A.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract A { 6 | function add(uint256 a, uint256 b) public pure returns (uint256) { 7 | return a + b; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.wasm 2 | c.json 3 | rel.json 4 | *.so 5 | *.contract 6 | -------------------------------------------------------------------------------- /tests/codegen_testcases/import_test.sol: -------------------------------------------------------------------------------- 1 | @program_id("6qEm4QUJGFvqKNJGjTrAEiFhbVBY4ashpBjDHEFvEUmW") 2 | contract Dog { 3 | function barks(string what) public pure { 4 | print(what); 5 | } 6 | } -------------------------------------------------------------------------------- /tests/codegen_testcases/solidity/const_fail.sol: -------------------------------------------------------------------------------- 1 | // RUN: --target polkadot --emit cfg 2 | contract c { 3 | function divide_zero() public pure returns (uint32) { 4 | uint32 x = 2; 5 | x = x / 0; 6 | // FAIL: divide by zero 7 | return x; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/codegen_testcases/solidity/named_mappings.sol: -------------------------------------------------------------------------------- 1 | // RUN: --target solana --emit cfg 2 | contract Concise { 3 | // CHECK: params: address owner,int64 bar 4 | // CHECK: returns: uint256 balance 5 | // CHECK: ty:address %owner = (arg #0) 6 | mapping(address owner => mapping(int64 bar => uint256 balance) foo) public balanceOf; 7 | } 8 | -------------------------------------------------------------------------------- /tests/codegen_testcases/solidity/temp1.sol: -------------------------------------------------------------------------------- 1 | // RUN: --target polkadot --emit cfg 2 | contract c { 3 | function test() public pure returns (int32) { 4 | int32 x = 104; 5 | int32 t = x; 6 | x += 1; 7 | // CHECK: return int32 104 8 | return t; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/codegen_testcases/solidity/temp2.sol: -------------------------------------------------------------------------------- 1 | // RUN: --target polkadot --emit cfg 2 | contract c { 3 | event f(bool); 4 | 5 | function test() public returns (int32) { 6 | int32 x = 104; 7 | emit f(true); 8 | x = x + 1; 9 | emit f(false); 10 | // CHECK: return int32 105 11 | return x; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/bad_pragmas.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 1.2.3.4; 2 | 3 | // ---- Expect: diagnostics ---- 4 | // error: 1:17-24: no more than three numbers allowed - major.minor.patch 5 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/builtins/abi_decode_unit_1.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | function g() public pure { 3 | abi.decode("abc", ()); 4 | } 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/builtins/abi_decode_unit_2.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | function f() public pure { 3 | int a =abi.decode("abc", ()); 4 | } 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:16-37: function or method does not return a value 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/builtins/address_code_03.sol: -------------------------------------------------------------------------------- 1 | contract UpgradeableProxy { 2 | function _setImplementation( 3 | address newImplementation 4 | ) public view returns (bytes memory) { 5 | return newImplementation.code; 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/call/call.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | function f(address payable a) public { 4 | (bool s, bytes memory bs) = a.delegatecall{value: 2}(""); 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 4:45-73: 'delegatecall' cannot have value specified 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/call/call_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | function f(address payable a) public { 4 | (bool s, bytes memory bs) = a.staticcall{value: 2}(""); 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 4:45-71: 'staticcall' cannot have value specified 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/ecrecover.sol: -------------------------------------------------------------------------------- 1 | contract signed { 2 | function recoverSignerFromSignature(uint8 v, bytes32 r, bytes32 s, bytes32 hash) pure external { 3 | address signer = ecrecover(hash, v, r, s); 4 | require(signer != address(0), "ECDSA: invalid signature"); 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/named_mappings.sol: -------------------------------------------------------------------------------- 1 | contract Concise { 2 | mapping(address owner => uint256 balance) public balanceOf; 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/public_internal_function.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | struct A { 3 | function() internal a; 4 | } 5 | 6 | A[] public map; 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:5-8: variable of type internal function cannot be 'public' 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/evm/public_mapping.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | struct A { 3 | mapping(uint64 => uint64) a; 4 | } 5 | 6 | A[] public map; 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 6:5-19: mapping in a struct variable cannot be public 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/array_dimensions.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | bool[10 - 10] x; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:18-25: zero size array not permitted 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/array_dimensions_01.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | bool[-10 + 10] x; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:18-26: zero size array not permitted 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/array_dimensions_02.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | bool[1 / 10] x; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:18-24: zero size array not permitted 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/array_dimensions_03.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | enum e { e1, e2, e3 } 4 | e[1 / 0] x; 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 4:15-20: divide by zero 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/array_dimensions_04.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | struct bar { 4 | int32 x; 5 | } 6 | bar[1 % 0] x; 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 6:17-22: divide by zero 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/data_locations.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract foo { 3 | function bar(uint storage) public returns () { 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:31-38: data location 'storage' can only be specified for array, struct or mapping 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/data_locations_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | function bar(uint calldata x) public returns () { 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:31-39: data location 'calldata' can only be specified for array, struct or mapping 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/multi_dim.sol: -------------------------------------------------------------------------------- 1 | // https://github.com/hyperledger-solang/solang/issues/860 2 | contract c { 3 | function test() public pure returns (uint256 ret1) { 4 | uint256[3][] vec; 5 | vec.push([1, 2, 3]); 6 | return vec[1][1]; 7 | } 8 | } 9 | 10 | // ---- Expect: diagnostics ---- 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/push_array_literal.sol: -------------------------------------------------------------------------------- 1 | // https://github.com/hyperledger-solang/solang/issues/859 2 | contract c { 3 | uint256[3][] s_vec; 4 | function test() public returns (uint256 ret1) { 5 | s_vec.push([1, 2, 3]); 6 | return s_vec[1][1]; 7 | } 8 | } 9 | 10 | // ---- Expect: diagnostics ---- 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/arrays/storage_delete_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | int32[] bar; 4 | 5 | function test() public { 6 | int32 x = delete bar; 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:27-37: delete not allowed in expression 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_decode.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | (int a) = abi.decode(hex"00", feh); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:47-50: type 'feh' not found 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_decode_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | (int a) = abi.decode(hex"00", (int feh)); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:52-55: unexpected identifier 'feh' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_decode_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | (int a) = abi.decode(hex"00", (int,)); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:52: stray comma 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_decode_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | (int a) = abi.decode(hex"00", (int,mapping(uint[] => address))); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:60-66: key of mapping cannot be array type 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_encode_with_selector.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | bytes x = abi.encodeWithSelector(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:27-51: function requires one 'bytes4' selector argument 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/abi_encode_with_signature.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public { 4 | bytes x = abi.encodeWithSignature(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:27-52: function requires one 'string' signature argument 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/address_code_02.sol: -------------------------------------------------------------------------------- 1 | contract UpgradeableProxy { 2 | function _setImplementation(address newImplementation) public view { 3 | assert(newImplementation.code.length != 0); 4 | } 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:16-33: 'address.code' is not supported on Polkadot 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/call.sol: -------------------------------------------------------------------------------- 1 | contract main { 2 | function test() public { 3 | address x = address(0); 4 | 5 | x.delegatecall(hex"1222"); 6 | } 7 | } 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/functions_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract bar { 3 | function test() public { 4 | bytes32 b = blockhash(1); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:29-38: unknown function or type 'blockhash' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/builtins/msg_01.sol: -------------------------------------------------------------------------------- 1 | contract bar { 2 | uint128 state; 3 | function test(uint128 v) public returns (bool) { 4 | return state > v; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // warning: 3:2-48: function can be declared 'view' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/payable_functions.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | receive() public { 4 | 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 3:13-29: receive function must be declared external 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/payable_functions_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | receive() external { 4 | 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 3:13-31: receive function must be declared payable 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/payable_functions_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | fallback() payable external { 4 | 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 3:13-40: fallback function must not be declare payable, use 'receive() external payable' instead 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/payable_functions_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | fallback() public { 4 | 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 3:13-30: fallback function must be declared external 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/try_catch_constructor_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function f() public { 4 | x : 1 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:33-5:14: expected code block, not list of named arguments 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/calls/try_catch_constructor_07.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | function c() public { 3 | try new A() {} catch Panic(uint) {} 4 | } 5 | } 6 | 7 | contract A { 8 | function a() public pure {} 9 | } 10 | 11 | // ---- Expect: diagnostics ---- 12 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/constructor_names.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | constructor my_constructor () {} 3 | 4 | function foo() public pure {} 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_name.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function test() public {} 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:13-35: function cannot have same name as the contract 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_name_01.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | enum test { a} 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:18-22: test is already defined as a contract name 6 | // note 1:1-3:10: location of previous definition 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_name_03.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | struct test { bool a; } 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:20-24: test is already defined as a contract name 6 | // note 1:1-3:10: location of previous definition 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_public_functions_02.sol: -------------------------------------------------------------------------------- 1 | contract a { 2 | fallback() external {} 3 | } 4 | 5 | contract b { 6 | receive() external payable {} 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_type_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public returns (printer) { 4 | return new printer(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-37: new cannot construct current contract 'printer' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/contract_type_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract printer { 3 | function test() public returns (printer) { 4 | return new printer({}); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-39: new cannot construct current contract 'printer' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/contracts/creation_code_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract a { 3 | function test() public { 4 | bytes code = type(a).runtimeCode; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:34-53: cannot construct current contract 'a' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/enums/incorrect_fields.sol: -------------------------------------------------------------------------------- 1 | enum state { } 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:6-11: enum 'state' has no fields 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/enums/test_cast_errors_02.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | enum state { foo, bar, baz } 3 | function foo() public pure returns (uint8) { 4 | return uint8(state.foo); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/errors/custom_error_01.sol: -------------------------------------------------------------------------------- 1 | error Unauthorized(); 2 | 3 | contract VendingMachine { 4 | function withdraw() public pure { 5 | revert Unauthorized(); 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/errors/custom_error_02.sol: -------------------------------------------------------------------------------- 1 | error Unauthorized(bytes b); 2 | 3 | contract VendingMachine { 4 | function withdraw() public pure { 5 | revert Unauthorized("foo"); 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/errors/custom_error_04.sol: -------------------------------------------------------------------------------- 1 | error Unauthorized(bool); 2 | 3 | contract VendingMachine { 4 | function withdraw() public pure { 5 | revert Unauthorized("foo"); 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | // error: 5:29-34: conversion from bytes3 to bool not possible 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/errors/custom_error_05.sol: -------------------------------------------------------------------------------- 1 | contract A { 2 | struct Bar { 3 | uint foo; 4 | string bar; 5 | } 6 | error Foo(Bar); 7 | 8 | function a() public pure { 9 | revert Foo(Bar({foo: 123, bar: "bar"})); 10 | } 11 | } 12 | 13 | // ---- Expect: diagnostics ---- 14 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/emit.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function f() public { 4 | emit 1 (); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-25: unrecognised token '(', expected "++", "--", ".", "[", "case", "default", "leave", "switch", identifier 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/emit_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | event foo(bool); 4 | function f() public { 5 | emit foo {}; 6 | } 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 5:26-28: expected event arguments, found code block 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/emit_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | event foo(bool,uint32); 4 | function f() public { 5 | emit foo ({a:true, a:"ab"}); 6 | } 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 5:36-37: duplicate argument with name 'a' 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract c { 3 | event foo (); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_01.sol: -------------------------------------------------------------------------------- 1 | 2 | enum e { a1 } 3 | event e(); 4 | // ---- Expect: diagnostics ---- 5 | // error: 3:15-16: e is already defined as an enum 6 | // note 2:14-15: location of previous definition 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_02.sol: -------------------------------------------------------------------------------- 1 | 2 | enum e { a1 } 3 | abstract contract c { 4 | event e(); 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // warning: 4:19-20: e is already defined as an enum 8 | // note 2:14-15: location of previous definition 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | enum e { a1 } 4 | event e(); 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 4:19-20: e is already defined as an enum 8 | // note 3:18-19: location of previous definition 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | event foo (mapping (bool => uint) x); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:24-48: mapping type is not permitted as event field 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_05.sol: -------------------------------------------------------------------------------- 1 | 2 | struct s { 3 | mapping (bool => uint) f1; 4 | } 5 | 6 | contract c { 7 | event foo (s x); 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 7:24-27: mapping type is not permitted as event field 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_06.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | event foo (bool x, uint32 y, address x); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:50-51: event 'foo' has duplicate field name 'x' 7 | // note 3:24-30: location of previous declaration of 'x' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_07.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | event foo (bool indexed f1, bool indexed f2, bool indexed f3, bool indexed f4); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:19-22: event definition for 'foo' has 4 indexed fields where 3 permitted 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_08.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract c { 3 | event foo (bool indexed f1, bool indexed f2, bool indexed f3); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_10.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract c { 3 | event foo (bool indexed f1, bool indexed f2, bool indexed f3, bool indexed f4) anonymous; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/events/event_decl_11.sol: -------------------------------------------------------------------------------- 1 | abstract contract c { 2 | event foo(bool x, uint32 y, address indexed); 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:33-48: indexed event fields must have a name on polkadot 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/destructure_01.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo(uint bar) public { 3 | int a; 4 | int b; 5 | 6 | (c, b) = (1, 2); 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:18-19: 'c' not found 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/destructure_03.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo(uint bar) public { 3 | int a; 4 | int b; 5 | 6 | (a , b) = (1, ); 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:31: stray comma 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/power.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function power(uint64 base, int64 exp) public returns (uint64) { 3 | return base ** exp; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:24-35: exponation (**) is not allowed with signed types 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/power_01.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function power(int64 base, uint64 exp) public returns (int64) { 3 | return base ** exp; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:24-35: exponation (**) is not allowed with signed types 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/power_02.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function power(int64 base, int64 exp) public returns (int64) { 3 | return base ** exp; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:24-35: exponation (**) is not allowed with signed types 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/test_cast_errors.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo(uint bar) public { 3 | bool is_nonzero = bar; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:35-38: conversion from uint256 to bool not possible 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/expressions/test_cast_errors_01.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foobar(uint foo, int bar) public returns (bool) { 3 | return (foo < bar); 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:25-28: implicit conversion would change sign from uint256 to int256 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/first/simple_solidiy_compile_and_run.sol: -------------------------------------------------------------------------------- 1 | 2 | // ---- Expect: diagnostics ---- 3 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "foo"; 5 | 6 | s.format(); 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:17-27: format only allowed on string literals 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "foo{".format(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:31-34: missing closing '}' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "foo{d".format(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:32-35: unexpected format char 'd' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "foo{:".format(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:31-35: missing format specifier 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "foo{:}s".format(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:31-37: missing argument to format 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "f{{oo}s".format(); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-37: unmatched '}' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_06.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "f{{oo}}s".format(true); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:28-51: too many argument for format string 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/format/parse_07.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string s = "{}" "{:x}s".format(1, true); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:51-55: argument must be signed or unsigned integer type 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo() public { 3 | function() public a; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:28-34: function type cannot have visibility 'public' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_01.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo() public { 3 | function() private a; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:28-35: function type cannot have visibility 'private' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_02.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo() public { 3 | function() returns (bool) internal a; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:43-51: function type cannot have visibility 'internal' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_03.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo() public { 3 | function() returns (bool) pure a; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:43-47: mutability 'pure' cannot be declared after returns 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_06.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo(function(address) pure internal returns (bool) a) public { 3 | } 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:26-72: parameter of type 'function internal' not allowed public or external functions 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_07.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function foo() public returns (function(address) pure internal returns (bool) a) { 3 | } 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:44-90: return type 'function internal' not allowed in public or external functions 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/decls_08.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function(address) pure internal returns (bool) public a; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:13-66: variable of type internal function cannot be 'public' 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/function_types/recursive_01.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | struct S { 3 | int f1; 4 | S[] f2; 5 | } 6 | 7 | function foo(S s) public {} 8 | } 9 | 10 | // ---- Expect: diagnostics ---- 11 | // error: 7:2-26: Recursive parameter not allowed for public or external functions. 12 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/args_and_returns.sol: -------------------------------------------------------------------------------- 1 | 2 | contract args { 3 | function foo(bool arg1, uint arg1) public { 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:38-42: arg1 is already declared 8 | // note 3:27-31: location of previous declaration 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/args_and_returns_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract args { 3 | function foo(bool arg1, uint arg2) public returns (address arg2, uint) { 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:68-72: arg2 is already declared 8 | // note 3:38-42: location of previous declaration 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/constructor_override_01.sol: -------------------------------------------------------------------------------- 1 | abstract contract C { 2 | constructor() payable {} 3 | 4 | constructor(uint256 foo) payable {} 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // warning: 4:25-28: function parameter 'foo' is unused 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/constructor_override_02.sol: -------------------------------------------------------------------------------- 1 | abstract contract C { 2 | constructor bar() {} 3 | 4 | constructor foo(uint256 foo) {} 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // warning: 4:29-32: function parameter 'foo' is unused 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/constructors.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract test { 3 | constructor() internal {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // warning: 3:27-35: 'internal': visibility for constructors is ignored 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/constructors_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract test { 3 | constructor() virtual {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-34: constructors cannot be declared 'virtual' 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions.sol: -------------------------------------------------------------------------------- 1 | 2 | function() {} 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:9-19: missing function name 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_01.sol: -------------------------------------------------------------------------------- 1 | 2 | function x(); 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:9-21: missing function body 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_02.sol: -------------------------------------------------------------------------------- 1 | 2 | function x() virtual {} 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:22-29: only functions in contracts can be virtual 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_03.sol: -------------------------------------------------------------------------------- 1 | 2 | function x() override {} 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:22-30: only functions in contracts can override 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_04.sol: -------------------------------------------------------------------------------- 1 | 2 | function x() feyla {} 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:22-27: function modifiers or base contracts are only allowed on functions in contracts 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_05.sol: -------------------------------------------------------------------------------- 1 | 2 | function x() feyla {} 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:22-27: function modifiers or base contracts are only allowed on functions in contracts 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/global_functions_06.sol: -------------------------------------------------------------------------------- 1 | 2 | event foo(bool); 3 | 4 | function x() pure { emit foo(true); } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 4:29-43: function declared 'pure' but this expression writes to state 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mangling_02.sol: -------------------------------------------------------------------------------- 1 | struct B { bool foo; } 2 | 3 | // ---- Expect: diagnostics ---- 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_04.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | function bar(int[] storage foo) internal view { 3 | foo[0] = 102; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:17-23: function declared 'view' but this expression writes to state 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_06.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function add(address a) public returns (bool f, bytes res) { 3 | (f, res) = a.call(hex"0102"); 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_07.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function add(address a) public returns (bool f, bytes res) { 3 | return true; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:17-28: incorrect number of return values, expected 2 but got 1 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_08.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | int64 foo = 1844674; 3 | 4 | function bar() public payable returns (int64) { 5 | return foo; 6 | } 7 | } 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_09.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function bar() public payable returns (int64) { 3 | return 102; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_10.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function bar() public view returns (int64) { 3 | return 102; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // warning: 2:13-55: function declared 'view' can be declared 'pure' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/mutability_11.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | int64 constant public foo = 1844674; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/return_not_returns.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function bar() public pure return (int64) { 3 | return 1; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:40-46: 'return' unexpected. Did you mean 'returns'? 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/scopes.sol: -------------------------------------------------------------------------------- 1 | 2 | contract test { 3 | function goodset() public returns (bool) { 4 | { 5 | bool a = true; 6 | } 7 | return a; 8 | } 9 | } 10 | // ---- Expect: diagnostics ---- 11 | // error: 7:20-21: 'a' not found 12 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/stray_semicolon.sol: -------------------------------------------------------------------------------- 1 | struct a { uint32 f1; }; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:24-25: stray semicolon 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/functions/stray_semicolon_01.sol: -------------------------------------------------------------------------------- 1 | abstract contract x { struct a { uint32 f1; }; } 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:46-47: stray semicolon 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_01.sol: -------------------------------------------------------------------------------- 1 | 2 | interface foo { 3 | function bar() external {} 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:13-36: function in an interface cannot have a body 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_02.sol: -------------------------------------------------------------------------------- 1 | 2 | interface foo { 3 | function bar() private; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:13-35: function marked 'virtual' cannot also be 'private' 8 | // error: 3:13-35: functions must be declared 'external' in an interface 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_03.sol: -------------------------------------------------------------------------------- 1 | 2 | interface foo { 3 | function bar() internal; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:13-36: functions must be declared 'external' in an interface 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_06.sol: -------------------------------------------------------------------------------- 1 | 2 | interface bar { 3 | function foo() virtual external; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // warning: 3:28-35: functions in an interface are implicitly virtual 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_07.sol: -------------------------------------------------------------------------------- 1 | 2 | interface bar { 3 | int x; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:13-18: interface 'bar' is not allowed to have contract variable 'x' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_interface_08.sol: -------------------------------------------------------------------------------- 1 | 2 | interface bar { 3 | int constant x = 1; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:13-31: interface 'bar' is not allowed to have contract variable 'x' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_override_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract base { 3 | function foo(uint64 a) override private returns (uint64) { 4 | return a + 102; 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 3:13-69: 'foo' does not override anything 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_super.sol: -------------------------------------------------------------------------------- 1 | contract super { 2 | 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 1:1-3:2: contracts without public storage or functions are not allowed on Polkadot. Consider declaring this contract abstract: 'abstract contract super' 6 | // warning: 1:10-15: 'super' shadows name of a builtin 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_super_01.sol: -------------------------------------------------------------------------------- 1 | 2 | function f1() { super.a(); } 3 | 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:25-34: super not available outside contracts 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_virtual.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test() public; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-35: function with no body missing 'virtual'. This was permitted in older versions of the Solidity language, please update. 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/inheritance/test_virtual_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test() virtual public {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | constructor() {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-27: constructor not allowed in a library 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_01.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | receive() internal {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-31: receive not allowed in a library 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_02.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | fallback() internal {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-32: fallback not allowed in a library 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_04.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | function foo() virtual public {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-35: functions in a library cannot be virtual 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_05.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | function foo() override public {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-36: function in a library cannot override 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_06.sol: -------------------------------------------------------------------------------- 1 | 2 | library c is x { 3 | fallback() internal {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:22-23: library 'c' cannot have a base contract 7 | // error: 2:22-23: 'x' not found 8 | // error: 3:13-32: fallback not allowed in a library 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/restrictions_08.sol: -------------------------------------------------------------------------------- 1 | 2 | library c { 3 | int x; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:13-18: library 'c' is not allowed to have contract variable 'x' 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/using.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | using x for x; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:25-26: type 'x' not found 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/libraries/using_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | constructor() {} 4 | } 5 | 6 | contract c { 7 | using x for x; 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 7:19-20: library expected but contract 'x' found 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | mapping(uint[] => address) data; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:21-27: key of mapping cannot be array type 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | struct foo { 4 | int x; 5 | } 6 | mapping(foo => address) data; 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 6:21-24: key of mapping cannot be struct type 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | mapping(int => address) data; 4 | mapping(data => address) data2; 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 4:21-25: 'data' is a contract variable 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test(mapping(int => address) x) public { 4 | // 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:27-50: parameter with mapping type must be of type 'storage' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test(mapping(int => address) storage x) public { 4 | // 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:51-58: parameter of type 'storage' not allowed public or external functions 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/mappings/bad_mapping_declares_06.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test() public returns (mapping(int => address) x) { 4 | // 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:45-68: return type containing mapping must be of type 'storage' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() public {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-34: 'public': modifiers can not have visibility 7 | // error: 3:37: missing '_' in modifier 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() internal {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-36: 'internal': modifiers can not have visibility 7 | // error: 3:39: missing '_' in modifier 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() payable {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-35: modifier cannot have mutability specifier 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() pure {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:28-32: modifier cannot have mutability specifier 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo bar {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:26-29: function modifiers or base contracts are not allowed on modifier 7 | // error: 3:32: missing '_' in modifier 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_05.sol: -------------------------------------------------------------------------------- 1 | 2 | abstract contract c { 3 | modifier foo() {} 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:30: missing '_' in modifier 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_08.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function bar() public { 4 | _; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:17-18: '_' not found 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/declare_09.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | function bar() public pure { 3 | _; _(); 4 | } 5 | function _() private pure {} 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/function_modifier.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() { _; } 4 | 5 | function bar() foo2 public {} 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 5:28-32: unknown modifier 'foo2' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/modifier/function_modifier_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | modifier foo() { _; } 4 | 5 | function bar() foo(1) public {} 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 5:28-34: modifier expects 0 arguments, 1 provided 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/address_05.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | address foo = address"5GBWmgdFAMqm8ZgAHGobqDqX6tjLxJhv53ygjNtaaAn3sjeZ"; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:13-84: storage variable 'foo' has been assigned, but never read 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/address_09.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | address foo = 0x5b0Ddf2835f0A76c96D6113D47F6482e51a55487; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:27-69: ethereum address literal '0x5b0Ddf2835f0A76c96D6113D47F6482e51a55487' not supported on target Polkadot 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/bytes_02.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function foo() public pure { 3 | uint16 i = 0x0_00AA; 4 | bytes3(0x0_00AA); 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // error: 4:9-25: number of 1 bytes cannot be converted to type 'bytes3' 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint8 foo = 300; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:25-28: value 300 does not fit into type uint8. 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_04.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | int8 foo = 127; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:13-27: storage variable 'foo' has been assigned, but never read 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_05.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | int8 foo = -128; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:13-28: storage variable 'foo' has been assigned, but never read 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_06.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint8 foo = 255; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:13-28: storage variable 'foo' has been assigned, but never read 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_07.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint8 foo = -1_30; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:25-30: negative value -130 does not fit into type uint8. Cannot implicitly convert signed literal to unsigned type. 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_08.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | int64 foo = 1844674_4073709551616; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:25-46: value 18446744073709551616 does not fit into type int64. 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_09.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | bytes4 foo = 0xf12233; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:26-34: hex literal 0xf12233 must be 8 digits for type 'bytes4' 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_10.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | bytes4 foo = 0x0122334455; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:26-38: hex literal 0x0122334455 must be 8 digits for type 'bytes4' 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/test_literal_overflow_11.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | bytes4 foo = 0x00223344; 3 | } 4 | // ---- Expect: diagnostics ---- 5 | // warning: 2:13-36: storage variable 'foo' has been assigned, but never read 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/type_name.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test() public { 4 | int32 x = type(bool).max; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:27-41: type 'bool' does not have type function max 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/primitives/units_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function test() public { 4 | int32 x = 0xa days; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:27-35: hexadecimal numbers cannot be used with unit denominations 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/basic_tests_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | bytes f = new string(2); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:31-44: conversion from string to bytes not possible 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/basic_tests_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = new bytes(2); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:32-44: conversion from bytes to string not possible 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\x"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-34: \x escape should be followed by two hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\x9k"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-36: \x escape should be followed by two hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\xたこ"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-37: \x escape should be followed by two hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\u"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-34: \u escape should be followed by four hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\uたこ焼き"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-37: \u escape should be followed by four hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | function foo() public { 4 | string f = "\u9kff"; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:33-36: \u escape should be followed by four hex digits 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/strings/string_escape_06.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function bar() public pure returns (bytes4) { 3 | return "ABC\xff"; 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_04.sol: -------------------------------------------------------------------------------- 1 | 2 | contract test_struct_parsing { 3 | struct Foo { 4 | } 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:20-23: struct definition for 'Foo' has no fields 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract test_struct_parsing { 3 | struct Foo { 4 | boolean x; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:17-24: type 'boolean' not found 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_17.sol: -------------------------------------------------------------------------------- 1 | struct A { B b; } 2 | struct B { A[] a; mapping(uint=>A) m; } 3 | struct C { B b; D d; } 4 | struct D { uint e; } 5 | abstract contract Foo {} 6 | 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_19.sol: -------------------------------------------------------------------------------- 1 | struct A { B b; } 2 | struct B { A a; } 3 | // ---- Expect: diagnostics ---- 4 | // error: 1:8-9: struct 'A' has infinite size 5 | // note 1:12-15: recursive field 'b' 6 | // error: 2:8-9: struct 'B' has infinite size 7 | // note 2:12-15: recursive field 'a' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_20.sol: -------------------------------------------------------------------------------- 1 | struct A { B b; } 2 | struct B { A[] a; } 3 | // ---- Expect: diagnostics ---- 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/structs/parse_structs_23.sol: -------------------------------------------------------------------------------- 1 | contract Fptr { 2 | struct S { int ff; function (S memory) external fptr; } 3 | function func(S memory) public pure {} 4 | } 5 | 6 | 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/contract.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @barf 3 | abstract contract test {} 4 | // ---- Expect: diagnostics ---- 5 | // error: 2:14-3:1: tag '@barf' is not valid for contract 6 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/contract_01.sol: -------------------------------------------------------------------------------- 1 | 2 | /// So 3 | /// @title Test 4 | /// @notice Hello, 5 | /// @notice World 6 | /// @author Mr Foo 7 | /// @dev this is 8 | /// a contract 9 | abstract contract test {} 10 | // ---- Expect: diagnostics ---- 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/contract_02.sol: -------------------------------------------------------------------------------- 1 | 2 | /// So 3 | /// @title Test 4 | /// @notice Hello, 5 | /// @notice World 6 | /** @author Mr Foo 7 | * @dev this is 8 | * a contract 9 | */ 10 | abstract contract test {} 11 | // ---- Expect: diagnostics ---- 12 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/enum_tag.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param 3 | enum x { 4 | foo1 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:14-3:1: tag '@param' is not valid for enum 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/enum_tag_01.sol: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @dev bla bla bla 4 | * @author f2 bar */ 5 | enum x { x1 } 6 | // ---- Expect: diagnostics ---- 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/event_tag.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param 3 | event x ( 4 | uint32 f 5 | ); 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:14-19: tag '@param' missing parameter name 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/event_tag_01.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param g 3 | event x ( 4 | uint32 f 5 | ); 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:20-21: function parameter named 'g' not found 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/event_tag_03.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param f1 asdad 3 | /// @param f2 bar 4 | event x ( 5 | uint32 f1, 6 | uint32 f2 7 | ); 8 | // ---- Expect: diagnostics ---- 9 | // warning: 4:15-16: event 'x' has never been emitted 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @param 4 | function foo() public {} 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:18-23: tag '@param' missing parameter name 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @param f 4 | /// @param g 5 | function foo(int f) public {} 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-25: function parameter named 'g' not found 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_03.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @return so here we are 4 | function foo() public {} 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:18-25: tag '@return' for function with no return values 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_05.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @return 4 | function foo() public returns (int a, bool b) {} 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:24: tag '@return' missing parameter name 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_06.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @return a asda 4 | /// @return a barf 5 | function foo() public returns (int a, bool b) {} 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:18-25: duplicate tag '@return' for 'a' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_07.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @inheritdoc 4 | function foo() public returns (int a, bool b) {} 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:18-4:1: missing contract for tag '@inheritdoc' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_08.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @inheritdoc b 4 | function foo() public returns (int a, bool b) {} 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:29-30: base contract 'b' not found in tag '@inheritdoc' 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/functions_10.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | /// @return meh 3 | /// @return feh 4 | function foo() public returns (int) { 5 | return 1; 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | // error: 3:7-14: duplicate tag '@return' 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/struct_tag.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param 3 | struct x { 4 | uint32 f; 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:14-19: tag '@param' missing parameter name 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/struct_tag_01.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param g 3 | struct x { 4 | uint32 f; 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 2:20-21: function parameter named 'g' not found 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/struct_tag_02.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param f asdad 3 | /// @param f bar 4 | struct x { 5 | uint32 f; 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // warning: 3:13-25: duplicate tag '@param' for 'f' 9 | // note 2:13-27: previous tag '@param' for 'f' -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/struct_tag_03.sol: -------------------------------------------------------------------------------- 1 | 2 | /// @param f1 asdad 3 | /// @param f2 bar 4 | struct x { 5 | uint32 f1; 6 | uint32 f2; 7 | } 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/tags/variables.sol: -------------------------------------------------------------------------------- 1 | 2 | contract c { 3 | /// @param 4 | int x; 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:18-4:1: tag '@param' is not valid for state variable 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/value/balance.sol: -------------------------------------------------------------------------------- 1 | 2 | contract b { 3 | function step1(address j) public returns (uint128) { 4 | return j.balance; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-25: polkadot can only retrieve balance of 'this', like 'address(this).balance' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/value/balance_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract b { 3 | function step1(b j) public returns (uint128) { 4 | return j.balance; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:26-33: contract 'b' has no public function 'balance' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/value/this_address.sol: -------------------------------------------------------------------------------- 1 | 2 | contract b { 3 | function step1() public returns (address payable) { 4 | return payable(this); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // warning: 3:13-62: function can be declared 'view' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/value/this_address_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract b { 3 | function step1() public returns (address) { 4 | return this; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-28: implicit conversion to address from contract b not allowed 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/value/this_address_02.sol: -------------------------------------------------------------------------------- 1 | 2 | contract b { 3 | function step1(b other) public { 4 | this = other; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:17-21: expression is not assignable 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/global_constants.sol: -------------------------------------------------------------------------------- 1 | uint x = 102; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:1-5: global variable must be constant 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/global_constants_01.sol: -------------------------------------------------------------------------------- 1 | uint constant public x = 102; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:15-21: 'public': global variable cannot have visibility specifier 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/global_constants_02.sol: -------------------------------------------------------------------------------- 1 | uint constant external x = 102; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:15-23: 'external': global variable cannot have visibility specifier 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/global_constants_03.sol: -------------------------------------------------------------------------------- 1 | uint constant x; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:1-16: missing initializer for constant 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/global_constants_04.sol: -------------------------------------------------------------------------------- 1 | uint constant test = 5; contract test {} 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:15-19: test is already defined as a contract name 4 | // note 1:25-41: location of previous definition 5 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/immutable_02.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | int public immutable y = 1; 3 | 4 | function foo() public { 5 | y++; 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | // error: 5:17-18: cannot assign to immutable outside of constructor 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/immutable_05.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | int immutable public immutable y = 1; 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:34-43: duplicate 'immutable' attribute 7 | // note 2:17-26: previous 'immutable' attribute 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/override_attribute.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | int override y = 1; 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:17-25: only public variable can be declared 'override' 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/override_attribute_01.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | int override internal y = 1; 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:17-25: only public variable can be declared 'override' 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/override_attribute_02.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | int override private y = 1; 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:17-25: only public variable can be declared 'override' 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/test_variable_initializer_errors.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint x = 102; 3 | uint constant y = x + 5; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:31-32: cannot read contract variable 'x' in constant expression 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/test_variable_initializer_errors_02.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint x = y + 102; 3 | uint y = 102; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // warning: 2:13-29: storage variable 'x' has been assigned, but never read 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/test_variable_initializer_errors_03.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | uint x = y + 102; 3 | uint constant y = 102; 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // warning: 2:13-29: storage variable 'x' has been assigned, but never read 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/test_variable_initializer_errors_04.sol: -------------------------------------------------------------------------------- 1 | abstract contract test { 2 | // solc permits this too 3 | uint x = x + 102; 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/variable_size.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | function foo(int[12131231313213] memory y) public {} 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:30-44: array dimension of 12131231313213 exceeds the maximum of 4294967295 on Polkadot 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/variable_size_01.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | function foo() public returns (int[12131231313213] memory y) {} 3 | } 4 | 5 | // ---- Expect: diagnostics ---- 6 | // error: 2:48-62: array dimension of 12131231313213 exceeds the maximum of 4294967295 on Polkadot 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/polkadot/variables/variable_size_02.sol: -------------------------------------------------------------------------------- 1 | contract x { 2 | function foo() public { 3 | int[64*1024] memory y; 4 | } 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:17-29: type is too large to fit into memory 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/accessor/accessor_is_external.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | int constant public c = 102; 3 | 4 | function f() public { 5 | int x = c(); 6 | } 7 | } 8 | // ---- Expect: diagnostics ---- 9 | // error: 5:11-14: accessor function cannot be called via an internal function call 10 | // note 2:22-23: declaration of 'c' 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/accessor/constant.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | bytes32 public constant z = blockhash(1); 4 | } 5 | // ---- Expect: diagnostics ---- 6 | // error: 3:41-53: cannot call function in constant expression 7 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/accessor/constant_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | bytes foo; 4 | bytes32 public constant z = keccak256(foo); 5 | } 6 | // ---- Expect: diagnostics ---- 7 | // error: 4:51-54: cannot read contract variable 'foo' in constant expression 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/accounts/data_account_visibility.sol: -------------------------------------------------------------------------------- 1 | contract Foo { 2 | function addr_account() public pure returns (address) { 3 | return tx.accounts.dataAccount.key; 4 | } 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // error: 3:16-27: function declared 'pure' but this expression reads from state -------------------------------------------------------------------------------- /tests/contract_testcases/solana/asm_reserved_words.sol: -------------------------------------------------------------------------------- 1 | 2 | contract default { 3 | function switch(bool case) public pure returns (bool) { 4 | return !case; 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/call/calltys.sol: -------------------------------------------------------------------------------- 1 | 2 | contract main { 3 | function test() public { 4 | address x = address(0); 5 | 6 | x.staticcall(hex"1222"); 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:19-29: method 'staticcall' does not exist 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/comment.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | contract Hello { 3 | // xxx 。 4 | } 5 | 6 | 7 | // ---- Expect: diagnostics ---- 8 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/empty_import.sol: -------------------------------------------------------------------------------- 1 | import "" as foo; 2 | // ---- Expect: diagnostics ---- 3 | // error: 1:8-10: import path empty 4 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/error.sol: -------------------------------------------------------------------------------- 1 | 2 | contract error { 3 | error X(); 4 | 5 | function foo() public { 6 | 7 | } 8 | } 9 | 10 | // ---- Expect: diagnostics ---- 11 | // warning: 3:8-9: error 'X' has never been used 12 | // warning: 5:2-23: function can be declared 'pure' 13 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/expressions/bytes32_0_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | function b32() public pure returns (bytes32 r) { 4 | r = bytes32(0xffee); 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:21-36: number of 2 bytes cannot be converted to type 'bytes32' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/expressions/const_in_type.sol: -------------------------------------------------------------------------------- 1 | 2 | contract x { 3 | uint public constant Y = 24; 4 | 5 | constructor(bytes32[Y] memory foo) {} 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // warning: 5:43-46: function parameter 'foo' is unused 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/expressions/interfaceid.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | function get() public returns (bytes4) { 4 | return type(foo).interfaceId; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-45: type(…).interfaceId is permitted on interface, not contract foo 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/expressions/tx.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | function test() public pure returns (address) { 4 | return tx.origin; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-26: builtin 'tx.origin' does not exist 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/expressions/tx_01.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | function test() public pure returns (uint64) { 4 | return tx.gasprice; 5 | } 6 | } 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:24-26: builtin 'tx.gasprice' does not exist 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/for_if_no_else.sol: -------------------------------------------------------------------------------- 1 | function foo() returns (int) { 2 | for (int i=0; i< 10; i++) 3 | if (i > 0) 4 | return 1; 5 | 6 | return 2; 7 | } 8 | 9 | 10 | 11 | // ---- Expect: diagnostics ---- 12 | // warning: 1:1-29: function can be declared 'pure' 13 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/immutable_function.sol: -------------------------------------------------------------------------------- 1 | function x() immutable {} 2 | contract t { 3 | function y() immutable public { } 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 1:14-23: function cannot be declared 'immutable' 8 | // error: 3:18-27: function cannot be declared 'immutable' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/import_free_function_chain.sol: -------------------------------------------------------------------------------- 1 | // ensure free function can be imported via chain 2 | import "./import_free_function.sol" as Y; 3 | 4 | function baz() { 5 | int x = Y.X.foo(); 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | // warning: 1:1-29: function can be declared 'pure' 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/multidimensional_array.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | 3 | uint16[2][4][] stor_arr; 4 | function getThis() public view returns (uint16) { 5 | uint16[2][4][] memory arr2 = stor_arr; 6 | return arr2[1][1][1]; 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/power.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.10; 2 | 3 | contract AstExample { 4 | constructor() { 5 | 1 ** 2 ** 3; 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/returns/return_err.sol: -------------------------------------------------------------------------------- 1 | 2 | contract foo { 3 | uint private val = 0; 4 | 5 | function get() public { 6 | return val; 7 | } 8 | } 9 | // ---- Expect: diagnostics ---- 10 | // error: 6:17-27: function has no return values 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/simple.sol: -------------------------------------------------------------------------------- 1 | contract A {} 2 | library L {} 3 | error E(int foo); 4 | struct S { 5 | int64 f1; 6 | bool f2; 7 | } 8 | function inc(S s) pure { s.f1 += 1; } 9 | using {inc} for S global; 10 | 11 | // ---- Expect: diagnostics ---- 12 | // warning: 3:7-8: error 'E' has never been used 13 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/structs/recursive_01.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | struct S { 3 | int f1; 4 | S[] f2; 5 | } 6 | } 7 | 8 | // ---- Expect: diagnostics ---- 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/structs/recursive_04.sol: -------------------------------------------------------------------------------- 1 | abstract contract Recursive { 2 | struct B { B[] b; } 3 | struct C { B[] b; C c; } 4 | } 5 | 6 | // ---- Expect: diagnostics ---- 7 | // error: 3:12-13: struct 'C' has infinite size 8 | // note 3:23-26: recursive field 'c' 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/type_decl.sol: -------------------------------------------------------------------------------- 1 | 2 | type Addr is address payable; 3 | 4 | contract x { 5 | type Binary is bool; 6 | 7 | function f(Addr, Binary) public {} 8 | } 9 | 10 | // ---- Expect: diagnostics ---- 11 | // warning: 7:2-33: function can be declared 'pure' 12 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/type_decl_broken_used_as_event.sol: -------------------------------------------------------------------------------- 1 | type X is int; 2 | 3 | contract c { 4 | function f() public { 5 | emit X(); 6 | } 7 | } 8 | 9 | // ---- Expect: diagnostics ---- 10 | // error: 5:8-9: 'X' is an user type 11 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/using_interface.sol: -------------------------------------------------------------------------------- 1 | function double(int x) pure returns (int) { return x * 2; } 2 | 3 | interface C { 4 | using {double} for int; 5 | } 6 | 7 | // ---- Expect: diagnostics ---- 8 | // error: 4:2-24: using for not permitted in interface 9 | -------------------------------------------------------------------------------- /tests/contract_testcases/solana/using_literal.sol: -------------------------------------------------------------------------------- 1 | function double(int x) pure returns (int) { return x * 2; } 2 | 3 | using {double} for int; 4 | 5 | contract C { 6 | function foo() pure public returns (int) { 7 | return 42.double(); 8 | } 9 | } 10 | 11 | // ---- Expect: diagnostics ---- 12 | -------------------------------------------------------------------------------- /tests/evm_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | mod pragma; 4 | -------------------------------------------------------------------------------- /tests/imports_testcases/bad_escape.sol: -------------------------------------------------------------------------------- 1 | 2 | import "bar\xyf.sol"; 3 | 4 | import "bar\xff.sol"; 5 | -------------------------------------------------------------------------------- /tests/imports_testcases/dummy.sol: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy contract to test stuff like redundant (and unneeded) 3 | * importmaps 4 | */ 5 | contract Dummy {} 6 | -------------------------------------------------------------------------------- /tests/imports_testcases/import.sol: -------------------------------------------------------------------------------- 1 | /** 2 | * Doc comments should be permitted but ignored 3 | */ 4 | import "bar.sol"; 5 | -------------------------------------------------------------------------------- /tests/imports_testcases/import_map.sol: -------------------------------------------------------------------------------- 1 | import "foo/bar.sol"; 2 | -------------------------------------------------------------------------------- /tests/imports_testcases/imports/bar.sol: -------------------------------------------------------------------------------- 1 | 2 | // \u0061 => 'a', \x6f => 'o' 3 | import {rel} from "./rel\u0061tive_imp\x6frt.sol"; 4 | 5 | contract c is rel { 6 | function exceeds() public { 7 | emit Doubt(true); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/imports_testcases/imports/bar_backslash.sol: -------------------------------------------------------------------------------- 1 | 2 | import ".\\relative_import.sol"; 3 | import "..\\import.sol"; 4 | -------------------------------------------------------------------------------- /tests/imports_testcases/imports/rel.sol: -------------------------------------------------------------------------------- 1 | 2 | contract rel {} 3 | -------------------------------------------------------------------------------- /tests/imports_testcases/imports/relative_import.sol: -------------------------------------------------------------------------------- 1 | contract rel { 2 | event Doubt(bool); 3 | function avoid() public { 4 | emit Doubt(false); 5 | } 6 | } -------------------------------------------------------------------------------- /tests/imports_testcases/imports2/bar.sol: -------------------------------------------------------------------------------- 1 | // Empty file 2 | -------------------------------------------------------------------------------- /tests/lir.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | mod lir_tests; 3 | -------------------------------------------------------------------------------- /tests/lir_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | mod convert_lir; 4 | mod expr_to_string; 5 | mod helpers; 6 | mod insn_to_string; 7 | mod lir_to_string; 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/085b1aef14cc42bfdc5ac6580b31222db911acf1.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/0b44e918cca54edfcac366aef5a9bf1f0a1c7c3d.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/114cff92661e65f9576b26c162c095ea636ee037.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "list", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/1436450537ce8f9bdf31401d6ac19290be579b94.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "getThis", 6 | [] 7 | ], 8 | [ 9 | "getThat", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/1705a7f6d65dbc964702ce2870e3ca47681ffcd9.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/183f1a962081515d90bf08301c5440fba2d38105.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/19cd7f490b5f85e9370f17a5b538de60335f0493.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testStringOut", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/1a58b2647e77f77fc6075c62e6b11297852e4684.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "power", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/1b0ed1e820fbf800143184f09631c5b1f0eaef1a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ], 8 | [ 9 | "test2", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/1c46da1372eaf2bbc6146911f817548828e0e390.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/2a336dc4196af8922fe76563b83ec2732fbecaa8.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "pop", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/2ae422b2ae1b2ce11bd89a7534e5e1c659d1da0a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testStringAndBytes", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/2f3f9eccd8173aa694a1c7785ecce4ac49d0f6b5.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/39e410cb7e9d80b2f2fdea5c82d63d5d09c5e2fd.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/3e77586d59c07d86f5d4ce839db9eaa9ae2d5dc7.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "get", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/3ee60d0e61b9db1884299bf3b262ff72343d720a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/44096d94f1d5b45be9377c369131f9fe5285c8af.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/45b8c83ba563385f95345549716b166105c3eb26.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testMod", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/461c892e5409ec2e0ad5690b689b231bb26429c9.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/564d9bac74a8db9ce4e6d6449fef48e5c6c9a859.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "pop", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/5806b03335f34b5d861945e76a2200ae18af19e4.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/5835bc96e662018e3111972dca85b4ce00f25c42.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/59cdc8f2d6da65d5a0f028f5f1b3a3111b9ce6b2.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test1", 6 | [] 7 | ], 8 | [ 9 | "test2", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/61902f37a1151bf5058540a3182272d342249de3.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/6cbfc1852136b43ae5227fafc1afcebd085da63e.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/6d43b70b6022f2dad09eceb938394a90f79ba990.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f1", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/6ed453a65aa173ae32979d7a646da813d1b97fbb.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "strange", 6 | [] 7 | ], 8 | [ 9 | "inc", 10 | [] 11 | ], 12 | [ 13 | "get", 14 | [] 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/6eeb7392b5b692b61e3f291c3c1fb5dd55d876a5.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/76de50e0c391f652d51eb63bac244710512ee89d.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/77fdc91214244a38f5fb6870f7e60de76a9ab35a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testStruct", 6 | [ 7 | { 8 | "String": "nihao" 9 | } 10 | ] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/791bb65dc5ba996cdd30c63e5a51eca2c7735e08.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "getThis", 6 | [] 7 | ], 8 | [ 9 | "encodeEnum", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/7c7797ab6e67d6bc0af9c7cc1f24ed042a541200.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "boom", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/7f41f4f46d3d322620b1d417186aa1613bc0a473.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/802e618a7975e75e87f358681fec1d101430cc1a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/823f01a5cd5f6d4f2a22a971ee31f5ee3cac63e6.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/8322a21a93a295ab7ddea0863ba8316efa00e23a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testStruct", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/87204607493f46c1edd4eff4058478c6c677d40c.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "getThis", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/8a0c71d790d982d8fa7c77627b016a061783e9d0.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/8b8e17e7af35d41efbe338916381acce838cad7c.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/8efe35b20f88a3135d94e2c018565182c251a7f8.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testBytesArray", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/936f207995a74ee99dd48a16a1227826102bdb15.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test_cmp", 6 | [] 7 | ], 8 | [ 9 | "test_arith", 10 | [] 11 | ], 12 | [ 13 | "test_bit", 14 | [] 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/94d82dd931e2741e6bc553cfaf6c872c7d93caaf.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/966b45901973cfc548d5e0b3293997159280e559.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "get", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/97b3f1ab351112408f7ce9fc93014f86e71ef7ab.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "assert_fails", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/9905644736cef514b632bd5cb0bfaf652094cf59.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/a013e38f16b0d7f4fb05d2a127342a0a89e025b2.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/a0d621f97edd4164882e407b9de6ae7665c4dc65.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "go", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/a8f198bc49b907a4a4c03ac5ca66266c7b0a9515.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testThis", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/aa963886733ef70f2e1496cbe3410e94c6a91062.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "bar", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/b77cbdcbbdde3297a06c04433ff8b0e434cc8af3.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/c5a9864389b06010da706c8c54b5298325dc9f18.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "get", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/c8be3af3cd4d1de4f7c593aca451cdaaf773dfa6.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "v", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/c8be40ed3e19675e8bb7da033d34dec6e3fd69c1.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "getThis", 6 | [] 7 | ], 8 | [ 9 | "multiDim", 10 | [] 11 | ], 12 | [ 13 | "uniqueDim", 14 | [] 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/cc08f9ec0e4722640a7fb27071e80930d24eb5fe.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/d35db07be1efca5a31af0071f31b59a48e159de8.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "foo", 6 | [] 7 | ], 8 | [ 9 | "foo2", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/d5e017b7a453bc93ca099ed03f30f7222551e74a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/d94affcc88abe8a1a3ed5386b4a940b723be7db9.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/dcbc98ea779d3da1e1a4082b5a7bf8c9b3c9a676.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/dde6f64e54ff5e4e8a4ee8b92c4cb5795e7db7b4.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "encode", 6 | [] 7 | ], 8 | [ 9 | "insertStrings", 10 | [] 11 | ], 12 | [ 13 | "encode", 14 | [] 15 | ] 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/ddedf3014da6b43df1b98fa853322deac995a462.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/df669f73686d42bc9aad1ec7c7787fab9a5d0303.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ], 8 | [ 9 | "get", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/e42c846a82462397e89f59fd3bca2040be710888.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testBytesOut", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/e8235f0a47bb27b03cb7bcaf17956665a8538e5f.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "func", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/ef1e1ce13c38587a9c230a08044018b036761dab.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/f1b0806a397e4cafafc35a17ddfb1a5087d235a4.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "testBytesArray", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/f646b924357689419072fddf402c3ad3c10cd095.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "test1", 6 | [] 7 | ], 8 | [ 9 | "test3", 10 | [] 11 | ] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/f86a50d3a862d7bf019361693beee00826cdbd49.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f1", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/fc6dc16d6082a81fed67f782d717aa4be6690a4a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "f", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/calls/fcab22ddefebfba4bfa412396359ee806572989a.json: -------------------------------------------------------------------------------- 1 | { 2 | "constructor": [], 3 | "function": [ 4 | [ 5 | "go", 6 | [] 7 | ] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/00003fb72d8027d21e886333379cf82eb039a306.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int240 a, int240 b) public returns (int240) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/009f874f8cfb6123d6cf364d2ced5ba806d5fb77.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function f(bool cond1, bool cond2) public returns (int, int) { 3 | (int a, int b) = cond1 ? (cond2 ? (1, 2) : (3, 4)) : (5, 6); 4 | 5 | return (a, b); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/04157d79addbc40f2319c9a6f7c699f0d48baa59.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint152 a, uint152 b) public returns (uint152) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/06bffd9376e93226ea504196c6e7caf214df94b5.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | string st; 3 | 4 | function setString(string input) public { 5 | st = input; 6 | } 7 | 8 | function getLength() public view returns (uint32) { 9 | return st.length; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/072148dbf36aa512f9af83ff505bcd6e0bd0db88.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint224 a, uint224 b) public returns (uint224) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/0b44e918cca54edfcac366aef5a9bf1f0a1c7c3d.sol: -------------------------------------------------------------------------------- 1 | library Library { 2 | uint256 internal constant STATIC = 42; 3 | } 4 | 5 | contract foo { 6 | function f() public returns (uint) { 7 | uint a = Library.STATIC; 8 | return a; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/108c217fb3a9513fabd3d7e3fbd8d33af5c9efe0.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function wrongNumber(bytes memory buffer) public view { 3 | int64[5] memory vec = abi.decode(buffer, (int64[5])); 4 | 5 | assert(vec[1] == 0); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/114cff92661e65f9576b26c162c095ea636ee037.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int64 constant foo = 1; 3 | int64 bar = 2; 4 | 5 | function list() public returns (int64[3]) { 6 | return [foo, bar, 3]; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1186789b5546043bfa1215b5fa42463a2de3bda5.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int256 a, int256 b) public returns (int256) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1480a99c4daefe43a746f54f814498df3ee43068.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int128 a, int128 b) public returns (int128) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1705a7f6d65dbc964702ce2870e3ca47681ffcd9.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function g() public returns (uint, uint) { 3 | return (1, 2); 4 | } 5 | 6 | function f() public returns (uint, uint) { 7 | return true ? g() : (0, 0); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/183f1a962081515d90bf08301c5440fba2d38105.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function f() public returns (uint, uint) { 3 | return true ? (false ? (1, 2) : (3, 4)) : (5, 6); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/183fb340e3ad4511a7f1d848b3192733191a2696.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int64[4] public f1 = [1, 3, 5, 7]; 3 | } 4 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/19cd7f490b5f85e9370f17a5b538de60335f0493.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testStringOut() public pure returns (bytes memory) { 3 | bytes memory b = new bytes(4); 4 | string memory str = "cappuccino"; 5 | b.writeString(str, 0); 6 | return b; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1a58b2647e77f77fc6075c62e6b11297852e4684.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function power() public returns (uint) { 3 | return 2 ** 3 ** 4; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1b0ed1e820fbf800143184f09631c5b1f0eaef1a.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | uint x = .5 * 8; 4 | return x; 5 | } 6 | 7 | function test2() public returns (uint) { 8 | uint x = .4 * 8 + 0.8; 9 | return x; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1b48a88a5bf4f7c25325c3c2151c9c3f4f1c14b6.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int32 a, int32 b) public returns (int32) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/1f717f2fb2614d29eda874e8edd85d8642762ea3.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint80 a, uint80 b) public returns (uint80) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/2089b1eb0d82d0c85981dc0f665b30a936168da5.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int216 a, int216 b) public returns (int216) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/211f2c4d8ebbdb43c4ac71663bb6909424aa4b6c.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint176 a, uint176 b) public returns (uint176) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/233f083f32b6348c1c8fada94a522c571198cf28.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint200 a, uint200 b) public returns (uint200) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/27723aacedc0f4455bce42c3e26408355f9b5728.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint40 a, uint40 b) public returns (uint40) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/279927ef3806c03dd850574c8fd80265c97e51f7.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint208 a, uint208 b) public returns (uint208) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/28de2bbe3ec13103adb4c52053e615a4d25a3338.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function to_bytes(bytes4 b) public returns (bytes) { 3 | return b; 4 | } 5 | 6 | function to_bytes5(bytes b) public returns (bytes5) { 7 | return b; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/299e8f22fa0f1b4c3ebf7f187a2ab0fa5b389280.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint192 a, uint192 b) public returns (uint192) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/2a336dc4196af8922fe76563b83ec2732fbecaa8.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int64[] store; 3 | 4 | function pop() public returns (int64) { 5 | return store.pop(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/2fe6b11e0db08e497b6434870b7b6598a6c879f5.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int168 a, int168 b) public returns (int168) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/308a8684f989f21c6c703b7c75aa6fe072299ab0.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int48 a, int48 b) public returns (int48) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/357db7992fd6cc672ff0018367e15db1d175ca25.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint64 a, uint64 b) public returns (uint64) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/36127835bbc05a3efef22f763a2acfbc9a1c1c48.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int64 a, int64 b) public returns (int64) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/3750bfe8de73a81c36ac193885bea0ce578b9ba5.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint136 a, uint136 b) public returns (uint136) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/37df0f87d6adaad5401f43ee565c6d136d4f9b16.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint16 a, uint16 b) public returns (uint16) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/39e410cb7e9d80b2f2fdea5c82d63d5d09c5e2fd.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0; 2 | 3 | contract foo { 4 | function test() public returns (int) { 5 | int[] bar = new int[](0); 6 | return bar.pop(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/3e77586d59c07d86f5d4ce839db9eaa9ae2d5dc7.sol: -------------------------------------------------------------------------------- 1 | struct X { 2 | uint32 f1; 3 | bool f2; 4 | } 5 | 6 | contract foo { 7 | function get() public returns (X[4] f) { 8 | f[1].f1 = 102; 9 | f[1].f2 = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/3ee60d0e61b9db1884299bf3b262ff72343d720a.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public {} 3 | } 4 | 5 | contract bar is foo {} 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/4213430920860032c48fd6c975067fce40c7f0b4.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint72 a, uint72 b) public returns (uint72) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/44096d94f1d5b45be9377c369131f9fe5285c8af.sol: -------------------------------------------------------------------------------- 1 | contract C { 2 | uint256 public constant STATIC = 42; 3 | } 4 | 5 | contract foo { 6 | function f() public returns (uint) { 7 | uint a = C.STATIC; 8 | return a; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/4436c9a329a237e548071dc48184167fbe1d3d3e.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int248 a, int248 b) public returns (int248) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/461c892e5409ec2e0ad5690b689b231bb26429c9.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | uint x = 4.8 + 0.2; 4 | return x; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/474529f38a76b3e269346d6746d734c9c34ef6cd.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint88 a, uint88 b) public returns (uint88) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/4a3ebf81559622ff90978ee0601c0ebc7143cedb.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int176 a, int176 b) public returns (int176) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/4e351ae6156e78d5bca8ed877580138c792a8bb2.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | mapping(string => mapping(int64 => bytes1)) public map; 3 | 4 | function set(string s, int64 n, bytes1 v) public { 5 | map[s][n] = v; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/52d765a6081956d6a5b69de28d316ec732400b96.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testStringAndBytes(bytes memory buffer) public view { 3 | (string memory a, bytes memory b) = abi.decode(buffer, (string, bytes)); 4 | 5 | assert(a == "coffee"); 6 | assert(b == "tea"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/5438f1233cd04507f29620220f4945217cf0b8f6.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int72 a, int72 b) public returns (int72) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/564d9bac74a8db9ce4e6d6449fef48e5c6c9a859.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | bytes bs; 3 | 4 | function pop() public returns (bytes1) { 5 | return bs.pop(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/5806b03335f34b5d861945e76a2200ae18af19e4.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | return 1.4 + 1.6; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/5835bc96e662018e3111972dca85b4ce00f25c42.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | uint x = 4.8 % 0.2; 4 | return x; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/6154ca0cc65577a19069e2101afdcbb8f77953a7.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | mapping(int64 => uint64) public f1; 3 | 4 | constructor() { 5 | f1[2000] = 1; 6 | f1[4000] = 2; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/66829b56e6eaab46172029b817a16d45315551ee.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int96 a, int96 b) public returns (int96) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/66864d1956150d7a2d3f6df340ca04cf38eba29e.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int24 a, int24 b) public returns (int24) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/6d43b70b6022f2dad09eceb938394a90f79ba990.sol: -------------------------------------------------------------------------------- 1 | contract foo is bar { 2 | bytes2 public f1 = "ab"; 3 | } 4 | 5 | interface bar { 6 | function f1() external returns (bytes2); 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/724b06d399988bbe84ef9be8e113a57f3e80c7cb.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint168 a, uint168 b) public returns (uint168) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/733d059b3eb1a2136f2dc654c5adf31fd43c3f83.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint248 a, uint248 b) public returns (uint248) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/77fdc91214244a38f5fb6870f7e60de76a9ab35a.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testStruct(string memory rr) public pure returns (bytes memory) { 3 | bytes memory b1 = abi.encode(rr); 4 | return b1; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7a0c041ef08866b1e6380f418e4cc32c8728a41b.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int232 a, int232 b) public returns (int232) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7af75dc3316b77d4041e19909e65de21b9ff62dc.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint48 a, uint48 b) public returns (uint48) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7b187aa814a2250ecca1e685234f6541170f3619.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int152 a, int152 b) public returns (int152) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7c7797ab6e67d6bc0af9c7cc1f24ed042a541200.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int private foo; 3 | 4 | function boom() public view returns (int) { 5 | int baz = false ? foo : 0; 6 | return baz; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7d7dc194b6dbc95d2d773b6e3f51fe6844125ace.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint104 a, uint104 b) public returns (uint104) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/7e8bf6ee5bd652a26314a7e00793f4145e0d00d8.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int104 a, int104 b) public returns (int104) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/80069f05d6dd215ef91cad39f3875388b523d147.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint216 a, uint216 b) public returns (uint216) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/818f31ac3a827391551f5c24a8271221b76e9aae.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | string s; 3 | 4 | function set(string value) public { 5 | s = value; 6 | } 7 | 8 | function get() public returns (string) { 9 | return s; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/823f01a5cd5f6d4f2a22a971ee31f5ee3cac63e6.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | return 1.4e4 + 1.6e3; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/83171888c38223fe6243794deaacf94d5d88e665.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint56 a, uint56 b) public returns (uint56) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/8359f5fd91cbd73e401c4fa07c736eb1941506fa.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint144 a, uint144 b) public returns (uint144) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/860ef953b51db702764accaf0372e8541044d395.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint240 a, uint240 b) public returns (uint240) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/87204607493f46c1edd4eff4058478c6c677d40c.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function getThis() public pure returns (bytes memory) { 3 | string memory a = "coffe"; 4 | bytes memory b = "tea"; 5 | bytes memory c = abi.encode(a, b); 6 | return c; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/881e8fd0c136fd169e6e606154c4092645698adb.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint184 a, uint184 b) public returns (uint184) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/88f634b1727cbd8426c18d9a1955ae49bde4dfb5.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int136 a, int136 b) public returns (int136) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/89a0e8cab61b379690b1bde8befe1ff5c9c7d9e0.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int192 a, int192 b) public returns (int192) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/8a0c71d790d982d8fa7c77627b016a061783e9d0.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | uint x = 5.2 - 1.2; 4 | return x; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/8b8e17e7af35d41efbe338916381acce838cad7c.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function f() public returns (string) { 3 | (string a, string b) = ("Hello", "World!"); 4 | return (a); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/8cdd055f303190e33feab07c1d26e18e2b2d19ff.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int88 a, int88 b) public returns (int88) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/9056235f82b40734cbaa97c8e05a99f7fd991c67.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint112 a, uint112 b) public returns (uint112) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/9175fe362a6d85e2249c30d23b984b46e30e6afc.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int200 a, int200 b) public returns (int200) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/94d82dd931e2741e6bc553cfaf6c872c7d93caaf.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0; 2 | 3 | contract foo { 4 | function test() public { 5 | int[] bar = new int[](1); 6 | bar[0] = 12; 7 | bar.pop(); 8 | 9 | assert(bar[0] == 12); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/966b45901973cfc548d5e0b3293997159280e559.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function get() public returns (bytes8) { 3 | return type(I).interfaceId; 4 | } 5 | } 6 | 7 | interface I { 8 | function bar(int) external; 9 | 10 | function baz(bytes) external returns (int); 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/97b3f1ab351112408f7ce9fc93014f86e71ef7ab.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function assert_fails() public { 3 | require(true, "humpty-dumpty"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/9868a4a358753f952483ff9446df573ad63ef7ab.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function extraElement(bytes memory buffer) public pure { 3 | (int64[] memory vec, int32 g) = abi.decode(buffer, (int64[], int32)); 4 | 5 | assert(vec[1] == 0); 6 | assert(g == 3); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/9a0892303ceb4a83c2b45a55d118dc63ccca2431.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint160 a, uint160 b) public returns (uint160) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/a0d621f97edd4164882e407b9de6ae7665c4dc65.sol: -------------------------------------------------------------------------------- 1 | contract c { 2 | event myevent(int32 indexed a, int32 b); 3 | 4 | function go() public { 5 | emit myevent(1, -2); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/a245852a7d1e3503247ad5de3dee33612c36a031.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int184 a, int184 b) public returns (int184) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/aa41cc370ba24cc327fc40897fb58d3c2093aef3.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint24 a, uint24 b) public returns (uint24) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b004e7c9bc3d0c4e9d7de943b4f72fa7b06c8772.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint232 a, uint232 b) public returns (uint232) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b3f48670db4244bd9205576041222f55bdf4d895.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int160 a, int160 b) public returns (int160) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b3fee2023e9a76c682874d28c8dcc0d74060a267.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int8 a, int8 b) public returns (int8) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b48ee45beee70a66bc540380eaf3a22c337d55b2.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test(uint32 x) public returns (uint32) { 3 | return x * x; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b5bfd19f5b4dbcb249ef40a32a190d7a8f8f272f.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testStringVector( 3 | bytes memory buffer 4 | ) public pure returns (string[] memory) { 5 | string[] memory vec = abi.decode(buffer, (string[])); 6 | return vec; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b6815ad6728a400f03505126507da28ad14a7fc0.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int120 a, int120 b) public returns (int120) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b6d0fed2a1b1e9c732240df94dc527f010df333f.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function returnedString( 3 | bytes memory buffer 4 | ) public pure returns (string memory) { 5 | string memory s = abi.decode(buffer, (string)); 6 | return s; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/b77cbdcbbdde3297a06c04433ff8b0e434cc8af3.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int public test; 3 | } 4 | 5 | contract bar is foo {} 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/bd0105421af89a7dd01472ded68763ce05472c4a.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint128 a, uint128 b) public returns (uint128) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/c01d3fb92201170c6ea76757b5aeec8739b49f4f.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint8 a, uint8 b) public returns (uint8) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/c082ae3df9b12cf3b735591f079aba2b1569b5bb.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int208 a, int208 b) public returns (int208) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/c3e2644c6c24c298e8bb797a486f4f9095b1d620.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test(uint64 x) public returns (bool, uint64) { 3 | return (true, x * 961748941); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/c5a9864389b06010da706c8c54b5298325dc9f18.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function get() public returns (uint32[4] f, bytes1 g) { 3 | f[0] = 1; 4 | f[1] = 102; 5 | f[2] = 300331; 6 | f[3] = 12313231; 7 | g = 0xfe; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/cc08f9ec0e4722640a7fb27071e80930d24eb5fe.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function g() public returns (uint, uint) { 3 | return (1, 2); 4 | } 5 | 6 | function f() public returns (uint, uint) { 7 | return g(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/cf513f37390ae5e084fffb2dcbddb9d473fae1c0.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint96 a, uint96 b) public returns (uint96) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d1fcbc6bd1cd95c8aefa829222778652f3b071f6.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int56 a, int56 b) public returns (int56) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d44a63046cbb99c608e9b068c769d9cef1447d4a.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int112 a, int112 b) public returns (int112) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d5b814cc2fa66754346e40dc8b251ac4986e7399.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int40 a, int40 b) public returns (int40) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d5fcef4384d4a78f6fb3c5eeb0879710d5bb4f77.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test(uint64 x) public returns (uint64, uint) { 3 | return (x * 961748941, 2.5 + 3.5 - 1); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d6d16b20493dde0b10a8f6b5de9457c848432f09.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint32 a, uint32 b) public returns (uint32) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d84e56174854f9597fa113e1171352bb81978317.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint120 a, uint120 b) public returns (uint120) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/d8eec36f43659f261d919c5fa0dfba62f468edd4.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function pow(uint256 a, uint256 b) public returns (uint256) { 3 | return a ** b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/dcbc98ea779d3da1e1a4082b5a7bf8c9b3c9a676.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test() public returns (uint) { 3 | uint x = 4.8 / 0.2; 4 | return x; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/ddedf3014da6b43df1b98fa853322deac995a462.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | constructor() { 3 | print("Hello from constructor"); 4 | } 5 | 6 | function test() public { 7 | print("Hello from function"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/de54f08de5ab75a96b9f66ac027bc1fab5a07b95.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testLongerBuffer(bytes memory buffer) public view { 3 | uint64 a = abi.decode(buffer, (uint64)); 4 | 5 | assert(a == 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/e42c846a82462397e89f59fd3bca2040be710888.sol: -------------------------------------------------------------------------------- 1 | contract Testing { 2 | function testBytesOut() public pure returns (bytes memory) { 3 | bytes memory b = new bytes(9); 4 | bytes memory g = "tea"; 5 | b.writeBytes(g, 30); 6 | return b; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/e56b8df39161bc827ae9cf4e2dbd5fef0595a7f2.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int144 a, int144 b) public returns (int144) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/e6be413345005926a1566033739efeb348ca235d.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int80 a, int80 b) public returns (int80) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/e7bd22dc4f321e4b664018e35dae2a532509e834.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int16 a, int16 b) public returns (int16) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/ef75ba9ddf247a845a7877ec440da64de2218b85.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function umul(uint128 x) public returns (uint128) { 3 | return x * 2; 4 | } 5 | 6 | function mul(int128 x) public returns (int128) { 7 | return x * 2; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/f08c8a56899f6b77e7879d59251253fca8d9f754.sol: -------------------------------------------------------------------------------- 1 | contract test { 2 | function mul(int224 a, int224 b) public returns (int224) { 3 | return a * b; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/f26f361cd77728914df3ce056c57b54b64c46f22.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test(uint32 x, uint64 y) public { 3 | if (x == 10) { 4 | print("x is 10"); 5 | } 6 | 7 | if (y == 102) { 8 | print("y is 102"); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/f787bc14b1c47f81e0f087c0a76e219cdc06bcc7.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function test1(bytes4 bs) public returns (bool) { 3 | return bs != 0; 4 | } 5 | 6 | function test2(bytes4 bs) public returns (bool) { 7 | return bs == 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/f86a50d3a862d7bf019361693beee00826cdbd49.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int64 public f1 = 102; 3 | } 4 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/fc6dc16d6082a81fed67f782d717aa4be6690a4a.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | function f() public returns (uint, uint) { 3 | return true ? (1 + 2 + 3, 2 * 2) : (22 + 6, 1996); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/optimization_testcases/programs/fe05b53c4ac23f3d54a9ed778ddf72ea6d909551.sol: -------------------------------------------------------------------------------- 1 | contract foo { 2 | int64[4][2] public f1; 3 | 4 | constructor() { 5 | f1[1][0] = 4; 6 | f1[1][1] = 3; 7 | f1[1][2] = 2; 8 | f1[1][3] = 1; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/soroban_testcases/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | mod auth; 3 | mod cross_contract_calls; 4 | mod math; 5 | mod print; 6 | mod storage; 7 | mod ttl; 8 | -------------------------------------------------------------------------------- /tests/wasm_host_attr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wasm_host_attr" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | proc-macro2 = "1" 11 | quote = "1" 12 | syn = { version = "2", features = ["full"] } 13 | -------------------------------------------------------------------------------- /vscode/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | package-lock.json 6 | -------------------------------------------------------------------------------- /vscode/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/.eslintrc.json 9 | **/*.map 10 | **/*.ts 11 | -------------------------------------------------------------------------------- /vscode/hl_solang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-solang/solang/12a6d83b91f7f5a4cc48156e1112638e733e143a/vscode/hl_solang.png -------------------------------------------------------------------------------- /vscode/src/testFixture/four.sol: -------------------------------------------------------------------------------- 1 | contract a { 2 | function foo(int b) public returns (int256) { 3 | return 1; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vscode/src/testFixture/one.sol: -------------------------------------------------------------------------------- 1 | 2 | 3 | dddddddddddd 4 | dddddd 5 | 6 | aa 7 | 8 | 45 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vscode/src/testFixture/rename.sol: -------------------------------------------------------------------------------- 1 | function foo(uint256 n) returns (uint256 d) { 2 | d = 2; 3 | for (;;) { 4 | if (n == 0) { 5 | break; 6 | } 7 | 8 | n = n - 1; 9 | 10 | d = d + 2; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vscode/src/utils/expandPathResolving.ts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | import { homedir } from 'os'; 4 | 5 | export default function expandPathResolving(path: string): string { 6 | if (path.startsWith('~/')) { 7 | return path.replace('~', homedir()); 8 | } 9 | return path; 10 | } 11 | --------------------------------------------------------------------------------