Skip to content

Commit

Permalink
feat: + select solc version
Browse files Browse the repository at this point in the history
  • Loading branch information
vidalpaulbws committed Jul 24, 2023
1 parent 0076547 commit 0171d84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export const handler: Handler<Request, Response> = async (event) => {
},
};

const output = JSON.parse(solc.compile(JSON.stringify(input)));
const compiler = await solc.loadRemoteVersion(solcVersion);

const output = JSON.parse(compiler.compile(JSON.stringify(input)));

if (output.errors) {
return {
Expand Down
5 changes: 5 additions & 0 deletions types/solc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ declare namespace solc {
): string;

function compile(source: string | object): string;

function loadRemoteVersion(
version: string,
callback?: (error: Error, solc: solc) => void
): Promise<solc>;
}

export = solc;

0 comments on commit 0171d84

Please sign in to comment.