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

Cairo contract kickstarter command #28

Open
AbdelStark opened this issue May 19, 2022 · 6 comments
Open

Cairo contract kickstarter command #28

AbdelStark opened this issue May 19, 2022 · 6 comments
Labels
Context: intricated deep understanding of the codebase required Difficulty: hard require extensive knowledge about the field Duration: few days will take a few days State: open ready for contribution Techno: cairo cairo Techno: js javascript/typescript Type: feature a new feature to implement

Comments

@AbdelStark
Copy link
Contributor

Description

Implement a sub generator to quickly bootstrap a new Cairo contract.

The CLI could guide the user and let the possibility to:

  • Choose contract name
  • Generate associated test file: y/n ?
  • Add one or multiple storage fields
    • type name
    • type field type
    • generate view: y/n ?
    • add in constructor: y/n ?
  • Generate constructor
  • Is Ownable: y/n ? If yes use Ownable_initializer(owner)

Acceptance criteria

  • Contract is correctly generated based on user choices
  • The generated contract compiles
  • The associated test files pass
@AbdelStark AbdelStark added Type: feature a new feature to implement Duration: few days will take a few days Context: intricated deep understanding of the codebase required State: open ready for contribution Techno: cairo cairo Difficulty: hard require extensive knowledge about the field Techno: js javascript/typescript labels May 19, 2022
@ericglau
Copy link
Contributor

ericglau commented May 19, 2022

If this is intended to be for a contract in general (e.g. not ERC20 or ERC721), this could make use of and depend on OpenZeppelin/contracts-wizard#110 OpenZeppelin/contracts-wizard#131

@AbdelStark
Copy link
Contributor Author

AbdelStark commented May 19, 2022

OpenZeppelin/contracts-wizard#110

Oh yeah for sure. Did not see that it could work for General contract.
Of course we can use OZ wizard.
When will it be released approximately ?

@ericglau
Copy link
Contributor

No specific timeline yet but this issue can influence the requirements of the linked wizard issue.

Or in other words, part of the implementation of this issue should occur in the wizard codebase rather than in generator-starknet.

@AbdelStark
Copy link
Contributor Author

So how do we synchronise the effort on this ?
More broadly how can we collaborate with OZ on such topics ?

@ericglau
Copy link
Contributor

ericglau commented May 19, 2022

I think collaborating on GitHub with specific requirements would work but am open to suggestions. I've opened an issue linked above to propose the API for this and would welcome any feedback.

@ericglau
Copy link
Contributor

ericglau commented Jun 20, 2022

Some updates:

The above would cover the "Generate constructor" and "Is Ownable: y/n ? If yes use Ownable_initializer(owner)" requirements in the original description.

It does not include storage fields yet but that can be added separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context: intricated deep understanding of the codebase required Difficulty: hard require extensive knowledge about the field Duration: few days will take a few days State: open ready for contribution Techno: cairo cairo Techno: js javascript/typescript Type: feature a new feature to implement
Projects
None yet
Development

No branches or pull requests

2 participants