Minimal Anti Collusion Infrastructure (MACI) / Deployment
Class: Deployment
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:8
Notice
Deployment helper class to run sequential deploy using steps and deploy contracts.
Methods
checkResults()
checkResults(
strict?):Promise<void>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:67
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<any[],BaseContract>>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:162
Creates contract factory from abi and bytecode
Parameters
abi
TAbi
Contract abi
bytecode
string
Contract linked bytecode
signer?
Signer
signer
Returns
Promise<ContractFactory<any[], BaseContract>>
contract factory with linked libraries
deployContract()
deployContract<
T,ID>(params, ...args):Promise<T>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:137
Deploy contract and return it
Type Parameters
T
T extends BaseContract
ID
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: contracts/build/tasks/helpers/Deployment.d.ts:152
Deploy contract with linked libraries using contract factory
Type Parameters
T
T extends BaseContract
Parameters
params
IDeployContractWithLinkedLibrariesParams
parameters of deploy contract with linked libraries
args
...unknown[]
constructor arguments
Returns
Promise<T>
deployed contract
deployProxyClone()
deployProxyClone<
C,Args>(args):Promise<C>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:144
Deploy proxy clone instance.
Type Parameters
C
C extends BaseContract
Args
Args extends unknown[] = unknown[]
Parameters
args
IDeployCloneArgs<Args>
deploy proxy clone arguments
Returns
Promise<C>
clone contract
deployTask()
deployTask(
taskName,stepName,paramsFn?):Promise<ConfigurableTaskDefinition>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:107
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,isSuccess):Promise<void>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:74
Finish deployment with console log information
Parameters
startBalance
bigint
start deployer balance
isSuccess
boolean
success or not
Returns
Promise<void>
getContract()
getContract<
T>(params):Promise<T>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:184
Get contract by name and group key
Type Parameters
T
T extends BaseContract
Parameters
params
IGetContractParams
params
Returns
Promise<T>
contract wrapper
getDeployConfigField()
getDeployConfigField<
T,ID>(id,field,mustGet?):T
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:170
Get deploy config field (see deploy-config.json)
Type Parameters
T
T = string | number | boolean
ID
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<Signer>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:80
Get deployer (first signer) from hardhat runtime environment
Returns
Promise<Signer>
- signer
runSteps()
runSteps(
steps,skip):Promise<void>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:60
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: contracts/build/tasks/helpers/Deployment.d.ts:92
Set contract names
Parameters
contractNames
Record<EContracts, string>
contract names
Returns
void
setHre()
setHre(
hre):void
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:86
Set hardhat runtime environment
Parameters
hre
HardhatRuntimeEnvironment
hardhat runtime environment
Returns
void
start()
start(
catolog,catalog):Promise<IDeployStep[]>
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:53
Start deploy with console log information
Parameters
catolog
string
catalog
deploy steps catalog
Returns
Promise<IDeployStep[]>
deploy steps for selected catalog
updateDeployConfig()
updateDeployConfig<
T,ID>(id,field,value):void
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:177
Update deploy config field (see deploy-config.json)
Type Parameters
T
T = string | number | boolean
ID
ID extends string = EContracts
Parameters
id
ID
contract name
field
string
config field key
value
T
config field value
Returns
void
getInstance()
staticgetInstance(__namedParameters?):Deployment
Defined in: contracts/build/tasks/helpers/Deployment.d.ts:42
Get singleton object
Parameters
__namedParameters?
contractNames?
Record<EContracts, string>
hre?
HardhatRuntimeEnvironment
Returns
Deployment
singleton object