LayerZero-Labs / devtools

LayerZero Endpoint V2 Examples and Developer Tooling

Home Page:https://docs.layerzero.network/

Repository from Github https://github.comLayerZero-Labs/devtoolsRepository from Github https://github.comLayerZero-Labs/devtools

bug: `lz:deploy` requires deploy task name matches `contractName`

St0rmBr3w opened this issue · comments


Title: bug: lz:deploy requires deploy task name matches contractName


Describe the bug

When running npx hardhat lz:deploy, if the contractName and deploy script do not match, the deployment process indicates success without generating a deployment file or submitting the contract on the blockchain.


To Reproduce

Steps to reproduce the behavior:

  1. Run the deploy command with mismatched names:
    npx hardhat lz:deploy
  2. Provide mismatched contractName and deploy script when prompted.
  3. Observe the misleading success message despite no actual deployment:
    Nothing to compile
    ✔ Which networks would you like to deploy? › sepolia-testnet
    ✔ Which deploy script tags would you like to use? … MyOFT
    info:    Will deploy 1 network: sepolia-testnet
    info:    Will use deploy scripts tagged with MyOFT
    ✔ Do you want to continue? … yes
    info:    ✓ Your contracts are now deployed
    

Expected behavior

The deployment process should either:

  • Fail with an error message indicating that the contractName and deploy script do not match, preventing a misleading success notification.

    OR

  • Automatically handle the mismatch by either adjusting internally or prompting the user to correct the mismatch before proceeding.

Additionally, a deployment file should be generated, and the contract should be correctly submitted on the blockchain.


Screenshots

Example of misleading success message:

Nothing to compile
✔ Which networks would you like to deploy? › sepolia-testnet
✔ Which deploy script tags would you like to use? … MyOFT
info:    Will deploy 1 network: sepolia-testnet
info:    Will use deploy scripts tagged with MyOFT
✔ Do you want to continue? … yes
info:    ✓ Your contracts are now deployed

Environment (please complete the following information):

  • OS: [e.g., macOS]
  • OS Version: [e.g., 12.6.3]
  • VM: [e.g., Node.js]
  • VM Version: [e.g., 18.16.0]

Additional context

This issue can lead to confusion and potential deployment issues, as developers might believe their contracts are deployed successfully while no actual deployment has occurred. Ensuring that contractName and deploy script names are synchronized is crucial for the reliability of the deployment process.


I think the improvement can be to output "No deploy scripts match the given tag <TAG_HERE>"