publish proxy contracts
import { deployedAddressesFromEnv } from '../src.ts/deploy';
+import { ethers } from 'ethers';
const hre = require('hardhat');
@@ -8,13 +9,60 @@ async function main() {
return;
}
const addresses = deployedAddressesFromEnv();
- for (const address of [addresses.ZkSyncTarget, addresses.VerifierTarget, addresses.GovernanceTarget]) {
+ for (const address of [
+ addresses.ZkSyncTarget,
+ addresses.VerifierTarget,
+ addresses.GovernanceTarget,
+ addresses.UpgradeGatekeeper
+ ]) {
try {
await hre.run('verify', { address });
} catch (e) {
console.error(e);
}
}
+
+ {
+ const address = addresses.ZkSync;
+ const zkSyncEncodedArguments = ethers.utils.defaultAbiCoder.encode(
+ ['address', 'address', 'bytes32'],
+ [addresses.Governance, addresses.Verifier, process.env.GENESIS_ROOT]
+ );
+
+ const constructorArguments = [addresses.ZkSyncTarget, zkSyncEncodedArguments];
+
+ try {
+ await hre.run('verify', { address, constructorArguments });
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
+ {
+ const address = addresses.Governance;
+ const governanceEncodedArguments = ethers.utils.defaultAbiCoder.encode(['address'], [addresses.DeployFactory]);
+
+ const constructorArguments = [addresses.GovernanceTarget, governanceEncodedArguments];
+
+ try {
+ await hre.run('verify', { address, constructorArguments });
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
+ {
+ const address = addresses.Verifier;
+ const verifierEncodedArguments = ethers.utils.defaultAbiCoder.encode([], []);
+
+ const constructorArguments = [addresses.VerifierTarget, verifierEncodedArguments];
+
+ try {
+ await hre.run('verify', { address, constructorArguments });
+ } catch (e) {
+ console.error(e);
+ }
+ }
}
main()
