(account: WalletClient, client: PublicClient, value: bigint, selfDestructTarget?: Address)
| 41 | } |
| 42 | |
| 43 | static async deploy(account: WalletClient, client: PublicClient, value: bigint, selfDestructTarget?: Address) { |
| 44 | const artifact = await hre.artifacts.readArtifact('NativeTransferHelper') |
| 45 | const deployedTxHash = await account.deployContract({ |
| 46 | abi: artifact.abi, |
| 47 | bytecode: artifact.bytecode, |
| 48 | args: [selfDestructTarget ?? zeroAddress, selfDestructTarget !== undefined] as const, |
| 49 | value, |
| 50 | }) |
| 51 | const receipt: TransactionReceipt = await client.waitForTransactionReceipt({ hash: deployedTxHash }) |
| 52 | if (!receipt.contractAddress) { |
| 53 | throw new Error('Deployment failed, missing contract address') |
| 54 | } |
| 55 | return new NativeTransferHelper(receipt.contractAddress, artifact.abi, artifact.bytecode as Hex, client, receipt) |
| 56 | } |
| 57 | |
| 58 | async callCanReceive(account: WalletClient, value: bigint): Promise<TransactionReceipt> { |
| 59 | const txHash = await account.writeContract({ |
no outgoing calls
no test coverage detected