MCPcopy
hub / github.com/eth-infinitism/account-abstraction / deployFactory

Method deployFactory

src/Create2Factory.ts:97–114  ·  view source on GitHub ↗
(signer?: Signer)

Source from the content-addressed store, hash-verified

95
96 // deploy the factory, if not already deployed.
97 async deployFactory (signer?: Signer): Promise<void> {
98 if (await this._isFactoryDeployed()) {
99 return
100 }
101
102 await (signer ?? this.signer).sendTransaction({
103 to: Create2Factory.factoryDeployer,
104 value: BigNumber.from(Create2Factory.factoryDeploymentFee)
105 })
106 // (with latest geth, can't tx.wait on the very first tx: reverts with "transaction indexing is in progress")
107 await new Promise(resolve => setTimeout(resolve, 100))
108
109 await this.provider.sendTransaction(Create2Factory.factoryTx).then(async tx => tx.wait())
110
111 if (!await this._isFactoryDeployed()) {
112 throw new Error('fatal: failed to deploy deterministic deployer')
113 }
114 }
115
116 async _isFactoryDeployed (): Promise<boolean> {
117 if (!this.factoryDeployed) {

Callers 2

deployMethod · 0.95

Calls 2

_isFactoryDeployedMethod · 0.95
sendTransactionMethod · 0.80

Tested by

no test coverage detected