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

Automate account flag during compilation #112

Merged
merged 1 commit into from
May 3, 2022

Conversation

andrew-fleming
Copy link
Contributor

This PR proposes to automatically include the --account_contract flag during compilation if the contract name ends with Account. If this is accepted, it:

  • sets a precedent that account contracts should suffix their name with Account
    • includes the common Account.cairo
  • solves the issue of compiling entire libraries such as OpenZeppelin's Contracts for Cairo
  • will not trigger for contract names such as AccountManager.cairo
  • can still be triggered for uncommon contract names manually
  • sets the sole restriction that non-account contracts should not suffix their name with Account

This resolves #102.


I think it'd be a good idea to add a directive (%) for account contracts as mentioned here by @JulissaDantes. This will probably have to be done in the StarkNet compiler.

@martriay martriay merged commit f771467 into OpenZeppelin:main May 3, 2022
@archseer
Copy link

archseer commented May 3, 2022

Is this case sensitive? I've been using account.cairo/snake case names rather than camel case.

@martriay
Copy link
Contributor

martriay commented May 3, 2022

feel free to open a PR supporting it

@andrew-fleming
Copy link
Contributor Author

Hey, @archseer! Yes, this is case sensitive for the automated flag, but you can still manually set it. Adding snake cased account might be a good idea :)

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

Successfully merging this pull request may close these issues.

Automating the --account_flag during compilation
3 participants