Skip to content

Commit

Permalink
refactor: migrate Create2Factory to etehrs v6
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Feb 22, 2024
1 parent 77bb2c5 commit fa680cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/LSP17Extensions/helpers/Create2Factory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// from: https://github.com/Arachnid/deterministic-deployment-proxy
import { BigNumberish, JsonRpcProvider, Signer, ethers, toBeHex } from 'ethers';
import { getBytes, concat, zeroPadValue, keccak256 } from 'ethers';
import { Provider } from '@ethersproject/providers';

import { TransactionRequest } from '@ethersproject/abstract-provider';

export class Create2Factory {
Expand All @@ -19,7 +19,7 @@ export class Create2Factory {
).toString();

constructor(
readonly provider: Provider,
readonly provider: JsonRpcProvider,
readonly signer = (provider as unknown as JsonRpcProvider).getSigner().then(),
) {}

Expand Down Expand Up @@ -109,7 +109,11 @@ export class Create2Factory {
to: Create2Factory.factoryDeployer,
value: BigInt(Create2Factory.factoryDeploymentFee),
});
await this.provider.sendTransaction(Create2Factory.factoryTx);
await this.provider.send('eth_sendTransaction', [
{
data: Create2Factory.factoryTx,
},
]);
if (!(await this._isFactoryDeployed())) {
throw new Error('fatal: failed to deploy deterministic deployer');
}
Expand Down

0 comments on commit fa680cc

Please sign in to comment.