-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add batch transfer deployment and add setup script
- Loading branch information
1 parent
1a2bd4c
commit cb55d05
Showing
4 changed files
with
574 additions
and
2 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
42 changes: 42 additions & 0 deletions
42
packages/deploy/deploy/900_batch_transfer/801_add_operators.ts
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,42 @@ | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {execute, log, read, catchUnknownSigner} = deployments; | ||
const {deployer} = await getNamedAccounts(); | ||
|
||
const operatorRole = await read('BatchTransfer', 'OPERATOR_ROLE'); | ||
|
||
const operators = [ | ||
'0x782788bB333feB56bbC426588263Db9671F074c1', // (NFT Vault for DAO) | ||
'0x7A9fe22691c811ea339D9B73150e6911a5343DcA', // (Seb) | ||
'0x51b66b4cb9053726442752f1a722ce5438553a88', // (QA PROD Account) | ||
]; | ||
|
||
for (const operator of operators) { | ||
const isOperator = await read( | ||
'BatchTransfer', | ||
'hasRole', | ||
operatorRole, | ||
operator | ||
); | ||
if (!isOperator) { | ||
await catchUnknownSigner( | ||
execute( | ||
'BatchTransfer', | ||
{from: deployer, log: true}, | ||
'grantRole', | ||
operatorRole, | ||
operator | ||
) | ||
); | ||
log(`[BatchTransfer] Operator role granted to ${operator}`); | ||
} | ||
} | ||
}; | ||
|
||
export default func; | ||
|
||
func.tags = ['BatchTransfer', 'BatchTransfer_setup']; | ||
func.dependencies = ['BatchTransfer_deploy']; |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.