Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce the overwriting in ArtifactStorage in the case of bytecodeHash as a key #65

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.22

* Enforce the overwriting in ArtifactStorage in the case of bytecodeHash as a key

## Version 2.0.0-alpha.21

* Fix a bug related to parsing the same bytecode for two different contracts
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.21",
"version": "2.0.0-alpha.22",
"description": "Automatic deployment and verification of smart contracts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/tools/reporters/Reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { MigrateConfig } from "../../types/migrations";
import { ChainRecord, predefinedChains } from "../../types/verifier";
import { ContractFieldsToSave, MigrationMetadata, TransactionFieldsToSave } from "../../types/tools";

// TODO: parse everything that is possible from hardhat config (deployment on q devnet bad UI)

@catchError
class Reporter {
private _config: MigrateConfig = {} as any;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/storage/ArtifactProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ArtifactProcessor {

// 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);
ArtifactStorage.set(bytecodeHash(artifact.bytecode), contract, true);
}
}

Expand Down