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

Cairo keywords as file names #1086

Open
cicr99 opened this issue Jun 8, 2023 · 0 comments
Open

Cairo keywords as file names #1086

cicr99 opened this issue Jun 8, 2023 · 0 comments

Comments

@cicr99
Copy link
Contributor

cicr99 commented Jun 8, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant