From ce7905f6a6f7630b14242e654d5bbc4d98248278 Mon Sep 17 00:00:00 2001 From: Asuka Date: Thu, 18 Jun 2026 10:17:43 +0800 Subject: [PATCH] fix(astimport): accept sun/trx subdenominations The exporter emits sun/trx but the importer rejected them, aborting --import-ast on any contract with a TRX literal. --- libsolidity/ast/ASTJsonImporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsolidity/ast/ASTJsonImporter.cpp b/libsolidity/ast/ASTJsonImporter.cpp index ee52bf53c27d..777d1d13163e 100644 --- a/libsolidity/ast/ASTJsonImporter.cpp +++ b/libsolidity/ast/ASTJsonImporter.cpp @@ -1225,6 +1225,10 @@ Literal::SubDenomination ASTJsonImporter::subdenomination(Json const& _node) return Literal::SubDenomination::Gwei; else if (subDenStr == "ether") return Literal::SubDenomination::Ether; + else if (subDenStr == "sun") + return Literal::SubDenomination::Sun; + else if (subDenStr == "trx") + return Literal::SubDenomination::Trx; else if (subDenStr == "seconds") return Literal::SubDenomination::Second; else if (subDenStr == "minutes")