From 389c42df66af160faa626d91ac373d415c755f80 Mon Sep 17 00:00:00 2001 From: Wilson Cusack Date: Fri, 1 Sep 2023 23:29:32 -0400 Subject: [PATCH] clean up, all tests passing!! --- src/_test/live.test.ts | 2 +- .../L1/getL2HashesForDepositTx.bench.ts | 5 +- .../public/L1/getL2HashesForDepositTx.test.ts | 5 +- .../public/L1/getOutputForL2Block.test.ts | 2 +- src/actions/public/L1/getOutputForL2Block.ts | 11 +- .../public/L1/simulateDepositERC20.test.ts | 7 +- src/actions/public/L1/simulateDepositERC20.ts | 40 +- src/actions/public/L1/simulateDepositETH.ts | 4 +- src/actions/wallet/L1/bridgeWriteContract.ts | 58 --- .../wallet/L1/writeDepositERC20.test.ts | 2 +- src/chains/mainnet.ts | 2 +- src/decorators/walletL1OpStackActions.ts | 8 - src/types/actions.ts | 16 +- .../getDepositEventsInfoFromTxReceipt.ts | 2 +- ...ctionFromTransactionDepositedEvent.test.ts | 5 +- src/utils/getL2HashFromL1DepositInfo.bench.ts | 5 +- wagmi.config.ts | 364 ------------------ 17 files changed, 66 insertions(+), 472 deletions(-) delete mode 100644 src/actions/wallet/L1/bridgeWriteContract.ts delete mode 100644 wagmi.config.ts diff --git a/src/_test/live.test.ts b/src/_test/live.test.ts index bcdb4b0f..7bdae876 100644 --- a/src/_test/live.test.ts +++ b/src/_test/live.test.ts @@ -21,7 +21,7 @@ test('correctly retrieves L2 hash', async () => { }).extend(walletL1OpStackActions) const depositHash = await walletClient.writeUnsafeDepositTransaction({ - toChainId: baseGoerli.id, + l2ChainId: baseGoerli.id, args: { to: account.address, value: 1n, diff --git a/src/actions/public/L1/getL2HashesForDepositTx.bench.ts b/src/actions/public/L1/getL2HashesForDepositTx.bench.ts index 00cdf939..17808e1a 100644 --- a/src/actions/public/L1/getL2HashesForDepositTx.bench.ts +++ b/src/actions/public/L1/getL2HashesForDepositTx.bench.ts @@ -4,8 +4,9 @@ import { publicClient } from '../../../_test/utils' import { getL2HashesForDepositTx } from './getL2HashesForDepositTx' import { DepositTx } from '@eth-optimism/core-utils' import { ethers } from 'ethers' -import { base } from '@roninjin10/rollup-chains' import { optimismPortalABI } from '@eth-optimism/contracts-ts' +import { base } from 'viem/chains' +import { mainnet } from '../../../chains/mainnet' describe('Computes L2 hash for L1 event', () => { bench('op-viem: `getL2HashesForDepositTx`', async () => { @@ -20,7 +21,7 @@ describe('Computes L2 hash for L1 event', () => { // I am not sure how to produce an event from a transaction receipt. // Happy to update this if there is a better comparison const contract = new ethers.Contract( - base.opContracts.OptimismPortalProxy, + mainnet.contracts.optimismPortal[base.id], optimismPortalABI, ethersProvider, ) diff --git a/src/actions/public/L1/getL2HashesForDepositTx.test.ts b/src/actions/public/L1/getL2HashesForDepositTx.test.ts index ddc1e0a3..8f1a99e6 100644 --- a/src/actions/public/L1/getL2HashesForDepositTx.test.ts +++ b/src/actions/public/L1/getL2HashesForDepositTx.test.ts @@ -2,10 +2,11 @@ import { test, expect } from 'vitest' import { publicClient } from '../../../_test/utils' import { getL2HashesForDepositTx } from './getL2HashesForDepositTx' import { ethers } from 'ethers' -import { optimism } from '@roninjin10/rollup-chains' import { optimismPortalABI } from '@eth-optimism/contracts-ts' import { ethersProvider } from '../../../_test/bench' import { DepositTx } from '@eth-optimism/core-utils' +import { optimism } from 'viem/chains' +import { mainnet } from '../../../chains/mainnet' test('correctly retrieves L2 hash', async () => { const hashes = await getL2HashesForDepositTx(publicClient, { @@ -27,7 +28,7 @@ test('matches @eth-optimism/core-utils', async () => { }) const contract = new ethers.Contract( - optimism.opContracts.OptimismPortalProxy, + mainnet.contracts.optimismPortal[optimism.id], optimismPortalABI, ethersProvider, ) diff --git a/src/actions/public/L1/getOutputForL2Block.test.ts b/src/actions/public/L1/getOutputForL2Block.test.ts index 889a97c5..84cab5ea 100644 --- a/src/actions/public/L1/getOutputForL2Block.test.ts +++ b/src/actions/public/L1/getOutputForL2Block.test.ts @@ -1,7 +1,7 @@ import { test, expect } from 'vitest' import { getOutputForL2Block } from './getOutputForL2Block' import { publicClient } from '../../../_test/utils' -import { base } from 'viem/dist/types/chains' +import { base } from 'viem/chains' test('retrieves correctly', async () => { const result = await getOutputForL2Block(publicClient, { diff --git a/src/actions/public/L1/getOutputForL2Block.ts b/src/actions/public/L1/getOutputForL2Block.ts index 0ff5fe51..ff442ca2 100644 --- a/src/actions/public/L1/getOutputForL2Block.ts +++ b/src/actions/public/L1/getOutputForL2Block.ts @@ -1,9 +1,7 @@ import { Chain, Hex, PublicClient, Transport } from 'viem' import { readContract } from 'viem/actions' import { l2OutputOracleABI } from '@eth-optimism/contracts-ts' -import { - ActionBaseType -} from '../../../types/actions' +import { ActionBaseType } from '../../../types/actions' import { OpStackL1Contracts } from '../../../types/opStackContracts' import { ContractToChainAddressMapping } from '../../wallet/L1/writeUnsafeDepositTransaction' @@ -16,7 +14,12 @@ export type Proposal = { export type GetOutputForL2BlockParameters< TChain extends Chain | undefined = Chain, _contractName extends OpStackL1Contracts = OpStackL1Contracts.optimismL2OutputOracle, -> = {l2BlockNumber: bigint} & ActionBaseType +> = { l2BlockNumber: bigint } & ActionBaseType< + TChain, + TChain, + _contractName, + TChain +> export type GetOutputForL2BlockReturnType = { proposal: Proposal diff --git a/src/actions/public/L1/simulateDepositERC20.test.ts b/src/actions/public/L1/simulateDepositERC20.test.ts index d2b2e2de..2b36deb9 100644 --- a/src/actions/public/L1/simulateDepositERC20.test.ts +++ b/src/actions/public/L1/simulateDepositERC20.test.ts @@ -1,9 +1,10 @@ import { expect, test } from 'vitest' import { publicClient, testClient } from '../../../_test/utils' -import { base } from '@roninjin10/rollup-chains' import { simulateDepositERC20 } from './simulateDepositERC20' import { writeContract, readContract, simulateContract } from 'viem/actions' import { erc20ABI } from 'wagmi' +import { mainnet } from '../../../chains/mainnet' +import { base } from 'viem/chains' const USDCL1 = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' const USDCL2 = '0x2e668bb88287675e34c8df82686dfd0b7f0c0383' @@ -22,7 +23,7 @@ test('default', async () => { address: USDCL1, abi: erc20ABI, functionName: 'approve', - args: [base.opContracts.L1StandardBridgeProxy, 10000n], + args: [mainnet.contracts.optimismL1StandardBridge[base.id], 10000n], account: zenaddress, }) const balanceBefore = await readContract(testClient, { @@ -40,7 +41,7 @@ test('default', async () => { gasLimit: 100000n, data: '0x', }, - toChain: base, + l2ChainId: base.id, account: zenaddress, }) diff --git a/src/actions/public/L1/simulateDepositERC20.ts b/src/actions/public/L1/simulateDepositERC20.ts index 322897ce..3c4763d6 100644 --- a/src/actions/public/L1/simulateDepositERC20.ts +++ b/src/actions/public/L1/simulateDepositERC20.ts @@ -6,25 +6,29 @@ import { SimulateContractReturnType, } from 'viem' import { l1StandardBridgeABI } from '@eth-optimism/contracts-ts' -import { OpChainL2 } from '@roninjin10/rollup-chains' import { simulateContract } from 'viem/actions' -import { DepositERC20Parameters } from '../../types/depositERC20Parameters' +import { DepositERC20Parameters } from '../../../types/depositERC20Parameters' +import { ResolveChain, SimulateActionBaseType } from '../../../types/actions' +import { OpStackL1Contracts } from '../../../types/opStackContracts' +import { ContractToChainAddressMapping } from '../../wallet/L1/writeUnsafeDepositTransaction' export type SimulateDepositERC20Parameters< TChain extends Chain | undefined = Chain, TChainOverride extends Chain | undefined = Chain | undefined, -> = Omit< - SimulateContractParameters< - typeof l1StandardBridgeABI, - 'depositERC20', + _contractName extends OpStackL1Contracts = OpStackL1Contracts.optimismL1StandardBridge, + _functionName extends string = 'depositERC20', + _resolvedChain extends Chain | undefined = ResolveChain< TChain, TChainOverride >, - 'abi' | 'functionName' | 'args' | 'address' -> & { - toChain: OpChainL2 - args: DepositERC20Parameters -} +> = { args: DepositERC20Parameters } & SimulateActionBaseType< + TChain, + typeof l1StandardBridgeABI, + TChainOverride, + _contractName, + _functionName, + _resolvedChain +> export type SimulateDepositERC20ReturnType< TChain extends Chain | undefined = Chain, @@ -43,12 +47,22 @@ export async function simulateDepositERC20< client: PublicClient, { args: { l1Token, l2Token, amount, gasLimit, data }, - toChain, + l2ChainId, + optimismL1StandardBridgeAddress, + chain = client.chain, ...rest }: SimulateDepositERC20Parameters, ): Promise> { + const contracts = chain?.contracts as + | ContractToChainAddressMapping + | undefined + const bridge = + optimismL1StandardBridgeAddress || + (contracts && typeof l2ChainId == 'number' + ? contracts[OpStackL1Contracts.optimismL1StandardBridge][l2ChainId] + : undefined) return simulateContract(client, { - address: toChain.opContracts.L1StandardBridgeProxy, + address: bridge, abi: l1StandardBridgeABI, functionName: 'depositERC20', args: [l1Token, l2Token, amount, gasLimit, data], diff --git a/src/actions/public/L1/simulateDepositETH.ts b/src/actions/public/L1/simulateDepositETH.ts index 5b8ef762..f51bc338 100644 --- a/src/actions/public/L1/simulateDepositETH.ts +++ b/src/actions/public/L1/simulateDepositETH.ts @@ -20,8 +20,8 @@ export type SimulateDepositETHParameters< _resolvedChain extends Chain | undefined = ResolveChain< TChain, TChainOverride - > -> = & { + >, +> = { args: DepositETHParameters } & SimulateActionBaseType< TChain, diff --git a/src/actions/wallet/L1/bridgeWriteContract.ts b/src/actions/wallet/L1/bridgeWriteContract.ts deleted file mode 100644 index e9c378b1..00000000 --- a/src/actions/wallet/L1/bridgeWriteContract.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { - Chain, - Transport, - encodeFunctionData, - WriteContractParameters, - Account, - Abi, - EncodeFunctionDataParameters, - WalletClient, -} from 'viem' -import { writeContract } from 'viem/actions' -import { l1CrossDomainMessengerABI } from '@eth-optimism/contracts-ts' -import { OpChainL2, OpChainL1 } from '@roninjin10/rollup-chains' - -export async function bridgeWriteContract< - TAbi extends Abi | readonly unknown[] = Abi, - TFunctionName extends string = string, - TChainL2 extends OpChainL2 = OpChainL2, - TChainL1 extends Chain & { id: TChainL2['l1']['id'] } = OpChainL1, - TAccount extends Account | undefined = Account | undefined, - TChainOverride extends Chain | undefined = Chain | undefined, ->( - client: WalletClient, - // TODO make this take an l2Chain that is decorated with l2 info such as the l1 contract addreses - { - toChain, - args, - abi, - address, - functionName, - ...restArgs - }: { toChain: TChainL2 } & WriteContractParameters< - TAbi, - TFunctionName, - TChainL1, - TAccount, - TChainOverride - >, -): Promise { - const minGasLimit = 200_000 - const message = encodeFunctionData({ - abi, - functionName, - args, - } as unknown as EncodeFunctionDataParameters) - const l1TxHash = writeContract(client, { - abi: l1CrossDomainMessengerABI, - // TODO currently hardcoded for OP should get this from the l2 chain object - address: toChain?.opContracts.L1CrossDomainMessengerProxy, - functionName: 'sendMessage' as any, - args: [address, message, minGasLimit], - ...restArgs, - // TODO better types - } as any) - // compose with getL2Hash method to get l2 hash I think is what we want here - // We could consider baking that into this method - return l1TxHash -} diff --git a/src/actions/wallet/L1/writeDepositERC20.test.ts b/src/actions/wallet/L1/writeDepositERC20.test.ts index 97450965..ed5a54e2 100644 --- a/src/actions/wallet/L1/writeDepositERC20.test.ts +++ b/src/actions/wallet/L1/writeDepositERC20.test.ts @@ -4,7 +4,7 @@ import { writeDepositERC20 } from './writeDepositERC20' import { mine, writeContract } from 'viem/actions' import { erc20ABI } from 'wagmi' import { mainnet } from '../../../chains/mainnet' -import { base } from 'viem/dist/types/chains' +import { base } from 'viem/chains' const USDCL1 = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' const USDCL2 = '0x2e668bb88287675e34c8df82686dfd0b7f0c0383' diff --git a/src/chains/mainnet.ts b/src/chains/mainnet.ts index 1556f15a..570d868c 100644 --- a/src/chains/mainnet.ts +++ b/src/chains/mainnet.ts @@ -26,7 +26,7 @@ export const mainnet = { optimismPortal: { 8453: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e', 7777777: '0x1a0ad011913A150f69f6A19DF447A0CfD9551054', - 10: '0xDb9F51790365e7dc196e7D072728df39Be958ACe', + 10: '0xbEb5Fc579115071764c7423A4f12eDde41f106Ed', }, optimismSystemConfig: { 8453: '0x73a79Fab69143498Ed3712e519A88a918e1f4072', diff --git a/src/decorators/walletL1OpStackActions.ts b/src/decorators/walletL1OpStackActions.ts index 98df9dca..b9dc9687 100644 --- a/src/decorators/walletL1OpStackActions.ts +++ b/src/decorators/walletL1OpStackActions.ts @@ -1,6 +1,5 @@ import { Account, Chain, Transport, WriteContractReturnType } from 'viem' import { WalletClient } from 'viem' -import { bridgeWriteContract } from '../actions/wallet/L1/bridgeWriteContract' import { writeUnsafeDepositTransaction, WriteUnsafeDepositTransactionParameters, @@ -18,10 +17,6 @@ export type WalletL1OpStackActions< TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, > = { - bridgeWriteContract: ( - // TODO name these params - args: Parameters[1], - ) => Promise writeDepositETH: < TChainOverride extends Chain | undefined = Chain | undefined, >( @@ -51,9 +46,6 @@ export function walletL1OpStackActions< client: WalletClient, ): WalletL1OpStackActions { return { - // TODO do better than as any - bridgeWriteContract: (args) => - bridgeWriteContract(client as any, args as any), writeUnsafeDepositTransaction: (args) => writeUnsafeDepositTransaction(client, args), writeDepositETH: (args) => writeDepositETH(client, args), diff --git a/src/types/actions.ts b/src/types/actions.ts index 71750d8e..61afd923 100644 --- a/src/types/actions.ts +++ b/src/types/actions.ts @@ -1,4 +1,11 @@ -import { Abi, Account, Address, Chain, SimulateContractParameters, WriteContractParameters } from 'viem' +import { + Abi, + Account, + Address, + Chain, + SimulateContractParameters, + WriteContractParameters, +} from 'viem' import { OpStackL1Contracts } from './opStackContracts' export type ExtractValidChainIdFromContract< @@ -100,11 +107,6 @@ export type SimulateActionBaseType< >, > = ActionBaseType & Omit< - SimulateContractParameters< - TAbi, - _functionName, - TChain, - TChainOverride - >, + SimulateContractParameters, 'abi' | 'functionName' | 'args' | 'address' | 'chain' > diff --git a/src/utils/getDepositEventsInfoFromTxReceipt.ts b/src/utils/getDepositEventsInfoFromTxReceipt.ts index d1c5ff1f..464090f8 100644 --- a/src/utils/getDepositEventsInfoFromTxReceipt.ts +++ b/src/utils/getDepositEventsInfoFromTxReceipt.ts @@ -1,6 +1,6 @@ import { TransactionReceipt, decodeEventLog } from 'viem' -import { optimismPortalABI } from '../generated/contracts' import { TransactionDepositedEvent } from '../types/depositTransaction' +import { optimismPortalABI } from '@eth-optimism/contracts-ts' type GetDepositEventInfoFromTxReceiptParams = { receipt: TransactionReceipt diff --git a/src/utils/getDepositTransactionFromTransactionDepositedEvent.test.ts b/src/utils/getDepositTransactionFromTransactionDepositedEvent.test.ts index cd12b1cd..39854483 100644 --- a/src/utils/getDepositTransactionFromTransactionDepositedEvent.test.ts +++ b/src/utils/getDepositTransactionFromTransactionDepositedEvent.test.ts @@ -1,5 +1,4 @@ import { optimismPortalABI } from '@eth-optimism/contracts-ts' -import { optimism } from '@roninjin10/rollup-chains' import { BigNumber, ethers } from 'ethers' import { expect, test } from 'vitest' import { ethersProvider } from '../_test/bench' @@ -10,13 +9,15 @@ import { getDepositEventsInfoFromTxReceipt } from './getDepositEventsInfoFromTxR import { getDepositTransactionFromTransactionDepositedEvent } from './getDepositTransactionFromTransactionDepositedEvent' import { getSourceHash } from './getSourceHash' import { SourceHashDomain } from '../types/depositTransaction' +import { mainnet } from '../chains/mainnet' +import { optimism } from 'viem/chains' // Simply testing against another implementation is not the best practice // but I added these after debugging a difference. They will be useful to have // if debugging again in the future. test('derives same values as op-ethereum/core-utils', async () => { const contract = new ethers.Contract( - optimism.opContracts.OptimismPortalProxy, + mainnet.contracts.optimismPortal[optimism.id], optimismPortalABI, ethersProvider, ) diff --git a/src/utils/getL2HashFromL1DepositInfo.bench.ts b/src/utils/getL2HashFromL1DepositInfo.bench.ts index 9f12a045..98cc325f 100644 --- a/src/utils/getL2HashFromL1DepositInfo.bench.ts +++ b/src/utils/getL2HashFromL1DepositInfo.bench.ts @@ -3,11 +3,12 @@ import { ethersProvider } from '../_test/bench' import { publicClient } from '../_test/utils' import { DepositTx } from '@eth-optimism/core-utils' import { ethers } from 'ethers' -import { base } from '@roninjin10/rollup-chains' import { optimismPortalABI } from '@eth-optimism/contracts-ts' import { getTransactionReceipt } from 'viem/actions' import { getDepositEventsInfoFromTxReceipt } from './getDepositEventsInfoFromTxReceipt' import { getL2HashFromL1DepositInfo } from './getL2HashFromL1DepositInfo' +import { base } from 'viem/chains' +import { mainnet } from '../chains/mainnet' describe('Obtain L2 hash from already fetched event', async () => { const receipt = await getTransactionReceipt(publicClient, { @@ -23,7 +24,7 @@ describe('Obtain L2 hash from already fetched event', async () => { }) const contract = new ethers.Contract( - base.opContracts.OptimismPortalProxy, + mainnet.contracts.optimismPortal[base.id], optimismPortalABI, ethersProvider, ) diff --git a/wagmi.config.ts b/wagmi.config.ts deleted file mode 100644 index 0dfa9ccb..00000000 --- a/wagmi.config.ts +++ /dev/null @@ -1,364 +0,0 @@ -import { defineConfig } from '@wagmi/cli' -import { react } from '@wagmi/cli/plugins' - -export default defineConfig({ - out: 'src/generated/contracts.ts', - contracts: [ - { - name: 'OptimismPortal', - abi: [ - { - inputs: [ - { - internalType: 'contract L2OutputOracle', - name: '_l2Oracle', - type: 'address', - }, - { internalType: 'address', name: '_guardian', type: 'address' }, - { internalType: 'bool', name: '_paused', type: 'bool' }, - { - internalType: 'contract SystemConfig', - name: '_config', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint8', - name: 'version', - type: 'uint8', - }, - ], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'Paused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'version', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes', - name: 'opaqueData', - type: 'bytes', - }, - ], - name: 'TransactionDeposited', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'Unpaused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'withdrawalHash', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bool', - name: 'success', - type: 'bool', - }, - ], - name: 'WithdrawalFinalized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'withdrawalHash', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - ], - name: 'WithdrawalProven', - type: 'event', - }, - { - inputs: [], - name: 'GUARDIAN', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'L2_ORACLE', - outputs: [ - { - internalType: 'contract L2OutputOracle', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'SYSTEM_CONFIG', - outputs: [ - { - internalType: 'contract SystemConfig', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'address', name: '_to', type: 'address' }, - { internalType: 'uint256', name: '_value', type: 'uint256' }, - { internalType: 'uint64', name: '_gasLimit', type: 'uint64' }, - { internalType: 'bool', name: '_isCreation', type: 'bool' }, - { internalType: 'bytes', name: '_data', type: 'bytes' }, - ], - name: 'depositTransaction', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'donateETH', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'uint256', name: 'nonce', type: 'uint256' }, - { internalType: 'address', name: 'sender', type: 'address' }, - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'uint256', name: 'gasLimit', type: 'uint256' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - ], - internalType: 'struct Types.WithdrawalTransaction', - name: '_tx', - type: 'tuple', - }, - ], - name: 'finalizeWithdrawalTransaction', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - name: 'finalizedWithdrawals', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{ internalType: 'bool', name: '_paused', type: 'bool' }], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_l2OutputIndex', - type: 'uint256', - }, - ], - name: 'isOutputFinalized', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'l2Sender', - outputs: [{ internalType: 'address', name: '', type: 'address' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { internalType: 'uint64', name: '_byteCount', type: 'uint64' }, - ], - name: 'minimumGasLimit', - outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'params', - outputs: [ - { internalType: 'uint128', name: 'prevBaseFee', type: 'uint128' }, - { internalType: 'uint64', name: 'prevBoughtGas', type: 'uint64' }, - { internalType: 'uint64', name: 'prevBlockNum', type: 'uint64' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'paused', - outputs: [{ internalType: 'bool', name: '', type: 'bool' }], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - components: [ - { internalType: 'uint256', name: 'nonce', type: 'uint256' }, - { internalType: 'address', name: 'sender', type: 'address' }, - { internalType: 'address', name: 'target', type: 'address' }, - { internalType: 'uint256', name: 'value', type: 'uint256' }, - { internalType: 'uint256', name: 'gasLimit', type: 'uint256' }, - { internalType: 'bytes', name: 'data', type: 'bytes' }, - ], - internalType: 'struct Types.WithdrawalTransaction', - name: '_tx', - type: 'tuple', - }, - { - internalType: 'uint256', - name: '_l2OutputIndex', - type: 'uint256', - }, - { - components: [ - { internalType: 'bytes32', name: 'version', type: 'bytes32' }, - { internalType: 'bytes32', name: 'stateRoot', type: 'bytes32' }, - { - internalType: 'bytes32', - name: 'messagePasserStorageRoot', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'latestBlockhash', - type: 'bytes32', - }, - ], - internalType: 'struct Types.OutputRootProof', - name: '_outputRootProof', - type: 'tuple', - }, - { - internalType: 'bytes[]', - name: '_withdrawalProof', - type: 'bytes[]', - }, - ], - name: 'proveWithdrawalTransaction', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], - name: 'provenWithdrawals', - outputs: [ - { internalType: 'bytes32', name: 'outputRoot', type: 'bytes32' }, - { internalType: 'uint128', name: 'timestamp', type: 'uint128' }, - { internalType: 'uint128', name: 'l2OutputIndex', type: 'uint128' }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'unpause', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'version', - outputs: [{ internalType: 'string', name: '', type: 'string' }], - stateMutability: 'view', - type: 'function', - }, - { stateMutability: 'payable', type: 'receive' }, - ], - }, - ], - plugins: [react()], -})