You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-8Lines changed: 39 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,14 @@ There are two ways to use `solc`:
44
44
45
45
The high-level API consists of a single method, `compile`, which expects the [Compiler Standard Input and Output JSON](https://solidity.readthedocs.io/en/v0.5.0/using-the-compiler.html#compiler-input-and-output-json-description).
46
46
47
-
It also accepts an optional callback function to resolve unmet dependencies. This callback receives a path and must synchronously return either an error or the content of the dependency as a string.
48
-
It cannot be used together with callback-based, asynchronous, filesystem access. A workaround is to collect the names of dependencies, return an error, and keep re-running the compiler until all
49
-
of them are resolved.
47
+
It also accepts an optional set of callback functions, which include the ``import`` and the ``smtSolver`` callbacks.
48
+
Starting 0.6.0 it only accepts an object in place of the callback to supply the callbacks.
50
49
51
-
Starting 0.5.12 it also accepts an object in place of the callback to supply different kind of callbacks, however only file imports are supported.
50
+
The ``import`` callback function is used to resolve unmet dependencies.
51
+
This callback receives a path and must synchronously return either an error or the content of the dependency
52
+
as a string. It cannot be used together with callback-based, asynchronous,
53
+
filesystem access. A workaround is to collect the names of dependencies, return
54
+
an error, and keep re-running the compiler until all of them are resolved.
52
55
53
56
#### Example usage without the import callback
54
57
@@ -115,10 +118,7 @@ function findImports(path) {
115
118
elsereturn { error:'File not found' };
116
119
}
117
120
118
-
// Current syntax
119
-
var output =JSON.parse(solc.compile(JSON.stringify(input), findImports));
120
-
121
-
// New syntax (supported from 0.5.12)
121
+
// New syntax (supported from 0.5.12, mandatory from 0.6.0)
0 commit comments