aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-11-24 02:04:50 +0800
committerchriseth <c@ethdev.com>2016-12-01 23:03:59 +0800
commit659b635b2d8274f870ebe487a73b431a2398b741 (patch)
treec88943e099c9992d514cba2d857a16cbebf6adba
parente666f8cda70ad5e03bc00f4509fc51571fff90a7 (diff)
downloaddexon-solidity-659b635b2d8274f870ebe487a73b431a2398b741.tar.gz
dexon-solidity-659b635b2d8274f870ebe487a73b431a2398b741.tar.zst
dexon-solidity-659b635b2d8274f870ebe487a73b431a2398b741.zip
Make sure some keys are present.
-rw-r--r--libsolidity/interface/CompilerStack.cpp3
-rw-r--r--solc/CommandLineInterface.cpp2
2 files changed, 4 insertions, 1 deletions
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<string> 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());
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index fdfcabb4..419a1de0 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -212,7 +212,7 @@ void CommandLineInterface::handleOnChainMetadata(string const& _contract)
string data = m_compiler->onChainMetadata(_contract);
if (m_args.count("output-dir"))
- createFile(_contract + ".meta", data);
+ createFile(_contract + "_meta.json", data);
else
cout << "Metadata: " << endl << data << endl;
}