mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use multiple URLs for metadata.
This commit is contained in:
parent
9d60734549
commit
56a027bedc
@ -334,10 +334,10 @@ Comments are of course also not permitted and used here only for explanatory pur
|
|||||||
"myFile.sol": {
|
"myFile.sol": {
|
||||||
// Required: keccak256 hash of the source file
|
// Required: keccak256 hash of the source file
|
||||||
"keccak256": "0x123...",
|
"keccak256": "0x123...",
|
||||||
// Required (unless "content" is used, see below): URL to the
|
// Required (unless "content" is used, see below): Sorted URL(s)
|
||||||
// source file, protocol is more or less arbitrary, but a Swarm
|
// to the source file, protocol is more or less arbitrary, but a
|
||||||
// URL is recommended
|
// Swarm URL is recommended
|
||||||
"url": "bzzr://56ab..."
|
"urls": [ "bzzr://56ab..." ]
|
||||||
},
|
},
|
||||||
"mortal": {
|
"mortal": {
|
||||||
// Required: keccak256 hash of the source file
|
// Required: keccak256 hash of the source file
|
||||||
|
@ -694,8 +694,10 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const
|
|||||||
solAssert(s.second.scanner, "Scanner not available");
|
solAssert(s.second.scanner, "Scanner not available");
|
||||||
meta["sources"][s.first]["keccak256"] =
|
meta["sources"][s.first]["keccak256"] =
|
||||||
"0x" + toHex(dev::keccak256(s.second.scanner->source()).asBytes());
|
"0x" + toHex(dev::keccak256(s.second.scanner->source()).asBytes());
|
||||||
meta["sources"][s.first]["url"] =
|
meta["sources"][s.first]["urls"] = Json::arrayValue;
|
||||||
"bzzr://" + toHex(dev::swarmHash(s.second.scanner->source()).asBytes());
|
meta["sources"][s.first]["urls"].append(
|
||||||
|
"bzzr://" + toHex(dev::swarmHash(s.second.scanner->source()).asBytes())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
meta["settings"]["optimizer"]["enabled"] = m_optimize;
|
meta["settings"]["optimizer"]["enabled"] = m_optimize;
|
||||||
meta["settings"]["optimizer"]["runs"] = m_optimizeRuns;
|
meta["settings"]["optimizer"]["runs"] = m_optimizeRuns;
|
||||||
|
Loading…
Reference in New Issue
Block a user