From 659b635b2d8274f870ebe487a73b431a2398b741 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 23 Nov 2016 19:04:50 +0100 Subject: Make sure some keys are present. --- libsolidity/interface/CompilerStack.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libsolidity') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 0f861302..e77836ef 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -670,6 +670,7 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const meta["language"] = "Solidity"; meta["compiler"]["version"] = VersionString; + meta["sources"] = Json::objectValue; for (auto const& s: m_sources) { solAssert(s.second.scanner, "Scanner not available"); @@ -683,12 +684,14 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const meta["settings"]["compilationTarget"][_contract.contract->sourceUnitName()] = _contract.contract->annotation().canonicalName; + meta["settings"]["remappings"] = Json::arrayValue; set remappings; for (auto const& r: m_remappings) remappings.insert(r.context + ":" + r.prefix + "=" + r.target); for (auto const& r: remappings) meta["settings"]["remappings"].append(r); + meta["settings"]["libraries"] = Json::objectValue; for (auto const& library: m_libraries) meta["settings"]["libraries"][library.first] = "0x" + toHex(library.second.asBytes()); -- cgit