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
- Document the necessity of using long version string in loadRemoteVersion
- Add note about low-level functions
- Fix SRI documentation
- Improve text
Co-authored-by: Christian Parpart <[email protected]>
Co-authored-by: matheusaaguiar <[email protected]>
Co-authored-by: Kamil Śliwak <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+35-8Lines changed: 35 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,6 +204,9 @@ The low-level API is as follows:
204
204
205
205
For examples how to use them, please refer to the README of the above mentioned solc-js releases.
206
206
207
+
**Note**: These low-level functions remain available for compatibility reasons.
208
+
However, they were superseded by the `compile()` function and are no longer required in newer versions. The functions `compileSingle`, `compileMulti` and `compileCallback` are always `null` in the newer versions.
When using libraries, the resulting bytecode will contain placeholders for the real addresses of the referenced libraries. These have to be updated, via a process called linking, before deploying the contract.
@@ -308,25 +321,39 @@ Add the version of `solc` you want to use into `index.html`:
308
321
```html
309
322
<script
310
323
type="text/javascript"
311
-
src="https://binaries.soliditylang.org/bin/{{ SOLC VERSION }}.js"
312
-
integrity="sha256-{{ BASE64-ENCODED HASH OF SOLC VERSION }}"
(Alternatively, use `https://binaries.soliditylang.org/bin/soljson-latest.js` to get the latest version.)
330
+
This will load `solc` into the global variable `window.Module`.
331
+
Alternatively, use `soljson-latest.js` as `{{ SOLC_VERSION }}.js` in the code snippet above to load the latest version.
318
332
319
333
It is recommended that you check the integrity of the resource being fetched before using it in your application.
320
334
For that, you can use the [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) feature.
321
-
Adding SRI configuration to your HTML script tag ensures that the resource will only be loaded in the browser if the cryptographic hashes matches.
335
+
Adding SRI configuration to your HTML script tag ensures that the resource will only be loaded by the browser if the cryptographic hashes match.
322
336
323
-
You can run the script [get-sri.sh](./get-sri.sh) informing the desired solc-js version or compute it yourself based on the base64-encoded version of the sha256 hash of the release.
337
+
You can generate the SRI hash yourself based on the base64-encoded version of the sha256 hash of the release.
338
+
For example, after downloading version `v0.8.16+commit.07a7930e`, run:
0 commit comments