@@ -124,56 +124,29 @@ explanatory purposes.
124
124
" version" : 1 // NatSpec version
125
125
}
126
126
},
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:
129
+ // - Different format: "libraries" field
130
+ // - Added field in metadata.settings: "compilationTarget"
131
+ // - Not in metadata.settings: "stopAfter", "debug.debugInfo", "outputSelection"
132
+ // See the standard JSON input's "settings" field docs for the rest.
129
133
" settings" : {
130
134
// Required for Solidity: File path and the name of the contract or library this
131
- // metadata is created for.
135
+ // metadata is created for. This field is not present in the standard JSON input settings.
132
136
" compilationTarget" : {
133
137
" myDirectory/myFile.sol" : " MyContract"
134
138
},
135
- // Required for Solidity.
136
- " evmVersion" : " london" ,
137
- // Optional: Only present if not null.
138
- " eofVersion" : 1 ,
139
139
// Required for Solidity: Addresses for libraries used.
140
+ // Note that metadata has a different format for "libraries" field than the standard JSON input.
141
+ // metadata format = { "MyLib.sol:MyLib": "0x123123..." }
142
+ // standard JSON input format = { "MyLib.sol": { "MyLib": "0x123123..." } }
140
143
" libraries" : {
141
- " MyLib" : " 0x123123..."
144
+ " MyLib.sol:MyLib " : " 0x123123..."
142
145
},
143
- " metadata" : {
144
- // Reflects the setting used in the input json, defaults to "true"
145
- " appendCBOR" : true ,
146
- // Reflects the setting used in the input json, defaults to "ipfs"
147
- " bytecodeHash" : " ipfs" ,
148
- // Reflects the setting used in the input json, defaults to "false"
149
- " useLiteralContent" : true
150
- },
151
- // Optional: Optimizer settings. The fields "enabled" and "runs" are deprecated
152
- // and are only given for backward-compatibility.
153
- " optimizer" : {
154
- " details" : {
155
- " constantOptimizer" : false ,
156
- " cse" : false ,
157
- " deduplicate" : false ,
158
- // inliner defaults to "false"
159
- " inliner" : false ,
160
- // jumpdestRemover defaults to "true"
161
- " jumpdestRemover" : true ,
162
- " orderLiterals" : false ,
163
- // peephole defaults to "true"
164
- " peephole" : true ,
165
- " yul" : true ,
166
- // Optional: Only present if "yul" is "true"
167
- " yulDetails" : {
168
- " optimizerSteps" : " dhfoDgvulfnTUtnIf..." ,
169
- " stackAllocation" : false
170
- }
171
- },
172
- " enabled" : true ,
173
- " runs" : 500
174
- },
175
- // Required for Solidity: Sorted list of import remappings.
176
- " remappings" : [ " :g=/dir" ]
146
+ // ...
147
+ // ...
148
+ // ...
149
+ // The rest of the fields and their defaults same as in std JSON input.
177
150
},
178
151
// Required: Compilation source files/source units, keys are file paths
179
152
" sources" : {
0 commit comments