Skip to content

Commit

Permalink
Fix a bug related to parsing the same bytecode for two different co… (#…
Browse files Browse the repository at this point in the history
…64)

* Fixed a bug related to parsing the same bytecode for two different contracts

* Updated CHANGELOG.md and versions

* Clarified comment
  • Loading branch information
KyrylR authored Dec 15, 2023
1 parent d4e2b93 commit 0f5330b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 4 additions & 1 deletion src/tools/storage/ArtifactProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0f5330b

Please sign in to comment.