Skip to content

"{" in base contract constructor parameter string confuses instumentation #478

Closed
@KaiRo-at

Description

@KaiRo-at

I have a contract using my patches in OpenZeppelin/openzeppelin-contracts#2029 to add a URL to an ERC-1155 token, with code like this:

import ".../ERC1155MetadataURICatchAll.sol";
contract MYToken is ERC1155MetadataURICatchAll("https://example.com/meta/{id}"), {
    // Some contract code...
}

This compiles and works fine in general, but when running coverage, the instrumentation gets confused by the curly braces in the string and I get an error like this:

.../MYToken.sol:15:51: ParserError: Expected string end-quote.
 ... oken is ERC1155MetadataURICatchAll("https://example.com/meta/{event __CoverageMYToken(string fileName, uint256 lineNumber);
                                        ^--------------------------------------------------------------------------------------^

Compilation failed. See above.
Truffle v5.1.12 (core: 5.1.12)
Node v10.18.1
Cleaning up...
Event trace could not be read.
Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...

When I remove the curly braces from the string before running coverage, it works correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions