Skip to content

Workaround for wildcard output selector bug in solc <= 0.5.8 #755

@cameel

Description

@cameel

Related to argotorg/solidity#14214.

In argotorg/solidity#6606 (released in 0.5.9) we fixed a bug that broke the * at source level. Since solc-js acts as a compatibility layer for older binaries, we should include a workaround for that bug here.

We can avoid triggering the bug by modifying the input JSON to either use * at contract level as well or by listing all contract explicitly.

Repro

{
    "language": "Solidity",
    "sources": {
        "C.sol": {
            "content": "pragma solidity *; contract C {}"
        }
    },
    "settings": {
        "outputSelection": {"*": {"C": ["evm.bytecode"]}}
    }
}
{
    "contracts": {
        "C.sol": {
            "C": {
                "evm": {
                    "bytecode": {
                        "linkReferences": {},
                        "object": "",
                        "opcodes": "",
                        "sourceMap": ""
                    }
                }
            }
        }
    },
    "sources": {
        "C.sol": {
            "id": 0
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    low impactChanges are not very noticeable or potential benefits are limited.medium effortDefault level of effortshould haveWe like the idea but it’s not important enough to be a part of the roadmap.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions