-
Notifications
You must be signed in to change notification settings - Fork 344
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
Need --account-contract
flag when importing IAccount
#328
Comments
Agree with this. I don't think this flag makes much sense cc/@bbrandtom. If the idea is to protect users from mis-deploying (not sure if that's a good idea either), then the filter should be on deployment not compilation. Do consider @JulissaDantes' suggestion of using a language directive. |
I was unable to reproduce the issue. What do you mean by |
@ilyalesokhin-starkware thanks for having a look at this! Here's a minimal working (failing) example. I'm trying to compile it with https://gist.github.com/pscott/aa99849a1e1b53f2eaed3f71de642e8e |
The example compiles on my machine. Are you sure you didn't change one of the imported files to include an |
Interesting... I'm using I have not added any Maybe someone else can reproduce? |
Also it should be noted that I'm using the |
This is related to the #291 and it's already fixed in the main branch of openzeppelin-cairo-contracts. openzeppelin-cairo-contracts v0.1.0 is broken. |
All right so I guess problem solved! So I guess you testing with a local clone of the OZ repo? @martriay @andrew-fleming do you think OZ could issue a |
Your guess is correct, my first attempt to reproduce the issue failed as I fetched the most recent master from the OZ repo. |
No, we're really close to I still think the flag is problematic and I vote for removing it, see OpenZeppelin/nile#112 for example. |
@martriay why do you think the flag is problematic? Why an 'account' directive will be better? |
Because you can't just compile all the contracts on a project, and there's no easy nor reliable way to identify them. It's also unclear to me the added value. A directive I would assume serves the same purpose you intend to give it, without interfering with compilation/tooling and if anything, providing a way for tooling to circumvent the issue. |
Closing this since it will not be relevant anymore after the ongoing Cairo 1.0 migration. If you think this is a mistake, feel free to open a new issue. |
IAccount
exopses the__execute__
function which gets the cairo-compiler to yell and error like this:Unfortunately this means I can't write a contract that includes
IAccount
without adding the--account-contract
flag (which is plain wrong because I'm NOT writing an account contract but simply interacting with one!).Not sure OZ can do anything about it, I think we need to address this to the StarkWare team but just putting it out there :)
The text was updated successfully, but these errors were encountered: