diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c53d1..ebf6af7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 2.0.0-alpha.21 + +* Fix a bug related to parsing the same bytecode for two different contracts + ## Version 2.0.0-alpha.20 * Remove redundant initializers in a verifier task diff --git a/package.json b/package.json index 13e9b4e..6bf82f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@solarity/hardhat-migrate", - "version": "2.0.0-alpha.20", + "version": "2.0.0-alpha.21", "description": "Automatic deployment and verification of smart contracts", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/src/tools/storage/ArtifactProcessor.ts b/src/tools/storage/ArtifactProcessor.ts index eae84f2..681d166 100644 --- a/src/tools/storage/ArtifactProcessor.ts +++ b/src/tools/storage/ArtifactProcessor.ts @@ -25,7 +25,10 @@ export class ArtifactProcessor { } ArtifactStorage.set(name, contract); - ArtifactStorage.set(bytecodeHash(artifact.bytecode), contract); + + // Forcing the overwriting of the existing bytecode value in the Artifacts storage is necessary to prevent + // failure in edge cases, such as with internal libraries or disabled bytecode metadata hash generation. + ArtifactStorage.set(bytecodeHash(artifact.bytecode), contract, artifact.abi.length === 0); } }