Update the metadata JSON spec

This commit is contained in:
Alex Beregszaszi 2016-11-17 10:31:46 +00:00
parent 073871c248
commit 559c4c7a45

View File

@ -197,29 +197,43 @@ that can be used to query a location of the binary (and whether the version is
"official") at a registry contract. "official") at a registry contract.
{ {
// The version of the metadata format (required field)
version: "1", version: "1",
// Required field
language: "Solidity", language: "Solidity",
// Required field, the contents are specific to the language
compiler: { compiler: {
commit: "55db20e32c97098d13230ab7500758e8e3b31d64", name: "solc",
version: "soljson-2313-2016-12-12", version: "0.4.5-nightly.2016.11.15+commit.c1b1efaf.Emscripten.clang",
keccak: "0x123..." // Optional hash of the compiler binary which produced this output
keccak256: "0x123..."
}, },
// This is a subset of the regular compiler input // This is a subset of the regular compiler input
sources: sources:
{ {
"abc": {keccak: "0x456..."}, // here, sources are always given by hash "myFile.sol": {
"def": {keccak: "0x123..."}, "keccak256": "0x123...",
"dir/file.sol": {keccax: "0xabc..."}, "url": "bzzr://0x56..."
"xkcd": {swarm: "0x456..."} },
"Token": {
"keccak256": "0x456...",
"url": "https://raw.githubusercontent.com/ethereum/solidity/develop/std/Token.sol"
},
"mortal": {
"content": "contract mortal is owned { function kill() { if (msg.sender == owner) selfdestruct(owner); } }"
}
}, },
// This is a subset of the regular compiler input // This is a subset of the regular compiler input
// Its content is specific to the compiler (determined by the language and compiler fields)
settings: settings:
{ {
remappings: [":g/dir"], remappings: [":g/dir"],
optimizer: {enabled: true, runs: 500}, optimizer: {enabled: true, runs: 500},
compilationTarget: "myFile.sol:MyContract", compilationTarget: {
"myFile.sol": MyContract"
},
libraries: { libraries: {
"def:MyLib": "0x123123..." "MyLib": "0x123123..."
} }
}, },
// This is a subset of the regular compiler output // This is a subset of the regular compiler output
@ -228,7 +242,6 @@ that can be used to query a location of the binary (and whether the version is
abi: [ /* abi definition */ ], abi: [ /* abi definition */ ],
userdoc: [], userdoc: [],
devdoc: [], devdoc: [],
natspec: [ /* user documentation comments */ ]
} }
} }