Skip to content

Commit 9176943

Browse files
authored
Merge pull request #92 from threshold-network/fix-keep-registry-resolve
Fix deployment of KeepRegistryStub for external projects When a KeepRegistry deployed contract is not found for local network we wan to deploy a stub. The script can also be used by external projects to deploy threshold network contract dependencies. When we used keepDeployer the external projects deployment was failing as it required the account to be defined also in the other project's hardhat configuration file. To fix that we use deployer named account to deploy the stub, as it will for sure be defined in other projects. To call the approveOperatorContract we use keepRegistryKeeper which is defined by default as account 0 and it matches the deployer.
2 parents c49b9b2 + 404c568 commit 9176943

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

deploy/00_resolve_keep_registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DeployFunction } from "hardhat-deploy/types"
44
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
55
const { getNamedAccounts, deployments, helpers } = hre
66
const { log } = deployments
7-
const { keepDeployer } = await getNamedAccounts()
7+
const { deployer } = await getNamedAccounts()
88

99
const KeepRegistry = await deployments.getOrNull("KeepRegistry")
1010

@@ -20,7 +20,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2020

2121
await deployments.deploy("KeepRegistry", {
2222
contract: "KeepRegistryStub",
23-
from: keepDeployer,
23+
from: deployer,
2424
log: true,
2525
})
2626
}

deploy/08_configure_keep_registry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import { DeployFunction } from "hardhat-deploy/types"
33

44
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
55
const { getNamedAccounts, deployments } = hre
6-
const { keepDeployer } = await getNamedAccounts()
6+
const { keepRegistryKeeper } = await getNamedAccounts()
77
const { execute, log } = deployments
88

99
const TokenStaking = await deployments.get("TokenStaking")
1010

1111
await execute(
1212
"KeepRegistry",
13-
{ from: keepDeployer },
13+
{ from: keepRegistryKeeper },
1414
"approveOperatorContract",
1515
TokenStaking.address
1616
)
1717

1818
log(
19-
`Approved T TokenStaking operator contract [${TokenStaking.address}] in Keep registry`
19+
`Approved T TokenStaking operator contract [${TokenStaking.address}] in KeepRegistry`
2020
)
2121
}
2222

hardhat.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ const config: HardhatUserConfig = {
113113
thresholdCouncil: {
114114
mainnet: "0x9F6e831c8F8939DC0C830C6e492e7cEf4f9C2F5f",
115115
},
116-
keepDeployer: {
117-
default: 0,
116+
keepRegistryKeeper: {
117+
default: 0, // same as the deployer
118118
ropsten: "0x923C5Dbf353e99394A21Aa7B67F3327Ca111C67D",
119119
},
120120
},

0 commit comments

Comments
 (0)