From 263cdc95e48cdd15be9f7cac3bace56dc17be1c4 Mon Sep 17 00:00:00 2001 From: Asuka Date: Fri, 15 Aug 2025 11:48:37 +0800 Subject: [PATCH 1/4] Use a simple modification method to deal with issue related to proof precompiled contracts --- libsolidity/codegen/ExpressionCompiler.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 121999de1330..9fd93707c69a 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -3256,18 +3256,17 @@ void ExpressionCompiler::appendExternalFunctionCall( //in this kind of precompiled contracts , return type is dynamicType if (haveReturndatacopy) { - m_context << u256(0) << Instruction::RETURNDATASIZE; + m_context << Instruction::RETURNDATASIZE; m_context.appendInlineAssembly(R"({ - start := mload(0x40) - size := add(returndatasize(), 0x40) - mstore(0x40, add(start, size)) - - returndatacopy(add(start, 0x40), 0, returndatasize()) - mstore(start, 0x20) - mstore(add(start, 0x20), div(returndatasize(), 0x20)) - })", {"start", "size"}); - - utils().abiDecode(returnTypes, true); + switch v case 0 { + v := 0x60 + } default { + v := mload(0x40) + mstore(0x40, add(v, and(add(returndatasize(), 0x3f), not(0x1f)))) + mstore(v, div(returndatasize(), 0x20)) + returndatacopy(add(v, 0x20), 0, returndatasize()) + } + })", {"v"}); } } From 471828398d2ff7c35b25016c74783234a61a1355 Mon Sep 17 00:00:00 2001 From: Asuka Date: Mon, 18 Aug 2025 10:29:12 +0800 Subject: [PATCH 2/4] Optimize user prompts for the via-ir in cli --- libsolutil/StackTooDeepString.h | 2 +- solc/CommandLineParser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsolutil/StackTooDeepString.h b/libsolutil/StackTooDeepString.h index 75fe557e2c8e..67e9836ba5bf 100644 --- a/libsolutil/StackTooDeepString.h +++ b/libsolutil/StackTooDeepString.h @@ -23,6 +23,6 @@ namespace solidity::util { static std::string stackTooDeepString = "Stack too deep. " - "Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) " + "Try compiling with `--experimental-via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) " "while enabling the optimizer. Otherwise, try removing local variables."; } diff --git a/solc/CommandLineParser.cpp b/solc/CommandLineParser.cpp index 4f3942df2643..b7b16e50eebb 100644 --- a/solc/CommandLineParser.cpp +++ b/solc/CommandLineParser.cpp @@ -1428,7 +1428,7 @@ void CommandLineParser::processArgs() if (m_args.count(g_strViaIR) > 0) { solThrow( CommandLineValidationError, - "Compilation mode via the IR is experimental now. Use --" + g_strExperimentalViaIR + "." + "Compilation mode via the IR of TRON`s Solidity compiler is experimental now. Use --" + g_strExperimentalViaIR + " instead." ); } m_options.output.viaIR = (m_args.count(g_strExperimentalViaIR) > 0 || m_args.count(g_strViaIR) > 0); From ccbf7044a1e3d98b8231cb0f6c4dfdea8906545c Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Wed, 3 Apr 2024 13:47:18 +0200 Subject: [PATCH 3/4] Remove signature removal from macos universal binaries. --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95bf91c4ed5a..77d68d8697ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,13 +249,6 @@ commands: # -------------------------------------------------------------------------- # Artifact Commands - remove_signature_from_universal_binary: - description: Remove signature from universal binary - steps: - - run: - name: Remove signature from universal binary - command: codesign --remove-signature build/solc/solc - store_artifacts_solc: description: Store compiled solc executable as artifact steps: @@ -1205,7 +1198,6 @@ jobs: - checkout - install_dependencies_osx - run_build - - remove_signature_from_universal_binary - store_artifacts_solc - store_artifacts_yul_phaser - persist_executables_to_workspace_osx From 970bff14f53cbf5c06693aa6feab68516bd6b8db Mon Sep 17 00:00:00 2001 From: Asuka Date: Mon, 25 Aug 2025 16:17:47 +0800 Subject: [PATCH 4/4] Add TRON identifier to prompt for the via-ir in cli --- solc/CommandLineParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solc/CommandLineParser.cpp b/solc/CommandLineParser.cpp index b7b16e50eebb..95479690c1e9 100644 --- a/solc/CommandLineParser.cpp +++ b/solc/CommandLineParser.cpp @@ -1428,7 +1428,7 @@ void CommandLineParser::processArgs() if (m_args.count(g_strViaIR) > 0) { solThrow( CommandLineValidationError, - "Compilation mode via the IR of TRON`s Solidity compiler is experimental now. Use --" + g_strExperimentalViaIR + " instead." + "The --" + g_strViaIR + " is currently experimental for TRON solidity compiler. Use --" + g_strExperimentalViaIR + " instead." ); } m_options.output.viaIR = (m_args.count(g_strExperimentalViaIR) > 0 || m_args.count(g_strViaIR) > 0);