You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
[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
When the name of a Solidity file is a Cairo reserved word, the
Scarb.tomlthat 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.soland so the Scarb file created looks like:This test fails on cairo compilation phase with the error message:
Expected function, found modulein every place there was a call to anassertfunction 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