Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Cairo keywords as file names #1086

Description

@cicr99

When the name of a Solidity file is a Cairo reserved word, the Scarb.toml that is created for the output uses the name of the file as the name of the manifest, but Cairo keywords are not allowed for this.

As an example, there is a test: https://github.com/NethermindEth/warp/blob/cairo-1.0/tests/compilation/contracts/errorHandling/assert.sol
The name of the file is assert.sol and so the Scarb file created looks like:

[package]
name = "assert"
version = "1.0.0"

(other stuff)

This test fails on cairo compilation phase with the error message: Expected function, found module in every place there was a call to an assert function in the cairo code.

Suggestion:
Changing the name of the file obviously prevents this issue. However, users shouldn't have to worry about the name of the file, specially when this is not a problem on the Solidity side. If the name of the file is a word that's not allowed we should mangle the name on the output files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions