Skip to content

bug: lz:deploy requires deploy task name matches contractName #1066

Description

@St0rmBr3w

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.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions