-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Deploy pre-audit versions of MulticallHandler (#533)
* feat: Initial MulticallHandler deployments * feat: Deploy pre-audit versions of MulticallHandler These are likely to match post-audit versions but are marked pre-audit officially
- Loading branch information
1 parent
c715a6a
commit 59936e9
Showing
23 changed files
with
7,440 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployments, getNamedAccounts } = hre; | ||
const { deploy } = deployments; | ||
|
||
const { deployer } = await getNamedAccounts(); | ||
|
||
// @note if deploying this contract on a chain like Linea that only supports up to | ||
// solc 0.8.19, the hardhat.config solc version needs to be overridden and this | ||
// contract needs to be recompiled. | ||
await deploy("Multicallhandler", { | ||
contract: "MulticallHandler", | ||
from: deployer, | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
args: [], | ||
deterministicDeployment: "0x12345678", // Salt for the create2 call. This will deploy this contract | ||
// at the same address on all chains except ZkSync and Linea which are not EVM equivalent. | ||
}); | ||
}; | ||
module.exports = func; | ||
func.tags = ["Multicallhandler"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as zk from "zksync-web3"; | ||
import { Deployer as zkDeployer } from "@matterlabs/hardhat-zksync-deploy"; | ||
import { DeployFunction, DeploymentSubmission } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const contractName = "MulticallHandler"; | ||
const { deployments } = hre; | ||
|
||
const mnemonic = hre.network.config.accounts.mnemonic; | ||
const wallet = zk.Wallet.fromMnemonic(mnemonic); | ||
const deployer = new zkDeployer(hre, wallet); | ||
|
||
const artifact = await deployer.loadArtifact(contractName); | ||
const constructorArgs = []; | ||
|
||
const _deployment = await deployer.deploy(artifact, constructorArgs); | ||
const newAddress = _deployment.address; | ||
console.log(`New ${contractName} implementation deployed @ ${newAddress}`); | ||
|
||
// Save the deployment manually because OZ's hardhat-upgrades packages bypasses hardhat-deploy. | ||
// See also: https://stackoverflow.com/questions/74870472 | ||
const extendedArtifact = await deployments.getExtendedArtifact(contractName); | ||
const deployment: DeploymentSubmission = { | ||
address: newAddress, | ||
...extendedArtifact, | ||
}; | ||
await deployments.save(contractName, deployment); | ||
|
||
await hre.run("verify:verify", { address: newAddress, constructorArguments: constructorArgs }); | ||
}; | ||
|
||
module.exports = func; | ||
func.tags = ["MulticallHandlerZk", "zksync"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.