Open crazyrabbitLTC opened 5 years ago
I have looked into this a bit more. The error above comes from an error in my contract. However this brings up an interesting UI experience:
oz create
simply does not list the contract as available to create. While while oz compile
tries to compile everything and shares the error messages.
However after using oz compile
, I then tried oz create
again, but the flow is unexpectedly different, it does not ask for me to select the contract to create, rather it seems to "deploy" all the contracts. But does not list the address where they are deployed nor gives me the option to call a function.
Does this flow make sense?
Hey @crazyrabbitLTC! The catch here is that create
now runs a push
under the hood. And push
effectively pushes all contracts added to your project, not just the one you are trying to create at that moment.
What is happening on your last create
is that that all contracts add
ed to your project are being pushed, since they have changed. After they are deployed, the CLI tries to look for a contract to create. However, for some reason it is failing to pick them up.
So here comes the request for more info: what do your contracts look like? Which of them have errors? Which of them are abstract? Is there a problem with contracts in nested folders after all? What can you see in your build/contracts
folder?
Hello @spalladino! The problem was typos: I renamed ERC20 to erc20 and didn't update elsewhere.
I have a theory about what happens in the flow, when I do create
it runs push
and compiles the contracts. The contracts that fail to compile however silently fail and only the completed compilations get .json
artifacts created. Thus when instead I do oz add WordStorage
it also compiles the contract, fails, but then looks for the .json
to add to the project .json
and doesn't find it.
The second example of oz create
I don't quite understand yet though. I would expect, regardless if a contract was already deployed, to be offered the opportunity to create yet a new instance.
The second example of oz create I don't quite understand yet though. I would expect, regardless if a contract was already deployed, to be offered the opportunity to create yet a new instance.
Is this still happening? Can you upload your current working directory somewhere so I can test it out?
Yes it's still happening. Maybe I'm not using it correct but then we should maybe have a better error message.
The repo is open, please forgive the spaghetti code. It's a testing work in progress. https://github.com/crazyrabbitLTC/word-dao/tree/refactor
I've been able to reproduce it with 2.5.0-rc.0, but it seems to be fixed with 2.5.0-rc.1. Could you confirm?
Yes! The UI flow seems to be correct with 2.5.0-rc.1 so I'll close the issue. Thanks!
I'm going to reopen the issue, I seem to have the same problem again.
The UX for dealing with contracts that are abstract is a bit confusing. oz compile
now does not seem to catch it, while oz create ChatApp
does.
Additinoally, --verbose
doesn't expose that much more detail for compile
or create
.
Just to clarify: the issue is not that there is an error on the contract, but that the only available contract is abstract, right?
Correct, the only available contract is abstract, but otherwise is fine.
In my contracts folder I have several contracts, including a nested folder of contracts.
However when I run the
oz create
command, the cli prompt only shows me two of them:I understand if we don't catch nested contracts, (they are in a folder only to be inherited from), but i don't understand why my third contract WordStorage.sol is not showing up.