mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
[Fix] Adjust deploy script because beacon is different (#955)
* fix deploy script because beacon is different * use hre * Update contracts/deploy/05_deploy_BridgedToken.ts Co-authored-by: Alain Nicolas <alainncls@users.noreply.github.com> Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com> --------- Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com> Co-authored-by: Alain Nicolas <alainncls@users.noreply.github.com>
This commit is contained in:
@@ -1,13 +1,8 @@
|
|||||||
import { ethers, network, upgrades } from "hardhat";
|
import { ethers, upgrades } from "hardhat";
|
||||||
import { DeployFunction } from "hardhat-deploy/types";
|
import { DeployFunction } from "hardhat-deploy/types";
|
||||||
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
||||||
import { BridgedToken } from "../typechain-types";
|
import { BridgedToken } from "../typechain-types";
|
||||||
import {
|
import { tryVerifyContract, getDeployedContractAddress, tryStoreAddress } from "../common/helpers";
|
||||||
tryVerifyContract,
|
|
||||||
getDeployedContractAddress,
|
|
||||||
tryStoreAddress,
|
|
||||||
LogContractDeployment,
|
|
||||||
} from "../common/helpers";
|
|
||||||
|
|
||||||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
||||||
const { deployments } = hre;
|
const { deployments } = hre;
|
||||||
@@ -29,22 +24,23 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|||||||
|
|
||||||
const bridgedToken = (await upgrades.deployBeacon(BridgedToken)) as unknown as BridgedToken;
|
const bridgedToken = (await upgrades.deployBeacon(BridgedToken)) as unknown as BridgedToken;
|
||||||
|
|
||||||
await LogContractDeployment(contractName, bridgedToken);
|
await bridgedToken.waitForDeployment();
|
||||||
|
|
||||||
const bridgedTokenAddress = await bridgedToken.getAddress();
|
const bridgedTokenAddress = await bridgedToken.getAddress();
|
||||||
process.env.BRIDGED_TOKEN_ADDRESS = bridgedTokenAddress;
|
process.env.BRIDGED_TOKEN_ADDRESS = bridgedTokenAddress;
|
||||||
|
|
||||||
await tryStoreAddress(
|
// @ts-expect-error - deployTransaction is not a standard property but exists in this plugin's return type
|
||||||
hre.network.name,
|
const deployTx = bridgedToken.deployTransaction;
|
||||||
contractName,
|
if (!deployTx) {
|
||||||
bridgedTokenAddress,
|
throw "Contract deployment transaction receipt not found.";
|
||||||
bridgedToken.deploymentTransaction()!.hash,
|
}
|
||||||
);
|
|
||||||
|
await tryStoreAddress(hre.network.name, contractName, bridgedTokenAddress, deployTx.hash);
|
||||||
|
|
||||||
if (process.env.TOKEN_BRIDGE_L1 === "true") {
|
if (process.env.TOKEN_BRIDGE_L1 === "true") {
|
||||||
console.log(`L1 BridgedToken beacon deployed on ${network.name}, at address:`, bridgedTokenAddress);
|
console.log(`L1 BridgedToken beacon deployed on ${hre.network.name}, at address:`, bridgedTokenAddress);
|
||||||
} else {
|
} else {
|
||||||
console.log(`L2 BridgedToken beacon deployed on ${network.name}, at address:`, bridgedTokenAddress);
|
console.log(`L2 BridgedToken beacon deployed on ${hre.network.name}, at address:`, bridgedTokenAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
await tryVerifyContract(bridgedTokenAddress);
|
await tryVerifyContract(bridgedTokenAddress);
|
||||||
|
|||||||
Reference in New Issue
Block a user