zkapp-cli
zkapp-cli copied to clipboard
Improve feedback when smart contract is not exported from `index.ts`
Currently, smart contracts are identified by searching through the build folder.
If they are not also exported from index.ts, then the developer will see a very cryptic sequence of logs during zk deploy:
Only one smart contract exists in the project: ExampleContract
Your config.json was updated to always use this
smart contract when deploying to this network.
So far so good. But then the error:
Failed to find the "ExampleContract" smart contract in your build directory.
Please confirm that your config.json contains the name of the smart contract that you desire to deploy to this deploy alias.
This error message should
- know whether this smart contract is in the deploy alias
- tell you to also export it from
index.ts
Here's the code that should be improved: https://github.com/o1-labs/zkapp-cli/blob/e1f89a47c224149129d7339085c1559d991f9fe9/src/lib/deploy.js#L196-L209
I think this should be addressed in course of the refactor described here: https://github.com/o1-labs/zkapp-cli/issues/232