Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate define-x names #391

Closed
Acaccia opened this issue Apr 25, 2024 · 0 comments · Fixed by #404
Closed

Validate define-x names #391

Acaccia opened this issue Apr 25, 2024 · 0 comments · Fixed by #404
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Acaccia
Copy link
Collaborator

Acaccia commented Apr 25, 2024

There is currently no checks on the validity of the names given in those functions:

  • define-data-var
  • define-map
  • define-fungible-token
  • define-non-fungible-token
  • define-private
  • define-public
  • define-read-only
  • define-trait (only trait name, methods names seem to be okay if they clash)

Here is a example of Clarity code that should fail:

>> (define-data-var map int 0)
error: Runtime Error: Runtime error while interpreting ST000000000000000000002AMW42H.contract-0: Unchecked(NameAlreadyUsed("map"))
@Acaccia Acaccia added the bug Something isn't working label Apr 25, 2024
@ameeratgithub ameeratgithub self-assigned this Apr 29, 2024
@csgui csgui added this to the WASM Phase 1 milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants