Skip to content

Solcjs fails to be imported for version 0.4.10 #2029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marcocastignoli opened this issue Mar 24, 2025 · 0 comments
Open

Solcjs fails to be imported for version 0.4.10 #2029

marcocastignoli opened this issue Mar 24, 2025 · 0 comments

Comments

@marcocastignoli
Copy link
Member

Solcjs fails to be imported for version 0.4.10, I didn't check yet versions < 0.4.10

The function below throws a "Maximum call stack size exceeded" when being called with version 0.4.10+commit.f0d539ae

export async function getSolcJs(
solJsonRepoPath: string,
version: string,
): Promise<any> {
// /^\d+\.\d+\.\d+\+commit\.[a-f0-9]{8}$/
version = version.trim();
if (version !== 'latest' && !version.startsWith('v')) {
version = 'v' + version;
}
const fileName = `soljson-${version}.js`;
const solJsonPath = path.resolve(solJsonRepoPath, fileName);
if (!fs.existsSync(solJsonPath)) {
logDebug('Solc-js not found locally, downloading', {
version,
solJsonPath,
});
if (!(await fetchAndSaveSolc('bin', solJsonPath, version, fileName))) {
return false;
}
}
const solcjsImports = await import(solJsonPath);
return solc.setupMethods(solcjsImports);
}

I think that's the reason why we don't have any contract stored in the database with version <= 0.4.10

Image

To execute the query above

select cc."version", count(*) as contracts
from compiled_contracts cc
where cc."compiler" = 'solc'
group by cc."version"
order by "version" desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant