Skip to content
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

Null-Checking for bytecode in solc-transpiler #66

Merged
merged 2 commits into from
Apr 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/solc-transpiler/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ export const compile = (configJsonString: string, callbacks?: any): string => {
for (const [filename, fileJson] of Object.entries(res.contracts)) {
log.debug(`Transpiling file: ${filename}`)
for (const [contractName, contractJson] of Object.entries(fileJson)) {
if (
!contractJson ||
!contractJson.evm ||
!contractJson.evm.bytecode ||
!contractJson.evm.deployedBytecode
) {
continue
}
// Library links in bytecode strings have invalid hex: they are of the form __$asdfasdf$__.
// Because __$ is not a valid hex string, we replace with a valid hex string during transpilation,
// storing the links re-substituting the __$* strings afterwards
Expand Down