From d525a8bccbda4fb5b1e3facbca777bc6c3cf261d Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 18 Nov 2020 20:22:51 +0100 Subject: [PATCH 1/6] Enable ABI coder v2 by default. --- Changelog.md | 1 + libsolidity/analysis/SyntaxChecker.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index d6a8a9a36..06db06eda 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ Breaking Changes: * Code Generator: Cause a panic if a byte array in storage is accessed whose length is encoded incorrectly. * Command Line Interface: Remove the ``--old-reporter`` option. * Command Line Interface: Remove the legacy ``--ast-json`` option. Only the ``--ast-compact-json`` option is supported now. + * General: Enable ABI coder v2 by default. * General: Remove global functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4``. * Standard JSON: Remove the ``legacyAST`` option. * Type Checker: Function call options can only be given once. diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 0e8e7684e..9fac5f6d5 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -74,7 +74,7 @@ void SyntaxChecker::endVisit(SourceUnit const& _sourceUnit) m_errorReporter.warning(3420_error, {-1, -1, _sourceUnit.location().source}, errorString); } if (!m_sourceUnit->annotation().useABICoderV2.set()) - m_sourceUnit->annotation().useABICoderV2 = false; + m_sourceUnit->annotation().useABICoderV2 = true; m_sourceUnit = nullptr; } From a5bd22795eb409309d851d5328c9c9b494fe62dc Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 19 Nov 2020 16:58:41 +0100 Subject: [PATCH 2/6] Force running abi coder v1 instead of v2. --- .circleci/soltest.sh | 6 +++--- .circleci/soltest_all.sh | 4 ++-- scripts/tests.sh | 16 +++++++------- test/Common.cpp | 2 +- test/Common.h | 2 +- test/contracts/Wallet.cpp | 2 +- test/libsolidity/ABIDecoderTests.cpp | 13 +----------- test/libsolidity/ABIEncoderTests.cpp | 21 ++++++------------- test/libsolidity/ABITestsCommon.h | 16 ++++++++++---- test/libsolidity/GasCosts.cpp | 4 ++-- test/libsolidity/GasMeter.cpp | 8 +++---- test/libsolidity/SemanticTest.cpp | 2 +- .../SolidityExecutionFramework.cpp | 4 ++-- test/libsolidity/SolidityExecutionFramework.h | 4 ++-- 14 files changed, 46 insertions(+), 58 deletions(-) diff --git a/.circleci/soltest.sh b/.circleci/soltest.sh index 3eb15d051..a9bebc3c8 100755 --- a/.circleci/soltest.sh +++ b/.circleci/soltest.sh @@ -11,7 +11,7 @@ # # EVM=version_string Specifies EVM version to compile for (such as homestead, etc) # OPTIMIZE=1 Enables backend optimizer -# ABI_ENCODER_V2=1 Enables ABI encoder version 2 +# ABI_ENCODER_V1=1 Forcibly enables ABI coder version 1 # SOLTEST_FLAGS= Appends to default SOLTEST_ARGS # # ------------------------------------------------------------------------------ @@ -49,7 +49,7 @@ ulimit -s 16384 get_logfile_basename() { local filename="${EVM}" test "${OPTIMIZE}" = "1" && filename="${filename}_opt" - test "${ABI_ENCODER_V2}" = "1" && filename="${filename}_abiv2" + test "${ABI_ENCODER_V1}" = "1" && filename="${filename}_abiv1" echo -ne "${filename}" } @@ -57,7 +57,7 @@ get_logfile_basename() { BOOST_TEST_ARGS="--color_output=no --show_progress=yes --logger=JUNIT,error,test_results/`get_logfile_basename`.xml ${BOOST_TEST_ARGS}" SOLTEST_ARGS="--evm-version=$EVM $SOLTEST_FLAGS" test "${OPTIMIZE}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --optimize" -test "${ABI_ENCODER_V2}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --abiencoderv2" +test "${ABI_ENCODER_V1}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --abiencoderv1" echo "Running ${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}" diff --git a/.circleci/soltest_all.sh b/.circleci/soltest_all.sh index 8281131b8..c65d2f1fb 100755 --- a/.circleci/soltest_all.sh +++ b/.circleci/soltest_all.sh @@ -58,11 +58,11 @@ echo "Running steps $RUN_STEPS..." STEP=1 # Run SMTChecker tests separately, as the heaviest expected run. -[[ " $RUN_STEPS " =~ " $STEP " ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V2=1 BOOST_TEST_ARGS="-t smtCheckerTests/*" "${REPODIR}/.circleci/soltest.sh" +[[ " $RUN_STEPS " =~ " $STEP " ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V1=1 BOOST_TEST_ARGS="-t smtCheckerTests/*" "${REPODIR}/.circleci/soltest.sh" STEP=$(($STEP + 1)) # Run without SMTChecker tests. -[[ " $RUN_STEPS " =~ " $STEP " ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V2=1 BOOST_TEST_ARGS="-t !smtCheckerTests" "${REPODIR}/.circleci/soltest.sh" +[[ " $RUN_STEPS " =~ " $STEP " ]] && EVM=istanbul OPTIMIZE=1 ABI_ENCODER_V1=1 BOOST_TEST_ARGS="-t !smtCheckerTests" "${REPODIR}/.circleci/soltest.sh" STEP=$(($STEP + 1)) for OPTIMIZE in ${OPTIMIZE_VALUES[@]} diff --git a/scripts/tests.sh b/scripts/tests.sh index 11191c86e..afb9038e9 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -90,19 +90,19 @@ for optimize in "" "--optimize" do for vm in $EVM_VERSIONS do - FORCE_ABIV2_RUNS="no" + FORCE_ABIV1_RUNS="no" if [[ "$vm" == "istanbul" ]] then - FORCE_ABIV2_RUNS="no yes" # run both in istanbul + FORCE_ABIV1_RUNS="no yes" # run both in istanbul fi - for abiv2 in $FORCE_ABIV2_RUNS + for abiv1 in $FORCE_ABIV1_RUNS do - force_abiv2_flag="" - if [[ "$abiv2" == "yes" ]] + force_abiv1_flag="" + if [[ "$abiv1" == "yes" ]] then - force_abiv2_flag="--abiencoderv2" + force_abiv1_flag="--abiencoderv1" fi - printTask "--> Running tests using "$optimize" --evm-version "$vm" $force_abiv2_flag..." + printTask "--> Running tests using "$optimize" --evm-version "$vm" $force_abiv1_flag..." log="" if [ -n "$log_directory" ] @@ -119,7 +119,7 @@ do [ "${vm}" = "byzantium" ] && [ "${optimize}" = "" ] && EWASM_ARGS="--ewasm" set +e - "${SOLIDITY_BUILD_DIR}"/test/soltest --show-progress $log -- ${EWASM_ARGS} --testpath "$REPO_ROOT"/test "$optimize" --evm-version "$vm" $SMT_FLAGS $force_abiv2_flag + "${SOLIDITY_BUILD_DIR}"/test/soltest --show-progress $log -- ${EWASM_ARGS} --testpath "$REPO_ROOT"/test "$optimize" --evm-version "$vm" $SMT_FLAGS $force_abiv1_flag if test "0" -ne "$?"; then exit 1 diff --git a/test/Common.cpp b/test/Common.cpp index 5e7059013..a6d26385c 100644 --- a/test/Common.cpp +++ b/test/Common.cpp @@ -98,7 +98,7 @@ CommonOptions::CommonOptions(std::string _caption): ("no-smt", po::bool_switch(&disableSMT), "disable SMT checker") ("optimize", po::bool_switch(&optimize), "enables optimization") ("enforce-via-yul", po::bool_switch(&enforceViaYul), "Enforce compiling all tests via yul to see if additional tests can be activated.") - ("abiencoderv2", po::bool_switch(&useABIEncoderV2), "enables abi encoder v2") + ("abiencoderv1", po::bool_switch(&useABIEncoderV1), "enables abi encoder v1") ("show-messages", po::bool_switch(&showMessages), "enables message output") ("show-metadata", po::bool_switch(&showMetadata), "enables metadata output"); } diff --git a/test/Common.h b/test/Common.h index d83ee166d..57a7c773d 100644 --- a/test/Common.h +++ b/test/Common.h @@ -57,7 +57,7 @@ struct CommonOptions: boost::noncopyable bool optimize = false; bool enforceViaYul = false; bool disableSMT = false; - bool useABIEncoderV2 = false; + bool useABIEncoderV1 = false; bool showMessages = false; bool showMetadata = false; diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index 1c1f06aac..72aac4f71 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -468,7 +468,7 @@ BOOST_AUTO_TEST_CASE(creation) { deployWallet(200); BOOST_REQUIRE(callContractFunction("isOwner(address)", m_sender) == encodeArgs(true)); - bool v2 = solidity::test::CommonOptions::get().useABIEncoderV2; + bool v2 = !solidity::test::CommonOptions::get().useABIEncoderV1; BOOST_REQUIRE(callContractFunction("isOwner(address)", h256(~0)) == (v2 ? encodeArgs() : encodeArgs(false))); } diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index 8a885f39e..b910949d8 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -37,17 +37,6 @@ namespace solidity::frontend::test BOOST_FIXTURE_TEST_SUITE(ABIDecoderTest, SolidityExecutionFramework) -BOOST_AUTO_TEST_CASE(both_encoders_macro) -{ - // This tests that the "both decoders macro" at least runs twice and - // modifies the source. - string sourceCode; - int runs = 0; - BOTH_ENCODERS(runs++;) - BOOST_CHECK(sourceCode == NewEncoderPragma); - BOOST_CHECK_EQUAL(runs, 2); -} - BOOST_AUTO_TEST_CASE(value_types) { string sourceCode = R"( @@ -334,7 +323,7 @@ BOOST_AUTO_TEST_CASE(validation_function_type) function i(function () external[] calldata a) external pure returns (uint r) { a[0]; r = 4; } } )"; - bool newDecoder = solidity::test::CommonOptions::get().useABIEncoderV2; + bool newDecoder = false; string validFun{"01234567890123456789abcd"}; string invalidFun{"01234567890123456789abcdX"}; BOTH_ENCODERS( diff --git a/test/libsolidity/ABIEncoderTests.cpp b/test/libsolidity/ABIEncoderTests.cpp index 2ba3c5668..6cb524044 100644 --- a/test/libsolidity/ABIEncoderTests.cpp +++ b/test/libsolidity/ABIEncoderTests.cpp @@ -48,17 +48,6 @@ namespace solidity::frontend::test BOOST_FIXTURE_TEST_SUITE(ABIEncoderTest, SolidityExecutionFramework) -BOOST_AUTO_TEST_CASE(both_encoders_macro) -{ - // This tests that the "both encoders macro" at least runs twice and - // modifies the source. - string sourceCode; - int runs = 0; - BOTH_ENCODERS(runs++;) - BOOST_CHECK(sourceCode == NewEncoderPragma); - BOOST_CHECK_EQUAL(runs, 2); -} - BOOST_AUTO_TEST_CASE(value_types) { string sourceCode = R"( @@ -166,7 +155,7 @@ BOOST_AUTO_TEST_CASE(memory_array_one_dim) } )"; - if (!solidity::test::CommonOptions::get().useABIEncoderV2) + if (solidity::test::CommonOptions::get().useABIEncoderV1) { compileAndRun(sourceCode); callContractFunction("f()"); @@ -174,9 +163,11 @@ BOOST_AUTO_TEST_CASE(memory_array_one_dim) REQUIRE_LOG_DATA(encodeArgs(10, 0x60, 11, 3, u256("0xfffffffe"), u256("0xffffffff"), u256("0x100000000"))); } - compileAndRun(NewEncoderPragma + sourceCode); - callContractFunction("f()"); - REQUIRE_LOG_DATA(encodeArgs(10, 0x60, 11, 3, u256(-2), u256(-1), u256(0))); + NEW_ENCODER( + compileAndRun(sourceCode); + callContractFunction("f()"); + REQUIRE_LOG_DATA(encodeArgs(10, 0x60, 11, 3, u256(-2), u256(-1), u256(0))); + ) } BOOST_AUTO_TEST_CASE(memory_array_two_dim) diff --git a/test/libsolidity/ABITestsCommon.h b/test/libsolidity/ABITestsCommon.h index c5eea01ca..11ee83998 100644 --- a/test/libsolidity/ABITestsCommon.h +++ b/test/libsolidity/ABITestsCommon.h @@ -21,17 +21,25 @@ namespace solidity::frontend::test { -static std::string const NewEncoderPragma = "pragma experimental ABIEncoderV2;\n"; - #define NEW_ENCODER(CODE) \ { \ - sourceCode = NewEncoderPragma + sourceCode; \ + string sourceCodeTmp = sourceCode; \ + sourceCode = "pragma abicoder v2;\n" + sourceCode; \ { CODE } \ + sourceCode = sourceCodeTmp; \ +} + +#define OLD_ENCODER(CODE) \ +{ \ + string sourceCodeTmp = sourceCode; \ + sourceCode = "pragma abicoder v1;\n" + sourceCode; \ + { CODE } \ + sourceCode = sourceCodeTmp; \ } #define BOTH_ENCODERS(CODE) \ { \ - { CODE } \ + OLD_ENCODER(CODE) \ NEW_ENCODER(CODE) \ } diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index b562e91d6..836f45d49 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(string_storage) if (evmVersion <= EVMVersion::byzantium()) CHECK_DEPLOY_GAS(133045, 129731, evmVersion); // This is only correct on >=Constantinople. - else if (CommonOptions::get().useABIEncoderV2) + else if (!CommonOptions::get().useABIEncoderV1) { if (CommonOptions::get().optimize) { @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(string_storage) if (evmVersion == EVMVersion::byzantium()) CHECK_GAS(21545, 21526, 20); // This is only correct on >=Constantinople. - else if (CommonOptions::get().useABIEncoderV2) + else if (!CommonOptions::get().useABIEncoderV1) { if (CommonOptions::get().optimize) { diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 958e833d9..3e545ac63 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -62,9 +62,9 @@ public: // costs for transaction gas += gasForTransaction(m_compiler.object(m_compiler.lastContractName()).bytecode, true); - // Skip the tests when we force ABIEncoderV2. + // Skip the tests when we use ABIEncoderV2. // TODO: We should enable this again once the yul optimizer is activated. - if (!solidity::test::CommonOptions::get().useABIEncoderV2) + if (solidity::test::CommonOptions::get().useABIEncoderV1) { BOOST_REQUIRE(!gas.isInfinite); BOOST_CHECK_LE(m_gasUsed, gas.value); @@ -91,9 +91,9 @@ public: *m_compiler.runtimeAssemblyItems(m_compiler.lastContractName()), _sig ); - // Skip the tests when we force ABIEncoderV2. + // Skip the tests when we use ABIEncoderV2. // TODO: We should enable this again once the yul optimizer is activated. - if (!solidity::test::CommonOptions::get().useABIEncoderV2) + if (solidity::test::CommonOptions::get().useABIEncoderV1) { BOOST_REQUIRE(!gas.isInfinite); BOOST_CHECK_LE(m_gasUsed, gas.value); diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index 05bc51011..f532a7334 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -88,7 +88,7 @@ SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVer m_runWithEwasm = false; m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false); - if (m_runWithABIEncoderV1Only && solidity::test::CommonOptions::get().useABIEncoderV2) + if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1) m_shouldRun = false; auto revertStrings = revertStringsFromString(m_reader.stringSetting("revertStrings", "default")); diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp index 115225907..9f6c28043 100644 --- a/test/libsolidity/SolidityExecutionFramework.cpp +++ b/test/libsolidity/SolidityExecutionFramework.cpp @@ -136,10 +136,10 @@ string SolidityExecutionFramework::addPreamble(string const& _sourceCode) // Silence compiler version warning string preamble = "pragma solidity >=0.0;\n// SPDX-License-Identifier: unlicensed\n"; if ( - solidity::test::CommonOptions::get().useABIEncoderV2 && + solidity::test::CommonOptions::get().useABIEncoderV1 && _sourceCode.find("pragma experimental ABIEncoderV2;") == string::npos && _sourceCode.find("pragma abicoder") == string::npos ) - preamble += "pragma abicoder v2;\n"; + preamble += "pragma abicoder v1;\n"; return preamble + _sourceCode; } diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h index b0fc546ff..f616b2419 100644 --- a/test/libsolidity/SolidityExecutionFramework.h +++ b/test/libsolidity/SolidityExecutionFramework.h @@ -69,8 +69,8 @@ public: std::map const& _libraryAddresses = {} ); - /// Returns @param _sourceCode prefixed with the version pragma and the ABIEncoderV2 pragma, - /// the latter only if it is required. + /// Returns @param _sourceCode prefixed with the version pragma and the abi coder v1 pragma, + /// the latter only if it is forced. static std::string addPreamble(std::string const& _sourceCode); protected: From 72f1e4ea0b6d219465c7609e588fc7ed3ef66b38 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 3 Dec 2020 18:29:17 +0100 Subject: [PATCH 3/6] Explicitly set coder to v1 for syntax tests. --- test/libsolidity/Assembly.cpp | 2 ++ .../v1_accessing_public_state_variable_via_v1_type.sol | 1 + .../v1_accessing_public_state_variable_via_v2_type.sol | 5 +++-- ...l_to_v1_library_function_accepting_storage_struct.sol | 1 + .../v1_call_to_v2_constructor_accepting_struct.sol | 3 ++- ...ract_function_accepting_struct_via_named_argument.sol | 3 ++- ..._to_v2_contract_function_pointer_accepting_struct.sol | 3 ++- ..._contract_function_returning_dynamic_string_array.sol | 3 ++- .../v1_call_to_v2_contract_function_returning_struct.sol | 3 ++- ...ract_function_returning_struct_with_dynamic_array.sol | 3 ++- .../abiEncoder/v1_call_to_v2_event_accepting_struct.sol | 3 ++- ...all_to_v2_library_bound_function_returning_struct.sol | 3 ++- ...l_to_v2_library_function_accepting_storage_struct.sol | 1 + .../v1_call_to_v2_library_function_returning_struct.sol | 3 ++- .../syntaxTests/abiEncoder/v1_call_to_v2_modifier.sol | 1 + .../abiEncoder/v1_constructor_with_v2_modifier.sol | 2 ++ .../v1_inheritance_from_contract_calling_v2_function.sol | 1 + .../v1_inheritance_from_contract_defining_v2_event.sol | 1 + ...om_contract_defining_v2_function_accepting_struct.sol | 3 ++- ...om_contract_defining_v2_function_returning_struct.sol | 3 ++- .../v1_inheritance_from_contract_emitting_v2_event.sol | 1 + .../abiEncoder/v1_modifier_overriding_v2_modifier.sol | 1 + .../syntaxTests/abiEncoder/v1_v2_v1_modifier_mix.sol | 3 +++ .../abiEncoder/v2_v1_v1_modifier_sandwich.sol | 4 +++- .../abiEncoder/v2_v1_v2_modifier_sandwich.sol | 3 ++- .../syntaxTests/array/calldata_multi_dynamic_V1.sol | 5 +++-- .../syntaxTests/constructor/nonabiv2_type.sol | 3 ++- .../syntaxTests/constructor/nonabiv2_type_abstract.sol | 1 + .../syntaxTests/events/event_nested_array.sol | 3 ++- .../syntaxTests/events/event_nested_array_in_struct.sol | 3 ++- test/libsolidity/syntaxTests/events/event_struct.sol | 3 ++- .../syntaxTests/events/event_struct_indexed.sol | 3 ++- test/libsolidity/syntaxTests/getter/nested_structs.sol | 3 ++- .../imports/inheritance_abi_encoder_mismatch_1.sol | 3 ++- .../imports/inheritance_abi_encoder_mismatch_2.sol | 4 +++- .../045_returning_multi_dimensional_arrays.sol | 3 ++- .../046_returning_multi_dimensional_static_arrays.sol | 3 ++- .../048_returning_arrays_in_structs_arrays.sol | 3 ++- .../585_abi_decode_with_unsupported_types.sol | 3 ++- .../parsing/declaring_fixed_and_ufixed_variables.sol | 2 +- .../abi_encodePacked_nested_dynamic_array.sol | 3 ++- .../specialFunctions/abi_encode_nested_dynamic_array.sol | 3 ++- .../syntaxTests/specialFunctions/abi_encode_structs.sol | 9 +++++---- .../abidecode/abi_decode_nested_dynamic_array.sol | 3 ++- .../specialFunctions/abidecode/abi_decode_struct.sol | 3 ++- 45 files changed, 88 insertions(+), 38 deletions(-) diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 4b599da68..2e7adeda2 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -158,6 +158,7 @@ BOOST_AUTO_TEST_SUITE(Assembly) BOOST_AUTO_TEST_CASE(location_test) { auto sourceCode = make_shared(R"( + pragma abicoder v1; contract test { function f() public returns (uint256 a) { return 16; @@ -191,6 +192,7 @@ BOOST_AUTO_TEST_CASE(location_test) BOOST_AUTO_TEST_CASE(jump_type) { auto sourceCode = make_shared(R"( + pragma abicoder v1; contract C { function f(uint a) public pure returns (uint t) { assembly { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v1_type.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v1_type.sol index e88775901..f324d2c33 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v1_type.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v1_type.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; struct Item { uint x; uint y; diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v2_type.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v2_type.sol index 326101a37..feaf895e1 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v2_type.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_accessing_public_state_variable_via_v2_type.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; struct Item { uint x; uint y; @@ -13,5 +14,5 @@ contract D { } } // ---- -// TypeError 7364: (202-240): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 9574: (202-240): Type uint256 is not implicitly convertible to expected type struct Item memory. +// TypeError 7364: (222-260): Different number of components on the left hand side (1) than on the right hand side (2). +// TypeError 9574: (222-260): Type uint256 is not implicitly convertible to expected type struct Item memory. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v1_library_function_accepting_storage_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v1_library_function_accepting_storage_struct.sol index 231ab66e0..b21b7cfaf 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v1_library_function_accepting_storage_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v1_library_function_accepting_storage_struct.sol @@ -9,6 +9,7 @@ library L { function set(Item storage _item) external view {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_constructor_accepting_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_constructor_accepting_struct.sol index 0005e3bbb..8ba00da1a 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_constructor_accepting_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_constructor_accepting_struct.sol @@ -9,6 +9,7 @@ contract C { constructor(Item memory _item) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -17,4 +18,4 @@ contract Test { } } // ---- -// TypeError 2443: (B:71-80): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2443: (B:91-100): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_accepting_struct_via_named_argument.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_accepting_struct_via_named_argument.sol index 987c3ae0e..417f5682f 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_accepting_struct_via_named_argument.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_accepting_struct_via_named_argument.sol @@ -9,6 +9,7 @@ contract C { function set(uint _x, string memory _y, Item memory _item, bool _z) external view {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -17,4 +18,4 @@ contract Test { } } // ---- -// TypeError 2443: (B:99-109): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2443: (B:119-129): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_pointer_accepting_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_pointer_accepting_struct.sol index 8fb8b9ed8..1b08439cc 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_pointer_accepting_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_pointer_accepting_struct.sol @@ -9,6 +9,7 @@ contract C { function get(Item memory _item) external {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -19,4 +20,4 @@ contract Test { } } // ---- -// TypeError 2443: (B:146-155): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2443: (B:166-175): The type of this parameter, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_dynamic_string_array.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_dynamic_string_array.sol index 304cb1fb0..baadf362e 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_dynamic_string_array.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_dynamic_string_array.sol @@ -5,6 +5,7 @@ contract C { function f() external view returns (string[] memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D { @@ -13,4 +14,4 @@ contract D { } } // ---- -// TypeError 2428: (B:65-85): The type of return parameter 1, string[], is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:85-105): The type of return parameter 1, string[], is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct.sol index 27619f62f..f84a13d49 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct.sol @@ -9,6 +9,7 @@ contract C { function get() external view returns(Item memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -17,4 +18,4 @@ contract Test { } } // ---- -// TypeError 2428: (B:70-92): The type of return parameter 1, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:90-112): The type of return parameter 1, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct_with_dynamic_array.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct_with_dynamic_array.sol index d44431993..a67394e0e 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct_with_dynamic_array.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_contract_function_returning_struct_with_dynamic_array.sol @@ -9,6 +9,7 @@ contract C { function get() external view returns(Item memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -17,4 +18,4 @@ contract Test { } } // ---- -// TypeError 2428: (B:70-92): The type of return parameter 1, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:90-112): The type of return parameter 1, struct C.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_event_accepting_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_event_accepting_struct.sol index 4ba439035..1269a29ee 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_event_accepting_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_event_accepting_struct.sol @@ -8,6 +8,7 @@ library L { event E(Item _value); } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -16,4 +17,4 @@ contract Test { } } // ---- -// TypeError 2443: (B:74-84): The type of this parameter, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2443: (B:94-104): The type of this parameter, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_bound_function_returning_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_bound_function_returning_struct.sol index 901a02328..149aefa96 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_bound_function_returning_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_bound_function_returning_struct.sol @@ -9,6 +9,7 @@ library L { function f(uint) external view returns (Item memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D { @@ -19,4 +20,4 @@ contract D { } } // ---- -// TypeError 2428: (B:86-97): The type of return parameter 1, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:106-117): The type of return parameter 1, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_accepting_storage_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_accepting_storage_struct.sol index 238905863..41bc072a5 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_accepting_storage_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_accepting_storage_struct.sol @@ -9,6 +9,7 @@ library L { function get(Item storage _item) external view {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_returning_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_returning_struct.sol index 71f64d84f..b3d649e2c 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_returning_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_library_function_returning_struct.sol @@ -9,6 +9,7 @@ library L { function get() external view returns(Item memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract Test { @@ -17,4 +18,4 @@ contract Test { } } // ---- -// TypeError 2428: (B:70-77): The type of return parameter 1, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:90-97): The type of return parameter 1, struct L.Item, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_modifier.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_modifier.sol index d7d3d3b57..78d7b0512 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_modifier.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_call_to_v2_modifier.sol @@ -16,6 +16,7 @@ contract B { } } ==== Source: B ==== +pragma abicoder v1; import "A"; contract C is B { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_constructor_with_v2_modifier.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_constructor_with_v2_modifier.sol index 648141a6c..1ac5d713b 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_constructor_with_v2_modifier.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_constructor_with_v2_modifier.sol @@ -21,10 +21,12 @@ contract B { } ==== Source: B ==== +pragma abicoder v1; import "A"; contract C is B {} ==== Source: C ==== +pragma abicoder v1; import "B"; contract D is C { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_calling_v2_function.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_calling_v2_function.sol index 3548451ac..073a125be 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_calling_v2_function.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_calling_v2_function.sol @@ -19,6 +19,7 @@ contract B { } } ==== Source: B ==== +pragma abicoder v1; import "A"; contract C is B {} diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_event.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_event.sol index fa0ab0a3d..963ed33c7 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_event.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_event.sol @@ -9,6 +9,7 @@ contract C { event Ev(Item); } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D is C {} diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_accepting_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_accepting_struct.sol index 4657a431f..c37bad41c 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_accepting_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_accepting_struct.sol @@ -9,8 +9,9 @@ contract C { function get(Item memory) external view {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D is C {} // ---- -// TypeError 6594: (B:13-31): Contract "D" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. +// TypeError 6594: (B:33-51): Contract "D" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_returning_struct.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_returning_struct.sol index 9b687a030..f25754246 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_returning_struct.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_defining_v2_function_returning_struct.sol @@ -9,8 +9,9 @@ contract C { function get() external view returns(Item memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D is C {} // ---- -// TypeError 6594: (B:13-31): Contract "D" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. +// TypeError 6594: (B:33-51): Contract "D" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_emitting_v2_event.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_emitting_v2_event.sol index 2dc8e4b58..8aa2f8552 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_emitting_v2_event.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_inheritance_from_contract_emitting_v2_event.sol @@ -15,6 +15,7 @@ contract C { } } ==== Source: B ==== +pragma abicoder v1; import "A"; contract D is C {} diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_modifier_overriding_v2_modifier.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_modifier_overriding_v2_modifier.sol index d29971f7c..dd102cf51 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_modifier_overriding_v2_modifier.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_modifier_overriding_v2_modifier.sol @@ -17,6 +17,7 @@ contract B { } ==== Source: B ==== +pragma abicoder v1; import "A"; contract C is B { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v1_v2_v1_modifier_mix.sol b/test/libsolidity/syntaxTests/abiEncoder/v1_v2_v1_modifier_mix.sol index 61ddd47b5..e5df9cc82 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v1_v2_v1_modifier_mix.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v1_v2_v1_modifier_mix.sol @@ -1,4 +1,5 @@ ==== Source: C ==== +pragma abicoder v1; import "X"; import "V1A"; import "V2A"; @@ -14,6 +15,7 @@ contract C is V1A, V2A, V1B { } } ==== Source: V1A ==== +pragma abicoder v1; import "X"; contract V1A { @@ -22,6 +24,7 @@ contract V1A { } } ==== Source: V1B ==== +pragma abicoder v1; import "X"; contract V1B { diff --git a/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v1_modifier_sandwich.sol b/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v1_modifier_sandwich.sol index 5c4c70699..d7373ef7b 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v1_modifier_sandwich.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v1_modifier_sandwich.sol @@ -9,6 +9,7 @@ contract A { function get() public view returns (Data memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract B { @@ -18,6 +19,7 @@ contract B { } } ==== Source: C ==== +pragma abicoder v1; import "B"; contract C is B { @@ -27,4 +29,4 @@ contract C is B { {} } // ---- -// TypeError 2428: (B:60-82): The type of return parameter 1, struct Data, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:80-102): The type of return parameter 1, struct Data, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v2_modifier_sandwich.sol b/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v2_modifier_sandwich.sol index 20b4627f6..c3bf2c430 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v2_modifier_sandwich.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/v2_v1_v2_modifier_sandwich.sol @@ -9,6 +9,7 @@ contract A { function get() public view returns (Data memory) {} } ==== Source: B ==== +pragma abicoder v1; import "A"; contract B { @@ -29,4 +30,4 @@ contract C is B { {} } // ---- -// TypeError 2428: (B:60-82): The type of return parameter 1, struct Data, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 2428: (B:80-102): The type of return parameter 1, struct Data, is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol b/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol index 00bd4208c..754270ecf 100644 --- a/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol +++ b/test/libsolidity/syntaxTests/array/calldata_multi_dynamic_V1.sol @@ -1,7 +1,8 @@ +pragma abicoder v1; contract Test { function f(uint[][] calldata) external { } function g(uint[][1] calldata) external { } } // ---- -// TypeError 4957: (31-48): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. -// TypeError 4957: (78-96): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 4957: (51-68): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 4957: (98-116): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/constructor/nonabiv2_type.sol b/test/libsolidity/syntaxTests/constructor/nonabiv2_type.sol index 3487c67f3..8e0c323b8 100644 --- a/test/libsolidity/syntaxTests/constructor/nonabiv2_type.sol +++ b/test/libsolidity/syntaxTests/constructor/nonabiv2_type.sol @@ -1,5 +1,6 @@ +pragma abicoder v1; contract C { constructor(uint[][][] memory t) {} } // ---- -// TypeError 4957: (26-45): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. Alternatively, make the contract abstract and supply the constructor arguments from a derived contract. +// TypeError 4957: (46-65): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. Alternatively, make the contract abstract and supply the constructor arguments from a derived contract. diff --git a/test/libsolidity/syntaxTests/constructor/nonabiv2_type_abstract.sol b/test/libsolidity/syntaxTests/constructor/nonabiv2_type_abstract.sol index 7fc802247..2ca22790c 100644 --- a/test/libsolidity/syntaxTests/constructor/nonabiv2_type_abstract.sol +++ b/test/libsolidity/syntaxTests/constructor/nonabiv2_type_abstract.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; abstract contract C { constructor(uint[][][] memory t) {} } diff --git a/test/libsolidity/syntaxTests/events/event_nested_array.sol b/test/libsolidity/syntaxTests/events/event_nested_array.sol index 09ae580f6..2491dae6e 100644 --- a/test/libsolidity/syntaxTests/events/event_nested_array.sol +++ b/test/libsolidity/syntaxTests/events/event_nested_array.sol @@ -1,5 +1,6 @@ +pragma abicoder v1; contract c { event E(uint[][]); } // ---- -// TypeError 3061: (25-33): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 3061: (45-53): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol b/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol index b06f4990f..ee868a715 100644 --- a/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol +++ b/test/libsolidity/syntaxTests/events/event_nested_array_in_struct.sol @@ -1,6 +1,7 @@ +pragma abicoder v1; contract c { struct S { uint x; uint[][] arr; } event E(S); } // ---- -// TypeError 3061: (61-62): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 3061: (81-82): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_struct.sol b/test/libsolidity/syntaxTests/events/event_struct.sol index fad75f5a5..ac6355fe0 100644 --- a/test/libsolidity/syntaxTests/events/event_struct.sol +++ b/test/libsolidity/syntaxTests/events/event_struct.sol @@ -1,6 +1,7 @@ +pragma abicoder v1; contract c { struct S { uint a ; } event E(S); } // ---- -// TypeError 3061: (51-52): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 3061: (71-72): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/events/event_struct_indexed.sol b/test/libsolidity/syntaxTests/events/event_struct_indexed.sol index 1425ca9b9..7e3393400 100644 --- a/test/libsolidity/syntaxTests/events/event_struct_indexed.sol +++ b/test/libsolidity/syntaxTests/events/event_struct_indexed.sol @@ -1,6 +1,7 @@ +pragma abicoder v1; contract c { struct S { uint a ; } event E(S indexed); } // ---- -// TypeError 3061: (51-60): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 3061: (71-80): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/getter/nested_structs.sol b/test/libsolidity/syntaxTests/getter/nested_structs.sol index 6e901b438..36886bacf 100644 --- a/test/libsolidity/syntaxTests/getter/nested_structs.sol +++ b/test/libsolidity/syntaxTests/getter/nested_structs.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; contract C { struct Y { uint b; @@ -8,4 +9,4 @@ contract C { mapping(uint256 => X) public m; } // ---- -// TypeError 2763: (88-118): The following types are only supported for getters in ABI coder v2: struct C.Y memory. Either remove "public" or use "pragma abicoder v2;" to enable the feature. +// TypeError 2763: (108-138): The following types are only supported for getters in ABI coder v2: struct C.Y memory. Either remove "public" or use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol index 9e1761284..891f57e8d 100644 --- a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol +++ b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol @@ -13,7 +13,8 @@ pragma abicoder v2; import "./A.sol"; contract B is A { } ==== Source: C.sol ==== +pragma abicoder v1; import "./B.sol"; contract C is B { } // ---- -// TypeError 6594: (C.sol:18-37): Contract "C" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. +// TypeError 6594: (C.sol:38-57): Contract "C" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. diff --git a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol index b4cd6c6c4..c92221f3a 100644 --- a/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol +++ b/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_2.sol @@ -8,10 +8,12 @@ contract A function f(S memory _s) public returns (S memory,S memory) { } } ==== Source: B.sol ==== +pragma abicoder v1; import "./A.sol"; contract B is A { } ==== Source: C.sol ==== +pragma abicoder v1; import "./B.sol"; contract C is B { } // ---- -// TypeError 6594: (B.sol:18-37): Contract "B" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. +// TypeError 6594: (B.sol:38-57): Contract "B" does not use ABI coder v2 but wants to inherit from a contract which uses types that require it. Use "pragma abicoder v2;" for the inheriting contract as well to enable the feature. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol index a0a2e0408..c9075a4cd 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/045_returning_multi_dimensional_arrays.sol @@ -1,5 +1,6 @@ +pragma abicoder v1; contract C { function f() public pure returns (string[][] memory) {} } // ---- -// TypeError 4957: (51-68): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 4957: (71-88): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol index a643aec01..ee8c7f18d 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/046_returning_multi_dimensional_static_arrays.sol @@ -1,5 +1,6 @@ +pragma abicoder v1; contract C { function f() public pure returns (uint[][2] memory) {} } // ---- -// TypeError 4957: (51-67): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 4957: (71-87): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol index 46e495217..77c77831e 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/048_returning_arrays_in_structs_arrays.sol @@ -1,6 +1,7 @@ +pragma abicoder v1; contract C { struct S { string[] s; } function f() public pure returns (S memory x) {} } // ---- -// TypeError 4957: (80-90): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. +// TypeError 4957: (100-110): This type is only supported in ABI coder v2. Use "pragma abicoder v2;" to enable the feature. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/585_abi_decode_with_unsupported_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/585_abi_decode_with_unsupported_types.sol index a2ec34ecf..abbf76182 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/585_abi_decode_with_unsupported_types.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/585_abi_decode_with_unsupported_types.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; contract C { struct s { uint a; uint b; } function f() pure public { @@ -5,4 +6,4 @@ contract C { } } // ---- -// TypeError 9611: (98-99): Decoding type struct C.s memory not supported. +// TypeError 9611: (118-119): Decoding type struct C.s memory not supported. diff --git a/test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol b/test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol index 230176df7..e34522540 100644 --- a/test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol +++ b/test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol @@ -6,7 +6,7 @@ contract A { } } // ---- -// UnimplementedFeatureError: Not yet implemented - FixedPointType. +// UnimplementedFeatureError: Fixed point types not implemented. // Warning 5667: (52-60): Unused function parameter. Remove or comment out the variable name to silence this warning. // Warning 5667: (62-74): Unused function parameter. Remove or comment out the variable name to silence this warning. // Warning 2072: (93-104): Unused local variable. diff --git a/test/libsolidity/syntaxTests/specialFunctions/abi_encodePacked_nested_dynamic_array.sol b/test/libsolidity/syntaxTests/specialFunctions/abi_encodePacked_nested_dynamic_array.sol index 3645cf592..c10dc10f2 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/abi_encodePacked_nested_dynamic_array.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/abi_encodePacked_nested_dynamic_array.sol @@ -1,7 +1,8 @@ +pragma abicoder v1; contract C { function f() public pure { abi.encodePacked([new uint[](5), new uint[](7)]); } } // ---- -// TypeError 9578: (69-99): Type not supported in packed mode. +// TypeError 9578: (89-119): Type not supported in packed mode. diff --git a/test/libsolidity/syntaxTests/specialFunctions/abi_encode_nested_dynamic_array.sol b/test/libsolidity/syntaxTests/specialFunctions/abi_encode_nested_dynamic_array.sol index e4e5a85dc..8c679258c 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/abi_encode_nested_dynamic_array.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/abi_encode_nested_dynamic_array.sol @@ -1,7 +1,8 @@ +pragma abicoder v1; contract C { function test() public pure { abi.encode([new uint[](5), new uint[](7)]); } } // ---- -// TypeError 2056: (66-96): This type cannot be encoded. +// TypeError 2056: (86-116): This type cannot be encoded. diff --git a/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol b/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol index e502f1e13..a7d0e3dbe 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; contract C { struct S { uint x; } S s; @@ -11,7 +12,7 @@ contract C { } } // ---- -// TypeError 2056: (131-132): This type cannot be encoded. -// TypeError 2056: (134-135): This type cannot be encoded. -// TypeError 9578: (200-201): Type not supported in packed mode. -// TypeError 9578: (203-204): Type not supported in packed mode. +// TypeError 2056: (151-152): This type cannot be encoded. +// TypeError 2056: (154-155): This type cannot be encoded. +// TypeError 9578: (220-221): Type not supported in packed mode. +// TypeError 9578: (223-224): Type not supported in packed mode. diff --git a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_nested_dynamic_array.sol b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_nested_dynamic_array.sol index d1820aab1..c705ab2ec 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_nested_dynamic_array.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_nested_dynamic_array.sol @@ -1,7 +1,8 @@ +pragma abicoder v1; contract C { function f() public pure { abi.decode("1234", (uint[][3])); } } // ---- -// TypeError 9611: (72-81): Decoding type uint256[] memory[3] memory not supported. +// TypeError 9611: (92-101): Decoding type uint256[] memory[3] memory not supported. diff --git a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_struct.sol b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_struct.sol index b8b49ccdb..dd981b54c 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_struct.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/abidecode/abi_decode_struct.sol @@ -1,3 +1,4 @@ +pragma abicoder v1; struct S { uint x; } @@ -8,4 +9,4 @@ contract C { } } // ---- -// TypeError 9611: (98-99): Decoding type struct S memory not supported. +// TypeError 9611: (118-119): Decoding type struct S memory not supported. From 3f5925e1c39a2a6de2a0cae14e59e59cb9aa7647 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 2 Dec 2020 14:15:26 +0100 Subject: [PATCH 4/6] Update gas cost tests. --- test/libsolidity/GasCosts.cpp | 9 +++- test/libsolidity/gasTests/data_storage.sol | 8 +-- test/libsolidity/gasTests/dispatch_large.sol | 50 +++++++++---------- .../gasTests/dispatch_large_optimised.sol | 50 +++++++++---------- test/libsolidity/gasTests/dispatch_medium.sol | 22 ++++---- .../gasTests/dispatch_medium_optimised.sol | 24 ++++----- test/libsolidity/gasTests/dispatch_small.sol | 12 ++--- .../gasTests/dispatch_small_optimised.sol | 10 ++-- 8 files changed, 95 insertions(+), 90 deletions(-) diff --git a/test/libsolidity/GasCosts.cpp b/test/libsolidity/GasCosts.cpp index 836f45d49..e23de065a 100644 --- a/test/libsolidity/GasCosts.cpp +++ b/test/libsolidity/GasCosts.cpp @@ -97,7 +97,12 @@ BOOST_AUTO_TEST_CASE(string_storage) auto evmVersion = solidity::test::CommonOptions::get().evmVersion(); if (evmVersion <= EVMVersion::byzantium()) - CHECK_DEPLOY_GAS(133045, 129731, evmVersion); + { + if (CommonOptions::get().useABIEncoderV1) + CHECK_DEPLOY_GAS(133045, 129731, evmVersion); + else + CHECK_DEPLOY_GAS(152657, 135201, evmVersion); + } // This is only correct on >=Constantinople. else if (!CommonOptions::get().useABIEncoderV1) { @@ -126,7 +131,7 @@ BOOST_AUTO_TEST_CASE(string_storage) { callContractFunction("f()"); if (evmVersion == EVMVersion::byzantium()) - CHECK_GAS(21545, 21526, 20); + CHECK_GAS(21712, 21555, 20); // This is only correct on >=Constantinople. else if (!CommonOptions::get().useABIEncoderV1) { diff --git a/test/libsolidity/gasTests/data_storage.sol b/test/libsolidity/gasTests/data_storage.sol index 29cade28c..de74c4037 100644 --- a/test/libsolidity/gasTests/data_storage.sol +++ b/test/libsolidity/gasTests/data_storage.sol @@ -13,8 +13,8 @@ contract C { } // ---- // creation: -// codeDepositCost: 257000 -// executionCost: 300 -// totalCost: 257300 +// codeDepositCost: 376800 +// executionCost: 411 +// totalCost: 377211 // external: -// f(): 252 +// f(): 399 diff --git a/test/libsolidity/gasTests/dispatch_large.sol b/test/libsolidity/gasTests/dispatch_large.sol index 1e16d121c..8413957cd 100644 --- a/test/libsolidity/gasTests/dispatch_large.sol +++ b/test/libsolidity/gasTests/dispatch_large.sol @@ -24,29 +24,29 @@ contract Large { } // ---- // creation: -// codeDepositCost: 961600 -// executionCost: 1001 -// totalCost: 962601 +// codeDepositCost: 913400 +// executionCost: 948 +// totalCost: 914348 // external: -// a(): 1051 -// b(uint256): 2046 -// f0(uint256): 427 -// f1(uint256): 41352 -// f2(uint256): 21293 -// f3(uint256): 21381 -// f4(uint256): 21359 -// f5(uint256): 21337 -// f6(uint256): 21360 -// f7(uint256): 21272 -// f8(uint256): 21272 -// f9(uint256): 21294 -// g0(uint256): 313 -// g1(uint256): 41307 -// g2(uint256): 21270 -// g3(uint256): 21358 -// g4(uint256): 21336 -// g5(uint256): 21292 -// g6(uint256): 21315 -// g7(uint256): 21314 -// g8(uint256): 21292 -// g9(uint256): 21249 +// a(): 1175 +// b(uint256): infinite +// f0(uint256): infinite +// f1(uint256): infinite +// f2(uint256): infinite +// f3(uint256): infinite +// f4(uint256): infinite +// f5(uint256): infinite +// f6(uint256): infinite +// f7(uint256): infinite +// f8(uint256): infinite +// f9(uint256): infinite +// g0(uint256): infinite +// g1(uint256): infinite +// g2(uint256): infinite +// g3(uint256): infinite +// g4(uint256): infinite +// g5(uint256): infinite +// g6(uint256): infinite +// g7(uint256): infinite +// g8(uint256): infinite +// g9(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_large_optimised.sol b/test/libsolidity/gasTests/dispatch_large_optimised.sol index 099031bab..4108ca121 100644 --- a/test/libsolidity/gasTests/dispatch_large_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_large_optimised.sol @@ -27,29 +27,29 @@ contract Large { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 301200 -// executionCost: 343 -// totalCost: 301543 +// codeDepositCost: 270600 +// executionCost: 312 +// totalCost: 270912 // external: -// a(): 998 -// b(uint256): 2305 -// f0(uint256): 334 -// f1(uint256): 41474 -// f2(uint256): 21540 -// f3(uint256): 21628 -// f4(uint256): 21606 -// f5(uint256): 21584 -// f6(uint256): 21496 -// f7(uint256): 21276 -// f8(uint256): 21408 -// f9(uint256): 21430 -// g0(uint256): 574 -// g1(uint256): 41186 -// g2(uint256): 21274 -// g3(uint256): 21362 -// g4(uint256): 21340 -// g5(uint256): 21428 -// g6(uint256): 21208 -// g7(uint256): 21318 -// g8(uint256): 21296 -// g9(uint256): 21142 +// a(): 1028 +// b(uint256): 2370 +// f0(uint256): 399 +// f1(uint256): 41539 +// f2(uint256): 21605 +// f3(uint256): 21693 +// f4(uint256): 21671 +// f5(uint256): 21649 +// f6(uint256): 21561 +// f7(uint256): 21341 +// f8(uint256): 21473 +// f9(uint256): 21495 +// g0(uint256): 639 +// g1(uint256): 41251 +// g2(uint256): 21339 +// g3(uint256): 21427 +// g4(uint256): 21405 +// g5(uint256): 21493 +// g6(uint256): 21273 +// g7(uint256): 21383 +// g8(uint256): 21361 +// g9(uint256): 21207 diff --git a/test/libsolidity/gasTests/dispatch_medium.sol b/test/libsolidity/gasTests/dispatch_medium.sol index cd1368ca5..b9076c9cd 100644 --- a/test/libsolidity/gasTests/dispatch_medium.sol +++ b/test/libsolidity/gasTests/dispatch_medium.sol @@ -11,16 +11,16 @@ contract Medium { } // ---- // creation: -// codeDepositCost: 361800 +// codeDepositCost: 360400 // executionCost: 399 -// totalCost: 362199 +// totalCost: 360799 // external: -// a(): 1028 -// b(uint256): 2046 -// f1(uint256): 41263 -// f2(uint256): 21293 -// f3(uint256): 21337 -// g0(uint256): 313 -// g7(uint256): 21292 -// g8(uint256): 21270 -// g9(uint256): 21226 +// a(): 1152 +// b(uint256): infinite +// f1(uint256): infinite +// f2(uint256): infinite +// f3(uint256): infinite +// g0(uint256): infinite +// g7(uint256): infinite +// g8(uint256): infinite +// g9(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_medium_optimised.sol b/test/libsolidity/gasTests/dispatch_medium_optimised.sol index af7748c63..2bc22cc58 100644 --- a/test/libsolidity/gasTests/dispatch_medium_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_medium_optimised.sol @@ -14,16 +14,16 @@ contract Medium { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 169600 -// executionCost: 214 -// totalCost: 169814 +// codeDepositCost: 161000 +// executionCost: 208 +// totalCost: 161208 // external: -// a(): 998 -// b(uint256): 2063 -// f1(uint256): 41254 -// f2(uint256): 21298 -// f3(uint256): 21342 -// g0(uint256): 332 -// g7(uint256): 21208 -// g8(uint256): 21186 -// g9(uint256): 21142 +// a(): 1028 +// b(uint256): 2128 +// f1(uint256): 41319 +// f2(uint256): 21363 +// f3(uint256): 21407 +// g0(uint256): 397 +// g7(uint256): 21273 +// g8(uint256): 21251 +// g9(uint256): 21207 diff --git a/test/libsolidity/gasTests/dispatch_small.sol b/test/libsolidity/gasTests/dispatch_small.sol index d520d1bb0..6a062e530 100644 --- a/test/libsolidity/gasTests/dispatch_small.sol +++ b/test/libsolidity/gasTests/dispatch_small.sol @@ -6,11 +6,11 @@ contract Small { } // ---- // creation: -// codeDepositCost: 103400 -// executionCost: 153 -// totalCost: 103553 +// codeDepositCost: 123600 +// executionCost: 171 +// totalCost: 123771 // external: // fallback: 129 -// a(): 983 -// b(uint256): 2002 -// f1(uint256): 41263 +// a(): 1107 +// b(uint256): infinite +// f1(uint256): infinite diff --git a/test/libsolidity/gasTests/dispatch_small_optimised.sol b/test/libsolidity/gasTests/dispatch_small_optimised.sol index f4fa28e20..3f595229a 100644 --- a/test/libsolidity/gasTests/dispatch_small_optimised.sol +++ b/test/libsolidity/gasTests/dispatch_small_optimised.sol @@ -9,11 +9,11 @@ contract Small { // optimize-runs: 2 // ---- // creation: -// codeDepositCost: 72800 +// codeDepositCost: 76200 // executionCost: 123 -// totalCost: 72923 +// totalCost: 76323 // external: // fallback: 118 -// a(): 976 -// b(uint256): 1953 -// f1(uint256): 41188 +// a(): 1006 +// b(uint256): 2018 +// f1(uint256): 41253 From dff7dcdc272fdd00a6ee8e749e2b321ebf230103 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 2 Dec 2020 15:49:41 +0100 Subject: [PATCH 5/6] Update source location tests. --- .../standard_immutable_references/output.json | 2 +- test/libsolidity/Assembly.cpp | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/cmdlineTests/standard_immutable_references/output.json b/test/cmdlineTests/standard_immutable_references/output.json index 3fe3b406f..9742233e6 100644 --- a/test/cmdlineTests/standard_immutable_references/output.json +++ b/test/cmdlineTests/standard_immutable_references/output.json @@ -1 +1 @@ -{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"immutableReferences":{"6":[{"length":32,"start":77}]}}}}}},"sources":{"a.sol":{"id":0}}} +{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"immutableReferences":{"6":[{"length":32,"start":75}]}}}}}},"sources":{"a.sol":{"id":0}}} diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 2e7adeda2..73b70ec5a 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -173,18 +173,18 @@ BOOST_AUTO_TEST_CASE(location_test) vector locations; if (solidity::test::CommonOptions::get().optimize) locations = - vector(31, SourceLocation{2, 82, sourceCode}) + - vector(21, SourceLocation{20, 79, sourceCode}) + - vector(1, SourceLocation{72, 74, sourceCode}) + - vector(2, SourceLocation{20, 79, sourceCode}); + vector(31, SourceLocation{23, 103, sourceCode}) + + vector(21, SourceLocation{41, 100, sourceCode}) + + vector(1, SourceLocation{93, 95, sourceCode}) + + vector(2, SourceLocation{41, 100, sourceCode}); else locations = - vector(hasShifts ? 31 : 32, SourceLocation{2, 82, sourceCode}) + - vector(24, SourceLocation{20, 79, sourceCode}) + - vector(1, SourceLocation{49, 58, sourceCode}) + - vector(1, SourceLocation{72, 74, sourceCode}) + - vector(2, SourceLocation{65, 74, sourceCode}) + - vector(2, SourceLocation{20, 79, sourceCode}); + vector(hasShifts ? 31 : 32, SourceLocation{23, 103, sourceCode}) + + vector(24, SourceLocation{41, 100, sourceCode}) + + vector(1, SourceLocation{70, 79, sourceCode}) + + vector(1, SourceLocation{93, 95, sourceCode}) + + vector(2, SourceLocation{86, 95, sourceCode}) + + vector(2, SourceLocation{41, 100, sourceCode}); checkAssemblyLocations(items, locations); } From 197cb819d421026aee04a19b94e65ef00fd33b1b Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 3 Dec 2020 11:32:38 +0100 Subject: [PATCH 6/6] Documentation. --- docs/080-breaking-changes.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/080-breaking-changes.rst b/docs/080-breaking-changes.rst index af81f1c4b..c92d4c224 100644 --- a/docs/080-breaking-changes.rst +++ b/docs/080-breaking-changes.rst @@ -19,6 +19,17 @@ the compiler notifying you about it. Checks for overflow are very common, so we made them the default to increase readability of code, even if it comes at a slight increase of gas costs. +* ABI coder v2 is activated by default. + + You can choose to use the old behaviour using ``pragma abicoder v1;``. + The pragma ``pragma experimental ABIEncoderV2;`` is still valid, but it is deprecated and has no effect. + If you want to be explicit, please use ``pragma abicoder v2;`` instead. + + Note that ABI coder v2 supports more types than v1 and performs more sanity checks on the inputs. + ABI coder v2 makes some function calls more expensive and it can also make contract calls + revert that did not revert with ABI coder v1 when they contain data that does not conform to the + parameter types. + * Exponentiation is right associative, i.e., the expression ``a**b**c`` is parsed as ``a**(b**c)``. Before 0.8.0, it was parsed as ``(a**b)**c``.