This project demonstrates how to use the @ethereum-sourcify/lib-sourcify
library directly within a web browser. It leverages web-solc
to dynamically fetch and execute the Solidity compiler (solc
) in the browser.
It demonstrates two primary verification flows:
- Verification via JSON Input: Manually constructs the
SolidityJsonInput
object required by the compiler. - Verification via Metadata: Fetches a Solidity metadata file (
metadata.json
) and uses it to drive the verification process.
In both cases:
- An implementation of
ISolidityCompiler
fromlib-sourcify
is created usingfetchSolc
fromweb-solc
. Verification
object fromlib-sourcify
is instantiated.- The
verification.verify()
method is running the Sourcify verification flow in the browser.
- Install dependencies:
npm install
- Start the development server:
npm run dev