Skip to content

bug: deployedContracts file being out of sync #369

@kevinjoshi46b

Description

@kevinjoshi46b

Current Behavior

Currently the deployments folder in hardhat has been gitignored leading to all the data related to deployments being stored only on local computer.

The deployedContracts file in nextjs is being generated based on this deployments folder whenever a new deployment takes place.

Consider a scenario where you deployed the smart contract on polygon from your machine which updated the deployedContracts file with its address, abi etc. You committed and pushed all the changes to github. Now someone else working on the same project pulled the changes and deployed the contract on arbitrum, what happens is the deployedContracts file gets updated with the deployement data of only arbitrum and looses the data from polygon since the second person doesn't have the deployements folder containing data related to deployment on polygon chain on their computer.

Expected Behavior

The expected behavior would be when the second person deploys the contract on arbitrum the deployedContracts file should be updated by appending the data related to arbitrum deployment and not loosing any previously existing deployment data related to other chains

Anything else?

Removing the deployments folder in hardhat from gitignore solves this issue of inconsistency. I am not sure on why it was added but I am currently unable to see any reason for its existence if there is some please do enlighten me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions