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
We use a function useCompiler in various places to compile contracts. This function provides a small wrapper around the solc compiler in order to download it and invoke the compilation.
The code was duplicated across multiple places, namely in the tests of lib-sourcify, in serverless/compiler-lambda and in the server code. In order to minimize the effort for maintenance and synchronization of these code parts, they should be moved into a public package. Basically the content of services/server/src/server/services/compiler/local/solidityCompiler.ts should be the content of the new package.
The content you are editing has changed. Please copy your edits and refresh the page.
My proposal is to build this package with the idea of shipping multiple compilers in mind. For example doing something like this: https://github.com/lodash/lodash/tree/4.5.0-npm-packages. (We can actually do the same thing just by having multiple compilers under packages/)
The final objective should be being able to do something like this in nodejs
import { CheckedContract } from "@ethereum-sourcify/lib-sourcify"
import {initCompiler} from "@ethereum-sourcify/compilers/solidity/nodejs"
const compiler = initCompiler(...)
const contract = new CheckedContract(compiler, metadata, sources);
And something like this in the browser
import { CheckedContract } from "@ethereum-sourcify/lib-sourcify"
import {initCompiler} from "@ethereum-sourcify/compilers/solidity/browser"
const compiler = initCompiler(...)
const contract = new CheckedContract(compiler, metadata, sources);
We use a function
useCompiler
in various places to compile contracts. This function provides a small wrapper around the solc compiler in order to download it and invoke the compilation.The code was duplicated across multiple places, namely in the tests of
lib-sourcify
, inserverless/compiler-lambda
and in the server code. In order to minimize the effort for maintenance and synchronization of these code parts, they should be moved into a public package. Basically the content ofservices/server/src/server/services/compiler/local/solidityCompiler.ts
should be the content of the new package.Tasks
The text was updated successfully, but these errors were encountered: