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

Change bytecode hash for deploy script #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 3 additions & 5 deletions l2-contracts/script/DeployZkCappedMinterFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import * as hre from "hardhat";
import * as fs from 'fs';
import * as path from 'path';

// Read the bytecode hash from ZkCappedMinter.json
// Verify the zksolc version used to compile the contract, the hash changes with different versions
const zkCappedMinterPath = path.join(__dirname, '../zkout/ZkCappedMinter.sol/ZkCappedMinter.json');
const zkCappedMinterJson = JSON.parse(fs.readFileSync(zkCappedMinterPath, 'utf8'));
const BYTECODE_HASH = '0x' + zkCappedMinterJson.hash;
// Get the bytecode hash from ZkCappedMinter.json in ./artifacts-zk
// Verify this bytecode hash before deploying as it can change if the the compilation of the capped minter changes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather save the full bytecode in a file and recalculate the bytecodehash here. This is more feature proof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay we can give that a shot!

const BYTECODE_HASH = "0x010000796655576a236368c33802b0114af403108c937e84b2afa535371ee55c";

async function main() {
dotEnvConfig();
Expand Down