Skip to content

Commit ac84ec2

Browse files
committed
Initialize newly deployed implementation contract
This is not strictly necessary, but can help to avoid some social engineering attacks
1 parent 1b8ec38 commit ac84ec2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

deploy/61_prepare_upgrade_token_staking.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { DeployFunction } from "hardhat-deploy/types"
44
import { ethers, upgrades } from "hardhat"
55

66
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
7-
const { deployments } = hre
8-
const { log } = deployments
7+
const { getNamedAccounts, deployments } = hre
8+
const { log, execute } = deployments
99

1010
const T = await deployments.get("T")
1111
const VendingMachineNuCypher = await deployments.get("VendingMachineNuCypher")
@@ -51,6 +51,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5151
}
5252
)
5353

54+
// initialize implementation
55+
const { deployer } = await getNamedAccounts()
56+
await execute(
57+
"TokenStaking",
58+
{ from: deployer, to: implAddress },
59+
"initialize"
60+
)
5461
}
5562
}
5663

0 commit comments

Comments
 (0)