Minimal Anti Collusion Infrastructure (MACI) / Deployment
Class: Deployment
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:9
Notice
Deployment helper class to run sequential deploy using steps and deploy contracts.
Methods
checkResults()
checkResults(
strict
?):Promise
<void
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:68
Print deployment results and check warnings
Parameters
strict?
boolean
fail on warnings is enabled
Returns
Promise
<void
>
Throws
error if strict is enabled and warning is found
createContractFactory()
createContractFactory(
abi
,bytecode
,signer
?):Promise
<ContractFactory
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:156
Creates contract factory from abi and bytecode
Parameters
abi
TAbi
Contract abi
bytecode
string
Contract linked bytecode
signer?
Signer
signer
Returns
Promise
<ContractFactory
>
contract factory with linked libraries
deployContract()
deployContract<
T
,ID
>(params
, ...args
):Promise
<T
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:138
Deploy contract and return it
Type Parameters
• T extends BaseContract
• ID = EContracts
Parameters
params
IDeployContractParams
<ID
>
parameters of deploy contract
args
...unknown
[]
constructor arguments
Returns
Promise
<T
>
deployed contract
deployContractWithLinkedLibraries()
deployContractWithLinkedLibraries<
T
>(params
, ...args
):Promise
<T
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:146
Deploy contract with linked libraries using contract factory
Type Parameters
• T extends BaseContract
Parameters
params
IDeployContractWithLinkedLibrariesParams
parameters of deploy contract with linked libraries
args
...unknown
[]
constructor arguments
Returns
Promise
<T
>
deployed contract
deployTask()
deployTask(
taskName
,stepName
,paramsFn
?):Promise
<ConfigurableTaskDefinition
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:108
Register deploy task by updating step catalog and return task definition
Parameters
taskName
string
unique task name
stepName
string
task description
paramsFn?
(params
) => Promise
<any
>
optional function to override default task arguments
Returns
Promise
<ConfigurableTaskDefinition
>
hardhat task definition
finish()
finish(
startBalance
,success
):Promise
<void
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:75
Finish deployment with console log information
Parameters
startBalance
bigint
start deployer balance
success
boolean
success or not
Returns
Promise
<void
>
getContract()
getContract<
T
>(params
):Promise
<T
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:178
Get contract by name and group key
Type Parameters
• T extends BaseContract
Parameters
params
IGetContractParams
params
Returns
Promise
<T
>
contract wrapper
getDeployConfigField()
getDeployConfigField<
T
,ID
>(id
,field
,mustGet
?):T
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:164
Get deploy config field (see deploy-config.json)
Type Parameters
• T = string
| number
| boolean
• ID extends string
= EContracts
Parameters
id
ID
contract name
field
string
config field key
mustGet?
boolean
Returns
T
config field value or null
getDeployer()
getDeployer():
Promise
<HardhatEthersSigner
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:81
Get deployer (first signer) from hardhat runtime environment
Returns
Promise
<HardhatEthersSigner
>
- signer
runSteps()
runSteps(
steps
,skip
):Promise
<void
>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:61
Run deploy steps
Parameters
steps
IDeployStep
[]
deploy steps
skip
number
skip steps with less or equal index
Returns
Promise
<void
>
setContractNames()
setContractNames(
contractNames
):void
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:93
Set contract names
Parameters
contractNames
Record
<EContracts
, string
>
contract names
Returns
void
setHre()
setHre(
hre
):void
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:87
Set hardhat runtime environment
Parameters
hre
HardhatRuntimeEnvironment
hardhat runtime environment
Returns
void
start()
start(
catolog
,params
):Promise
<IDeployStep
[]>
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:54
Start deploy with console log information
Parameters
catolog
string
params
IDeployParams
deploy params
Returns
Promise
<IDeployStep
[]>
deploy steps for selected catalog
updateDeployConfig()
updateDeployConfig<
T
,ID
>(id
,field
,value
):void
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:171
Update deploy config field (see deploy-config.json)
Type Parameters
• T = string
| number
| boolean
• ID extends string
= EContracts
Parameters
id
ID
contract name
field
string
config field key
value
T
config field value
Returns
void
getInstance()
static
getInstance(__namedParameters
?):Deployment
Defined in: packages/contracts/build/tasks/helpers/Deployment.d.ts:43
Get singleton object
Parameters
__namedParameters?
contractNames
Record
<EContracts
, string
>
hre
HardhatRuntimeEnvironment
Returns
singleton object