Skip to content

Commit d97d711

Browse files
kuzdogancameel
authored andcommitted
Update metadata docs for "libraries" and "compilationSettings" fields
1 parent d07c219 commit d97d711

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/metadata.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ explanatory purposes.
124124
"version": 1 // NatSpec version
125125
}
126126
},
127-
// Required: Compiler settings. Reflects the settings in the JSON input during compilation.
128-
// Check the documentation of standard JSON input's "settings" field
127+
// Required: Compiler settings.
128+
// Reflects the settings in the JSON input during compilation, except the
129+
// "compilationTarget" and the "libraries" fields. Check each field for details.
130+
// See the standard JSON input's "settings" docs for the rest.
129131
"settings": {
130132
// Required for Solidity: File path and the name of the contract or library this
131-
// metadata is created for.
133+
// metadata is created for. Not a valid field in the standard JSON input settings.
132134
"compilationTarget": {
133135
"myDirectory/myFile.sol": "MyContract"
134136
},
@@ -137,8 +139,11 @@ explanatory purposes.
137139
// Optional: Only present if not null.
138140
"eofVersion": 1,
139141
// Required for Solidity: Addresses for libraries used.
142+
// Note that metadata has a different format for "libraries" field than the standard JSON input.
143+
// metadata format = { "MyLib.sol:MyLib": "0x123123..." }
144+
// standard JSON input format = { "MyLib.sol": { "MyLib": "0x123123..." } }
140145
"libraries": {
141-
"MyLib": "0x123123..."
146+
"MyLib.sol:MyLib": "0x123123..."
142147
},
143148
"metadata": {
144149
// Reflects the setting used in the input json, defaults to "true"

0 commit comments

Comments
 (0)