From efab82b3e725853565d1f7677c47a05e748a17c2 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 11:46:26 -0500 Subject: [PATCH 01/11] abigen --- .gitmodules | 3 ++ packages/viem/abigen.json | 9 ---- packages/viem/scripts/abigen.ts | 63 ++++++++++-------------- packages/viem/scripts/templates/abis.eta | 2 +- 4 files changed, 31 insertions(+), 46 deletions(-) delete mode 100644 packages/viem/abigen.json diff --git a/.gitmodules b/.gitmodules index 1f40ba35..493cc91b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/superchain-registry"] path = lib/superchain-registry url = https://github.com/ethereum-optimism/superchain-registry +[submodule "lib/optimism"] + path = lib/optimism + url = https://github.com/ethereum-optimism/optimism diff --git a/packages/viem/abigen.json b/packages/viem/abigen.json deleted file mode 100644 index 50ea5475..00000000 --- a/packages/viem/abigen.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "contracts": [ - "CrossL2Inbox", - "L2ToL2CrossDomainMessenger", - "SuperchainWETH", - "SuperchainERC20", - "SuperchainTokenBridge" - ] -} \ No newline at end of file diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index 08c0e5e0..a0e44c5e 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -1,52 +1,43 @@ import { Eta } from 'eta' import fs from 'fs' +import path from 'path' -import abigen from '../abigen.json' +// Hardcoded. Can take a more elaborate approach if needed. +const OPTIMISM_PATH = path.join('..', '..', 'lib', 'optimism') +const ABI_SNAPSHOTS_PATH = path.join(OPTIMISM_PATH, 'packages', 'contracts-bedrock', 'snapshots', 'abi') +const CONTRACTS = [ + 'CrossL2Inbox', + 'L2ToL2CrossDomainMessenger', + 'SuperchainWETH', + 'SuperchainERC20', + 'SuperchainTokenBridge', +] -type JSONValue = - | string - | number - | boolean - | { [x: string]: JSONValue } - | JSONValue[] - -type AutogenContract = { - name: string - abi: { [x: string]: JSONValue } -} - -const ARTIFACT_DIRECTORY = '../../lib/forge-artifacts' -const SRC_DIR = './src' - -const eta = new Eta({ views: './scripts/templates', debug: true }) - -async function generateAbis() { - const contracts = [] as AutogenContract[] - for (const name of abigen.contracts) { - const artifact = JSON.parse( - fs.readFileSync(`${ARTIFACT_DIRECTORY}/${name}.sol/${name}.json`), - ) - contracts.push({ name, abi: artifact.abi }) - } - - const generateAbiFileContents = eta.render('abis', { - contracts, - camelCase, - prettyPrintJSON: (json: JSONValue) => JSON.stringify(json, null, 2), - }) - - fs.writeFileSync(`${SRC_DIR}/abis.ts`, generateAbiFileContents) -} +/** Utility Functions */ function camelCase(str: string): string { const [start, ...rest] = str return start.toLowerCase() + rest.join('') } +/** ABI Generation */ + async function main() { - await generateAbis() + console.log('Running ABI generation...') + const eta = new Eta({ views: './scripts/templates', debug: true, autoTrim: [false, false] }) + + const contracts = CONTRACTS.map((contract) => { + const abiPath = path.join(ABI_SNAPSHOTS_PATH, `${contract}.json`) + const abi = JSON.parse(fs.readFileSync(abiPath, 'utf8')) + return { name: contract, exportName: camelCase(contract), abi } + }) + + console.log(contracts) + const fileContents = eta.render('abis', { contracts }) + fs.writeFileSync(`src/abis.ts`, fileContents) } +;(async () => { ;(async () => { try { await main() diff --git a/packages/viem/scripts/templates/abis.eta b/packages/viem/scripts/templates/abis.eta index 643f3aa7..4ba8336e 100644 --- a/packages/viem/scripts/templates/abis.eta +++ b/packages/viem/scripts/templates/abis.eta @@ -5,6 +5,6 @@ * ABI for the OP Stack contract `<%= contract.name %>` * @category ABI */ -export const <%= it.camelCase(contract.name) %>ABI = <%~ it.prettyPrintJSON(contract.abi) %> as const +export const <%= it.camelCase(contract.name) %>Abi = <%~ it.prettyPrintJSON(contract.abi) %> as const <% }) %> From 161b1a75abf6595701a9cf52db937646b21c3861 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 12:01:22 -0500 Subject: [PATCH 02/11] abigen --- packages/viem/scripts/abigen.ts | 13 +- packages/viem/scripts/templates/abis.eta | 3 +- packages/viem/src/abis.ts | 2511 +++++++++++----------- scripts/pull-contract-artifacts.sh | 34 - 4 files changed, 1310 insertions(+), 1251 deletions(-) delete mode 100755 scripts/pull-contract-artifacts.sh diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index a0e44c5e..0ff52a3b 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -8,8 +8,8 @@ const ABI_SNAPSHOTS_PATH = path.join(OPTIMISM_PATH, 'packages', 'contracts-bedro const CONTRACTS = [ 'CrossL2Inbox', 'L2ToL2CrossDomainMessenger', + 'OptimismSuperchainERC20', 'SuperchainWETH', - 'SuperchainERC20', 'SuperchainTokenBridge', ] @@ -23,21 +23,24 @@ function camelCase(str: string): string { /** ABI Generation */ async function main() { - console.log('Running ABI generation...') + console.log('Running Abi generation...') const eta = new Eta({ views: './scripts/templates', debug: true, autoTrim: [false, false] }) const contracts = CONTRACTS.map((contract) => { + console.log(`Generating Abi for ${contract}`) const abiPath = path.join(ABI_SNAPSHOTS_PATH, `${contract}.json`) const abi = JSON.parse(fs.readFileSync(abiPath, 'utf8')) return { name: contract, exportName: camelCase(contract), abi } }) - console.log(contracts) - const fileContents = eta.render('abis', { contracts }) + const fileContents = eta.render('abis', { + contracts, + prettyPrintJSON: (json: any) => JSON.stringify(json, null, 2), + }) + fs.writeFileSync(`src/abis.ts`, fileContents) } -;(async () => { ;(async () => { try { await main() diff --git a/packages/viem/scripts/templates/abis.eta b/packages/viem/scripts/templates/abis.eta index 4ba8336e..9158b111 100644 --- a/packages/viem/scripts/templates/abis.eta +++ b/packages/viem/scripts/templates/abis.eta @@ -5,6 +5,5 @@ * ABI for the OP Stack contract `<%= contract.name %>` * @category ABI */ -export const <%= it.camelCase(contract.name) %>Abi = <%~ it.prettyPrintJSON(contract.abi) %> as const - +export const <%= contract.exportName %>Abi = <%~ it.prettyPrintJSON(contract.abi) %> as const <% }) %> diff --git a/packages/viem/src/abis.ts b/packages/viem/src/abis.ts index bdb07bb1..f356f8a4 100644 --- a/packages/viem/src/abis.ts +++ b/packages/viem/src/abis.ts @@ -1,1772 +1,1863 @@ // DO NOT MODIFY THIS FILE IS AUTOGENERATED + /** * ABI for the OP Stack contract `CrossL2Inbox` * @category ABI */ -export const crossL2InboxABI = [ +export const crossL2InboxAbi = [ { - type: 'function', - name: 'blockNumber', - inputs: [], - outputs: [ + "inputs": [], + "name": "blockNumber", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'chainId', - inputs: [], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'executeMessage', - inputs: [ - { - name: '_id', - type: 'tuple', - internalType: 'struct Identifier', - components: [ - { - name: 'origin', - type: 'address', - internalType: 'address', - }, - { - name: 'blockNumber', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'logIndex', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'timestamp', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'chainId', - type: 'uint256', - internalType: 'uint256', - }, - ], - }, - { - name: '_target', - type: 'address', - internalType: 'address', - }, + "inputs": [], + "name": "chainId", + "outputs": [ { - name: '_message', - type: 'bytes', - internalType: 'bytes', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'payable', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'interopStart', - inputs: [], - outputs: [ + "inputs": [], + "name": "interopStart", + "outputs": [ { - name: 'interopStart_', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "interopStart_", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'logIndex', - inputs: [], - outputs: [ + "inputs": [], + "name": "logIndex", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'origin', - inputs: [], - outputs: [ + "inputs": [], + "name": "origin", + "outputs": [ { - name: '', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "", + "type": "address" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'setInteropStart', - inputs: [], - outputs: [], - stateMutability: 'nonpayable', + "inputs": [], + "name": "setInteropStart", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'timestamp', - inputs: [], - outputs: [ + "inputs": [], + "name": "timestamp", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'validateMessage', - inputs: [ + "inputs": [ { - name: '_id', - type: 'tuple', - internalType: 'struct Identifier', - components: [ + "components": [ { - name: 'origin', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "origin", + "type": "address" }, { - name: 'blockNumber', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" }, { - name: 'logIndex', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "logIndex", + "type": "uint256" }, { - name: 'timestamp', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" }, { - name: 'chainId', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } ], + "internalType": "struct Identifier", + "name": "_id", + "type": "tuple" }, { - name: '_msgHash', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "bytes32", + "name": "_msgHash", + "type": "bytes32" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "validateMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'version', - inputs: [], - outputs: [ + "inputs": [], + "name": "version", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'event', - name: 'ExecutingMessage', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'msgHash', - type: 'bytes32', - indexed: true, - internalType: 'bytes32', + "indexed": true, + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" }, { - name: 'id', - type: 'tuple', - indexed: false, - internalType: 'struct Identifier', - components: [ + "components": [ { - name: 'origin', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "origin", + "type": "address" }, { - name: 'blockNumber', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" }, { - name: 'logIndex', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "logIndex", + "type": "uint256" }, { - name: 'timestamp', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" }, { - name: 'chainId', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } ], - }, + "indexed": false, + "internalType": "struct Identifier", + "name": "id", + "type": "tuple" + } ], - anonymous: false, - }, - { - type: 'error', - name: 'InteropStartAlreadySet', - inputs: [], - }, - { - type: 'error', - name: 'InvalidChainId', - inputs: [], - }, - { - type: 'error', - name: 'InvalidTimestamp', - inputs: [], + "name": "ExecutingMessage", + "type": "event" }, { - type: 'error', - name: 'NoExecutingDeposits', - inputs: [], + "inputs": [], + "name": "InteropStartAlreadySet", + "type": "error" }, { - type: 'error', - name: 'NotDepositor', - inputs: [], + "inputs": [], + "name": "NoExecutingDeposits", + "type": "error" }, { - type: 'error', - name: 'NotEntered', - inputs: [], + "inputs": [], + "name": "NotDepositor", + "type": "error" }, { - type: 'error', - name: 'ReentrantCall', - inputs: [], + "inputs": [], + "name": "NotEntered", + "type": "error" }, { - type: 'error', - name: 'TargetCallFailed', - inputs: [], - }, + "inputs": [], + "name": "ReentrantCall", + "type": "error" + } ] as const /** * ABI for the OP Stack contract `L2ToL2CrossDomainMessenger` * @category ABI */ -export const l2ToL2CrossDomainMessengerABI = [ +export const l2ToL2CrossDomainMessengerAbi = [ { - type: 'function', - name: 'crossDomainMessageContext', - inputs: [], - outputs: [ + "inputs": [], + "name": "crossDomainMessageContext", + "outputs": [ { - name: 'sender_', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "sender_", + "type": "address" }, { - name: 'source_', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "source_", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'crossDomainMessageSender', - inputs: [], - outputs: [ + "inputs": [], + "name": "crossDomainMessageSender", + "outputs": [ { - name: 'sender_', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "sender_", + "type": "address" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'crossDomainMessageSource', - inputs: [], - outputs: [ + "inputs": [], + "name": "crossDomainMessageSource", + "outputs": [ { - name: 'source_', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "source_", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'messageNonce', - inputs: [], - outputs: [ + "inputs": [], + "name": "messageNonce", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'messageVersion', - inputs: [], - outputs: [ + "inputs": [], + "name": "messageVersion", + "outputs": [ { - name: '', - type: 'uint16', - internalType: 'uint16', - }, + "internalType": "uint16", + "name": "", + "type": "uint16" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'relayMessage', - inputs: [ + "inputs": [ { - name: '_id', - type: 'tuple', - internalType: 'struct Identifier', - components: [ + "components": [ { - name: 'origin', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "origin", + "type": "address" }, { - name: 'blockNumber', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" }, { - name: 'logIndex', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "logIndex", + "type": "uint256" }, { - name: 'timestamp', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" }, { - name: 'chainId', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } ], + "internalType": "struct Identifier", + "name": "_id", + "type": "tuple" }, { - name: '_sentMessage', - type: 'bytes', - internalType: 'bytes', - }, + "internalType": "bytes", + "name": "_sentMessage", + "type": "bytes" + } ], - outputs: [], - stateMutability: 'payable', + "name": "relayMessage", + "outputs": [ + { + "internalType": "bytes", + "name": "returnData_", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" }, { - type: 'function', - name: 'sendMessage', - inputs: [ + "inputs": [ { - name: '_destination', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "_destination", + "type": "uint256" }, { - name: '_target', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_target", + "type": "address" }, { - name: '_message', - type: 'bytes', - internalType: 'bytes', - }, + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } ], - outputs: [ + "name": "sendMessage", + "outputs": [ { - name: '', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'successfulMessages', - inputs: [ + "inputs": [ { - name: '', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } ], - outputs: [ + "name": "successfulMessages", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'version', - inputs: [], - outputs: [ + "inputs": [], + "name": "version", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'event', - name: 'RelayedMessage', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'source', - type: 'uint256', - indexed: true, - internalType: 'uint256', + "indexed": true, + "internalType": "uint256", + "name": "source", + "type": "uint256" }, { - name: 'messageNonce', - type: 'uint256', - indexed: true, - internalType: 'uint256', + "indexed": true, + "internalType": "uint256", + "name": "messageNonce", + "type": "uint256" }, { - name: 'messageHash', - type: 'bytes32', - indexed: true, - internalType: 'bytes32', - }, + "indexed": true, + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } ], - anonymous: false, + "name": "RelayedMessage", + "type": "event" }, { - type: 'event', - name: 'SentMessage', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'destination', - type: 'uint256', - indexed: true, - internalType: 'uint256', + "indexed": true, + "internalType": "uint256", + "name": "destination", + "type": "uint256" }, { - name: 'target', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" }, { - name: 'messageNonce', - type: 'uint256', - indexed: true, - internalType: 'uint256', + "indexed": true, + "internalType": "uint256", + "name": "messageNonce", + "type": "uint256" }, { - name: 'sender', - type: 'address', - indexed: false, - internalType: 'address', + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" }, { - name: 'message', - type: 'bytes', - indexed: false, - internalType: 'bytes', - }, + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } ], - anonymous: false, + "name": "SentMessage", + "type": "event" }, { - type: 'error', - name: 'EventPayloadNotSentMessage', - inputs: [], + "inputs": [], + "name": "EventPayloadNotSentMessage", + "type": "error" }, { - type: 'error', - name: 'IdOriginNotL2ToL2CrossDomainMessenger', - inputs: [], + "inputs": [], + "name": "IdOriginNotL2ToL2CrossDomainMessenger", + "type": "error" }, { - type: 'error', - name: 'InvalidChainId', - inputs: [], + "inputs": [], + "name": "InvalidChainId", + "type": "error" }, { - type: 'error', - name: 'MessageAlreadyRelayed', - inputs: [], + "inputs": [], + "name": "MessageAlreadyRelayed", + "type": "error" }, { - type: 'error', - name: 'MessageDestinationNotRelayChain', - inputs: [], + "inputs": [], + "name": "MessageDestinationNotRelayChain", + "type": "error" }, { - type: 'error', - name: 'MessageDestinationSameChain', - inputs: [], + "inputs": [], + "name": "MessageDestinationSameChain", + "type": "error" }, { - type: 'error', - name: 'MessageTargetCrossL2Inbox', - inputs: [], + "inputs": [], + "name": "MessageTargetCrossL2Inbox", + "type": "error" }, { - type: 'error', - name: 'MessageTargetL2ToL2CrossDomainMessenger', - inputs: [], + "inputs": [], + "name": "MessageTargetL2ToL2CrossDomainMessenger", + "type": "error" }, { - type: 'error', - name: 'NotEntered', - inputs: [], + "inputs": [], + "name": "NotEntered", + "type": "error" }, { - type: 'error', - name: 'ReentrantCall', - inputs: [], + "inputs": [], + "name": "ReentrantCall", + "type": "error" }, { - type: 'error', - name: 'TargetCallFailed', - inputs: [], - }, + "inputs": [], + "name": "TargetCallFailed", + "type": "error" + } ] as const /** - * ABI for the OP Stack contract `SuperchainWETH` + * ABI for the OP Stack contract `OptimismSuperchainERC20` * @category ABI */ -export const superchainWETHABI = [ +export const optimismSuperchainERC20Abi = [ { - type: 'fallback', - stateMutability: 'payable', + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" }, { - type: 'receive', - stateMutability: 'payable', + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'allowance', - inputs: [ + "inputs": [ { - name: 'owner', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "owner", + "type": "address" }, { - name: 'spender', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "spender", + "type": "address" + } ], - outputs: [ + "name": "allowance", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "result", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'approve', - inputs: [ + "inputs": [ { - name: 'guy', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "spender", + "type": "address" }, { - name: 'wad', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - outputs: [ + "name": "approve", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'balanceOf', - inputs: [ + "inputs": [ { - name: 'src', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "owner", + "type": "address" + } ], - outputs: [ + "name": "balanceOf", + "outputs": [ { - name: '', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "result", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'crosschainBurn', - inputs: [ + "inputs": [ { - name: '_from', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_from", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'crosschainMint', - inputs: [ + "inputs": [ { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_from", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "crosschainBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'decimals', - inputs: [], - outputs: [ + "inputs": [ { - name: '', - type: 'uint8', - internalType: 'uint8', + "internalType": "address", + "name": "_to", + "type": "address" }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'deposit', - inputs: [], - outputs: [], - stateMutability: 'payable', + "name": "crosschainMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'name', - inputs: [], - outputs: [ + "inputs": [], + "name": "decimals", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "uint8", + "name": "", + "type": "uint8" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'relayETH', - inputs: [ + "inputs": [ { - name: '_from', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_remoteToken", + "type": "address" }, { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "string", + "name": "_name", + "type": "string" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', + "internalType": "string", + "name": "_symbol", + "type": "string" }, + { + "internalType": "uint8", + "name": "_decimals", + "type": "uint8" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'sendETH', - inputs: [ + "inputs": [ { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: '_chainId', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [ + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ { - name: 'msgHash_', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'payable', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'supportsInterface', - inputs: [ + "inputs": [ { - name: '_interfaceId', - type: 'bytes4', - internalType: 'bytes4', - }, + "internalType": "address", + "name": "owner", + "type": "address" + } ], - outputs: [ + "name": "nonces", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "uint256", + "name": "result", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'symbol', - inputs: [], - outputs: [ + "inputs": [ { - name: '', - type: 'string', - internalType: 'string', + "internalType": "address", + "name": "owner", + "type": "address" }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'totalSupply', - inputs: [], - outputs: [ { - name: '', - type: 'uint256', - internalType: 'uint256', + "internalType": "address", + "name": "spender", + "type": "address" }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'transfer', - inputs: [ { - name: 'dst', - type: 'address', - internalType: 'address', + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - name: 'wad', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" }, - ], - outputs: [ { - name: '', - type: 'bool', - internalType: 'bool', + "internalType": "bytes32", + "name": "r", + "type": "bytes32" }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], - stateMutability: 'nonpayable', + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'transferFrom', - inputs: [ - { - name: 'src', - type: 'address', - internalType: 'address', - }, + "inputs": [], + "name": "remoteToken", + "outputs": [ { - name: 'dst', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - name: 'wad', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } ], - outputs: [ + "name": "supportsInterface", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'nonpayable', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'version', - inputs: [], - outputs: [ + "inputs": [], + "name": "symbol", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'withdraw', - inputs: [ + "inputs": [], + "name": "totalSupply", + "outputs": [ { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "result", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "stateMutability": "view", + "type": "function" }, { - type: 'event', - name: 'Approval', - inputs: [ + "inputs": [ { - name: 'src', - type: 'address', - indexed: true, - internalType: 'address', + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'guy', - type: 'address', - indexed: true, - internalType: 'address', - }, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ { - name: 'wad', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - anonymous: false, + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'event', - name: 'CrosschainBurn', - inputs: [ + "inputs": [ { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', - }, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } ], - anonymous: false, + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'event', - name: 'CrosschainMint', - inputs: [ + "inputs": [], + "name": "version", + "outputs": [ { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', - }, + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" }, { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - anonymous: false, + "name": "Approval", + "type": "event" }, { - type: 'event', - name: 'Deposit', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'dst', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'wad', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - anonymous: false, + "name": "Burn", + "type": "event" }, { - type: 'event', - name: 'RelayETH', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - name: 'source', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } ], - anonymous: false, + "name": "CrosschainBurn", + "type": "event" }, { - type: 'event', - name: 'SendETH', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - name: 'destination', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } ], - anonymous: false, + "name": "CrosschainMint", + "type": "event" }, { - type: 'event', - name: 'Transfer', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'src', - type: 'address', - indexed: true, - internalType: 'address', - }, + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - name: 'dst', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'wad', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - anonymous: false, + "name": "Mint", + "type": "event" }, { - type: 'event', - name: 'Withdrawal', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'src', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'wad', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - anonymous: false, + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "AllowanceOverflow", + "type": "error" }, { - type: 'error', - name: 'InvalidCrossDomainSender', - inputs: [], + "inputs": [], + "name": "AllowanceUnderflow", + "type": "error" }, { - type: 'error', - name: 'NotCustomGasToken', - inputs: [], + "inputs": [], + "name": "InsufficientAllowance", + "type": "error" }, { - type: 'error', - name: 'Unauthorized', - inputs: [], + "inputs": [], + "name": "InsufficientBalance", + "type": "error" }, { - type: 'error', - name: 'ZeroAddress', - inputs: [], + "inputs": [], + "name": "InvalidInitialization", + "type": "error" }, + { + "inputs": [], + "name": "InvalidPermit", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "Permit2AllowanceIsFixedAtInfinity", + "type": "error" + }, + { + "inputs": [], + "name": "PermitExpired", + "type": "error" + }, + { + "inputs": [], + "name": "TotalSupplyOverflow", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + } ] as const /** - * ABI for the OP Stack contract `SuperchainERC20` + * ABI for the OP Stack contract `SuperchainWETH` * @category ABI */ -export const superchainERC20ABI = [ +export const superchainWETHAbi = [ { - type: 'function', - name: 'DOMAIN_SEPARATOR', - inputs: [], - outputs: [ - { - name: 'result', - type: 'bytes32', - internalType: 'bytes32', - }, - ], - stateMutability: 'view', + "stateMutability": "payable", + "type": "fallback" }, { - type: 'function', - name: 'allowance', - inputs: [ + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ { - name: 'owner', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "owner", + "type": "address" }, { - name: 'spender', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "spender", + "type": "address" + } ], - outputs: [ + "name": "allowance", + "outputs": [ { - name: 'result', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'approve', - inputs: [ + "inputs": [ { - name: 'spender', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "guy", + "type": "address" }, { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } ], - outputs: [ + "name": "approve", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'balanceOf', - inputs: [ + "inputs": [ { - name: 'owner', - type: 'address', - internalType: 'address', - }, + "internalType": "address", + "name": "src", + "type": "address" + } ], - outputs: [ + "name": "balanceOf", + "outputs": [ { - name: 'result', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'crosschainBurn', - inputs: [ + "inputs": [ { - name: '_from', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_from", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "crosschainBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'crosschainMint', - inputs: [ + "inputs": [ { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "crosschainMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'decimals', - inputs: [], - outputs: [ + "inputs": [], + "name": "decimals", + "outputs": [ { - name: '', - type: 'uint8', - internalType: 'uint8', - }, + "internalType": "uint8", + "name": "", + "type": "uint8" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'name', - inputs: [], - outputs: [ - { - name: '', - type: 'string', - internalType: 'string', - }, - ], - stateMutability: 'view', + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" }, { - type: 'function', - name: 'nonces', - inputs: [ + "inputs": [], + "name": "name", + "outputs": [ { - name: 'owner', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: 'result', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'permit', - inputs: [ + "inputs": [ { - name: 'owner', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_from", + "type": "address" }, { - name: 'spender', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: 'value', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'deadline', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "relayETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - name: 'v', - type: 'uint8', - internalType: 'uint8', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: 'r', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "sendETH", + "outputs": [ { - name: 's', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "bytes32", + "name": "msgHash_", + "type": "bytes32" + } ], - outputs: [], - stateMutability: 'nonpayable', + "stateMutability": "payable", + "type": "function" }, { - type: 'function', - name: 'supportsInterface', - inputs: [ + "inputs": [ { - name: '_interfaceId', - type: 'bytes4', - internalType: 'bytes4', - }, + "internalType": "bytes4", + "name": "_interfaceId", + "type": "bytes4" + } ], - outputs: [ + "name": "supportsInterface", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'symbol', - inputs: [], - outputs: [ + "inputs": [], + "name": "symbol", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'totalSupply', - inputs: [], - outputs: [ + "inputs": [], + "name": "totalSupply", + "outputs": [ { - name: 'result', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'function', - name: 'transfer', - inputs: [ + "inputs": [ { - name: 'to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "dst", + "type": "address" }, { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } ], - outputs: [ + "name": "transfer", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'transferFrom', - inputs: [ + "inputs": [ { - name: 'from', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "src", + "type": "address" }, { - name: 'to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "dst", + "type": "address" }, { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } ], - outputs: [ + "name": "transferFrom", + "outputs": [ { - name: '', - type: 'bool', - internalType: 'bool', - }, + "internalType": "bool", + "name": "", + "type": "bool" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'version', - inputs: [], - outputs: [ + "inputs": [], + "name": "version", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'event', - name: 'Approval', - inputs: [ + "inputs": [ { - name: 'owner', - type: 'address', - indexed: true, - internalType: 'address', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ { - name: 'spender', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": true, + "internalType": "address", + "name": "guy", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } ], - anonymous: false, + "name": "Approval", + "type": "event" }, { - type: 'event', - name: 'CrosschainBurn', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', - }, + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } ], - anonymous: false, + "name": "CrosschainBurn", + "type": "event" }, { - type: 'event', - name: 'CrosschainMint', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "CrosschainMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } ], - anonymous: false, + "name": "Deposit", + "type": "event" }, { - type: 'event', - name: 'Transfer', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, + { + "indexed": false, + "internalType": "uint256", + "name": "source", + "type": "uint256" + } ], - anonymous: false, - }, - { - type: 'error', - name: 'AllowanceOverflow', - inputs: [], - }, - { - type: 'error', - name: 'AllowanceUnderflow', - inputs: [], + "name": "RelayETH", + "type": "event" }, { - type: 'error', - name: 'InsufficientAllowance', - inputs: [], + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "destination", + "type": "uint256" + } + ], + "name": "SendETH", + "type": "event" }, { - type: 'error', - name: 'InsufficientBalance', - inputs: [], + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" }, { - type: 'error', - name: 'InvalidPermit', - inputs: [], + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" }, { - type: 'error', - name: 'Permit2AllowanceIsFixedAtInfinity', - inputs: [], + "inputs": [], + "name": "InvalidCrossDomainSender", + "type": "error" }, { - type: 'error', - name: 'PermitExpired', - inputs: [], + "inputs": [], + "name": "NotCustomGasToken", + "type": "error" }, { - type: 'error', - name: 'TotalSupplyOverflow', - inputs: [], + "inputs": [], + "name": "Unauthorized", + "type": "error" }, { - type: 'error', - name: 'Unauthorized', - inputs: [], - }, + "inputs": [], + "name": "ZeroAddress", + "type": "error" + } ] as const /** * ABI for the OP Stack contract `SuperchainTokenBridge` * @category ABI */ -export const superchainTokenBridgeABI = [ +export const superchainTokenBridgeAbi = [ { - type: 'function', - name: 'relayERC20', - inputs: [ + "inputs": [ { - name: '_token', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_token", + "type": "address" }, { - name: '_from', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_from", + "type": "address" }, { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } ], - outputs: [], - stateMutability: 'nonpayable', + "name": "relayERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'sendERC20', - inputs: [ + "inputs": [ { - name: '_token', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_token", + "type": "address" }, { - name: '_to', - type: 'address', - internalType: 'address', + "internalType": "address", + "name": "_to", + "type": "address" }, { - name: '_amount', - type: 'uint256', - internalType: 'uint256', + "internalType": "uint256", + "name": "_amount", + "type": "uint256" }, { - name: '_chainId', - type: 'uint256', - internalType: 'uint256', - }, + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } ], - outputs: [ + "name": "sendERC20", + "outputs": [ { - name: 'msgHash_', - type: 'bytes32', - internalType: 'bytes32', - }, + "internalType": "bytes32", + "name": "msgHash_", + "type": "bytes32" + } ], - stateMutability: 'nonpayable', + "stateMutability": "nonpayable", + "type": "function" }, { - type: 'function', - name: 'version', - inputs: [], - outputs: [ + "inputs": [], + "name": "version", + "outputs": [ { - name: '', - type: 'string', - internalType: 'string', - }, + "internalType": "string", + "name": "", + "type": "string" + } ], - stateMutability: 'view', + "stateMutability": "view", + "type": "function" }, { - type: 'event', - name: 'RelayERC20', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'token', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" }, { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'source', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": false, + "internalType": "uint256", + "name": "source", + "type": "uint256" + } ], - anonymous: false, + "name": "RelayERC20", + "type": "event" }, { - type: 'event', - name: 'SendERC20', - inputs: [ + "anonymous": false, + "inputs": [ { - name: 'token', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" }, { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" }, { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" }, { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { - name: 'destination', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, + "indexed": false, + "internalType": "uint256", + "name": "destination", + "type": "uint256" + } ], - anonymous: false, + "name": "SendERC20", + "type": "event" }, { - type: 'error', - name: 'InvalidCrossDomainSender', - inputs: [], + "inputs": [], + "name": "InvalidCrossDomainSender", + "type": "error" }, { - type: 'error', - name: 'InvalidERC7802', - inputs: [], + "inputs": [], + "name": "InvalidERC7802", + "type": "error" }, { - type: 'error', - name: 'Unauthorized', - inputs: [], + "inputs": [], + "name": "Unauthorized", + "type": "error" }, { - type: 'error', - name: 'ZeroAddress', - inputs: [], - }, + "inputs": [], + "name": "ZeroAddress", + "type": "error" + } ] as const + diff --git a/scripts/pull-contract-artifacts.sh b/scripts/pull-contract-artifacts.sh deleted file mode 100755 index 662cadd8..00000000 --- a/scripts/pull-contract-artifacts.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -lib_dir=./lib -artifact_project="oplabs-tools-artifacts" -artifact_bucket="oplabs-contract-artifacts" -artifact_prefix="artifacts-v1-" - -gcloud auth login -gcloud config set project $artifact_project - -# Pulls latest v1 artifact bundle -latest_archive=$(gsutil ls -l gs://$artifact_bucket/$artifact_prefix* | sort -k 2 | tail -2 | head -1 | awk '{print $3}') -archive_name=$(basename $latest_archive) - -cd $lib_dir - -# Cleanup any existing artifacts -rm -rf forge-artifacts - -# Download and extract the archive -echo "Attempting to download $latest_archive" -gsutil cp $latest_archive . -tar -xzvf $archive_name - -# Cleanup -rm $archive_name -rm -rf artifacts -rm -rf cache - -gcloud config unset project - -echo "Done" From bf5aa49a69a76bee4aa661f425407ad2459179e4 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 12:08:53 -0500 Subject: [PATCH 03/11] lint & remove abi export --- packages/viem/scripts/abigen.ts | 28 +++++++++++++++++++++++++--- packages/viem/src/index.ts | 3 --- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index 0ff52a3b..d1fadaf2 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -4,7 +4,13 @@ import path from 'path' // Hardcoded. Can take a more elaborate approach if needed. const OPTIMISM_PATH = path.join('..', '..', 'lib', 'optimism') -const ABI_SNAPSHOTS_PATH = path.join(OPTIMISM_PATH, 'packages', 'contracts-bedrock', 'snapshots', 'abi') +const ABI_SNAPSHOTS_PATH = path.join( + OPTIMISM_PATH, + 'packages', + 'contracts-bedrock', + 'snapshots', + 'abi', +) const CONTRACTS = [ 'CrossL2Inbox', 'L2ToL2CrossDomainMessenger', @@ -20,11 +26,27 @@ function camelCase(str: string): string { return start.toLowerCase() + rest.join('') } -/** ABI Generation */ +function prettyPrintJSON(obj: any): string { + const str = JSON.stringify(obj, null, 2) + + // Remove quotes from keys + const cleaned = str.replace(/^[\t ]*"[^:\n\r]+(? { console.log(`Generating Abi for ${contract}`) diff --git a/packages/viem/src/index.ts b/packages/viem/src/index.ts index f95e6e25..76dc33ea 100644 --- a/packages/viem/src/index.ts +++ b/packages/viem/src/index.ts @@ -1,9 +1,6 @@ // types export type { MessageIdentifier } from '@/types/interop.js' -// abi -export * from '@/abis.js' - // contracts export { contracts } from '@/contracts.js' From 51fb940e51ad43282e87e770eba2792d1639f5b0 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 12:10:25 -0500 Subject: [PATCH 04/11] gen --- packages/viem/scripts/abigen.ts | 8 +- packages/viem/src/abis.ts | 2232 +++++++++++++++---------------- 2 files changed, 1118 insertions(+), 1122 deletions(-) diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index d1fadaf2..d411b390 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -35,7 +35,7 @@ function prettyPrintJSON(obj: any): string { }) // Replace left over double quotes with single - return cleaned.replace('\"', "'") + return cleaned.replace(/"/g, "'") } /** Abi Generation */ @@ -55,11 +55,7 @@ async function main() { return { name: contract, exportName: camelCase(contract), abi } }) - const fileContents = eta.render('abis', { - contracts, - prettyPrintJSON: (json: any) => JSON.stringify(json, null, 2), - }) - + const fileContents = eta.render('abis', { contracts, prettyPrintJSON }) fs.writeFileSync(`src/abis.ts`, fileContents) } diff --git a/packages/viem/src/abis.ts b/packages/viem/src/abis.ts index f356f8a4..c4caa7ef 100644 --- a/packages/viem/src/abis.ts +++ b/packages/viem/src/abis.ts @@ -7,218 +7,218 @@ */ export const crossL2InboxAbi = [ { - "inputs": [], - "name": "blockNumber", - "outputs": [ + inputs: [], + name: 'blockNumber', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "chainId", - "outputs": [ + inputs: [], + name: 'chainId', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "interopStart", - "outputs": [ + inputs: [], + name: 'interopStart', + outputs: [ { - "internalType": "uint256", - "name": "interopStart_", - "type": "uint256" + internalType: 'uint256', + name: 'interopStart_', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "logIndex", - "outputs": [ + inputs: [], + name: 'logIndex', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "origin", - "outputs": [ + inputs: [], + name: 'origin', + outputs: [ { - "internalType": "address", - "name": "", - "type": "address" + internalType: 'address', + name: '', + type: 'address' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "setInteropStart", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + inputs: [], + name: 'setInteropStart', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "timestamp", - "outputs": [ + inputs: [], + name: 'timestamp', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "components": [ + components: [ { - "internalType": "address", - "name": "origin", - "type": "address" + internalType: 'address', + name: 'origin', + type: 'address' }, { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256' }, { - "internalType": "uint256", - "name": "logIndex", - "type": "uint256" + internalType: 'uint256', + name: 'logIndex', + type: 'uint256' }, { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" + internalType: 'uint256', + name: 'timestamp', + type: 'uint256' }, { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" + internalType: 'uint256', + name: 'chainId', + type: 'uint256' } ], - "internalType": "struct Identifier", - "name": "_id", - "type": "tuple" + internalType: 'struct Identifier', + name: '_id', + type: 'tuple' }, { - "internalType": "bytes32", - "name": "_msgHash", - "type": "bytes32" + internalType: 'bytes32', + name: '_msgHash', + type: 'bytes32' } ], - "name": "validateMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'validateMessage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "version", - "outputs": [ + inputs: [], + name: 'version', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "bytes32", - "name": "msgHash", - "type": "bytes32" + indexed: true, + internalType: 'bytes32', + name: 'msgHash', + type: 'bytes32' }, { - "components": [ + components: [ { - "internalType": "address", - "name": "origin", - "type": "address" + internalType: 'address', + name: 'origin', + type: 'address' }, { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256' }, { - "internalType": "uint256", - "name": "logIndex", - "type": "uint256" + internalType: 'uint256', + name: 'logIndex', + type: 'uint256' }, { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" + internalType: 'uint256', + name: 'timestamp', + type: 'uint256' }, { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" + internalType: 'uint256', + name: 'chainId', + type: 'uint256' } ], - "indexed": false, - "internalType": "struct Identifier", - "name": "id", - "type": "tuple" + indexed: false, + internalType: 'struct Identifier', + name: 'id', + type: 'tuple' } ], - "name": "ExecutingMessage", - "type": "event" + name: 'ExecutingMessage', + type: 'event' }, { - "inputs": [], - "name": "InteropStartAlreadySet", - "type": "error" + inputs: [], + name: 'InteropStartAlreadySet', + type: 'error' }, { - "inputs": [], - "name": "NoExecutingDeposits", - "type": "error" + inputs: [], + name: 'NoExecutingDeposits', + type: 'error' }, { - "inputs": [], - "name": "NotDepositor", - "type": "error" + inputs: [], + name: 'NotDepositor', + type: 'error' }, { - "inputs": [], - "name": "NotEntered", - "type": "error" + inputs: [], + name: 'NotEntered', + type: 'error' }, { - "inputs": [], - "name": "ReentrantCall", - "type": "error" + inputs: [], + name: 'ReentrantCall', + type: 'error' } ] as const @@ -228,303 +228,303 @@ export const crossL2InboxAbi = [ */ export const l2ToL2CrossDomainMessengerAbi = [ { - "inputs": [], - "name": "crossDomainMessageContext", - "outputs": [ + inputs: [], + name: 'crossDomainMessageContext', + outputs: [ { - "internalType": "address", - "name": "sender_", - "type": "address" + internalType: 'address', + name: 'sender_', + type: 'address' }, { - "internalType": "uint256", - "name": "source_", - "type": "uint256" + internalType: 'uint256', + name: 'source_', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "crossDomainMessageSender", - "outputs": [ + inputs: [], + name: 'crossDomainMessageSender', + outputs: [ { - "internalType": "address", - "name": "sender_", - "type": "address" + internalType: 'address', + name: 'sender_', + type: 'address' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "crossDomainMessageSource", - "outputs": [ + inputs: [], + name: 'crossDomainMessageSource', + outputs: [ { - "internalType": "uint256", - "name": "source_", - "type": "uint256" + internalType: 'uint256', + name: 'source_', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "messageNonce", - "outputs": [ + inputs: [], + name: 'messageNonce', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "messageVersion", - "outputs": [ + inputs: [], + name: 'messageVersion', + outputs: [ { - "internalType": "uint16", - "name": "", - "type": "uint16" + internalType: 'uint16', + name: '', + type: 'uint16' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "components": [ + components: [ { - "internalType": "address", - "name": "origin", - "type": "address" + internalType: 'address', + name: 'origin', + type: 'address' }, { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256' }, { - "internalType": "uint256", - "name": "logIndex", - "type": "uint256" + internalType: 'uint256', + name: 'logIndex', + type: 'uint256' }, { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" + internalType: 'uint256', + name: 'timestamp', + type: 'uint256' }, { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" + internalType: 'uint256', + name: 'chainId', + type: 'uint256' } ], - "internalType": "struct Identifier", - "name": "_id", - "type": "tuple" + internalType: 'struct Identifier', + name: '_id', + type: 'tuple' }, { - "internalType": "bytes", - "name": "_sentMessage", - "type": "bytes" + internalType: 'bytes', + name: '_sentMessage', + type: 'bytes' } ], - "name": "relayMessage", - "outputs": [ + name: 'relayMessage', + outputs: [ { - "internalType": "bytes", - "name": "returnData_", - "type": "bytes" + internalType: 'bytes', + name: 'returnData_', + type: 'bytes' } ], - "stateMutability": "payable", - "type": "function" + stateMutability: 'payable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "uint256", - "name": "_destination", - "type": "uint256" + internalType: 'uint256', + name: '_destination', + type: 'uint256' }, { - "internalType": "address", - "name": "_target", - "type": "address" + internalType: 'address', + name: '_target', + type: 'address' }, { - "internalType": "bytes", - "name": "_message", - "type": "bytes" + internalType: 'bytes', + name: '_message', + type: 'bytes' } ], - "name": "sendMessage", - "outputs": [ + name: 'sendMessage', + outputs: [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + internalType: 'bytes32', + name: '', + type: 'bytes32' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + internalType: 'bytes32', + name: '', + type: 'bytes32' } ], - "name": "successfulMessages", - "outputs": [ + name: 'successfulMessages', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "version", - "outputs": [ + inputs: [], + name: 'version', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "uint256", - "name": "source", - "type": "uint256" + indexed: true, + internalType: 'uint256', + name: 'source', + type: 'uint256' }, { - "indexed": true, - "internalType": "uint256", - "name": "messageNonce", - "type": "uint256" + indexed: true, + internalType: 'uint256', + name: 'messageNonce', + type: 'uint256' }, { - "indexed": true, - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" + indexed: true, + internalType: 'bytes32', + name: 'messageHash', + type: 'bytes32' } ], - "name": "RelayedMessage", - "type": "event" + name: 'RelayedMessage', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "uint256", - "name": "destination", - "type": "uint256" + indexed: true, + internalType: 'uint256', + name: 'destination', + type: 'uint256' }, { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" + indexed: true, + internalType: 'address', + name: 'target', + type: 'address' }, { - "indexed": true, - "internalType": "uint256", - "name": "messageNonce", - "type": "uint256" + indexed: true, + internalType: 'uint256', + name: 'messageNonce', + type: 'uint256' }, { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" + indexed: false, + internalType: 'address', + name: 'sender', + type: 'address' }, { - "indexed": false, - "internalType": "bytes", - "name": "message", - "type": "bytes" + indexed: false, + internalType: 'bytes', + name: 'message', + type: 'bytes' } ], - "name": "SentMessage", - "type": "event" + name: 'SentMessage', + type: 'event' }, { - "inputs": [], - "name": "EventPayloadNotSentMessage", - "type": "error" + inputs: [], + name: 'EventPayloadNotSentMessage', + type: 'error' }, { - "inputs": [], - "name": "IdOriginNotL2ToL2CrossDomainMessenger", - "type": "error" + inputs: [], + name: 'IdOriginNotL2ToL2CrossDomainMessenger', + type: 'error' }, { - "inputs": [], - "name": "InvalidChainId", - "type": "error" + inputs: [], + name: 'InvalidChainId', + type: 'error' }, { - "inputs": [], - "name": "MessageAlreadyRelayed", - "type": "error" + inputs: [], + name: 'MessageAlreadyRelayed', + type: 'error' }, { - "inputs": [], - "name": "MessageDestinationNotRelayChain", - "type": "error" + inputs: [], + name: 'MessageDestinationNotRelayChain', + type: 'error' }, { - "inputs": [], - "name": "MessageDestinationSameChain", - "type": "error" + inputs: [], + name: 'MessageDestinationSameChain', + type: 'error' }, { - "inputs": [], - "name": "MessageTargetCrossL2Inbox", - "type": "error" + inputs: [], + name: 'MessageTargetCrossL2Inbox', + type: 'error' }, { - "inputs": [], - "name": "MessageTargetL2ToL2CrossDomainMessenger", - "type": "error" + inputs: [], + name: 'MessageTargetL2ToL2CrossDomainMessenger', + type: 'error' }, { - "inputs": [], - "name": "NotEntered", - "type": "error" + inputs: [], + name: 'NotEntered', + type: 'error' }, { - "inputs": [], - "name": "ReentrantCall", - "type": "error" + inputs: [], + name: 'ReentrantCall', + type: 'error' }, { - "inputs": [], - "name": "TargetCallFailed", - "type": "error" + inputs: [], + name: 'TargetCallFailed', + type: 'error' } ] as const @@ -534,612 +534,612 @@ export const l2ToL2CrossDomainMessengerAbi = [ */ export const optimismSuperchainERC20Abi = [ { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor' }, { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ { - "internalType": "bytes32", - "name": "result", - "type": "bytes32" + internalType: 'bytes32', + name: 'result', + type: 'bytes32' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "owner", - "type": "address" + internalType: 'address', + name: 'owner', + type: 'address' }, { - "internalType": "address", - "name": "spender", - "type": "address" + internalType: 'address', + name: 'spender', + type: 'address' } ], - "name": "allowance", - "outputs": [ + name: 'allowance', + outputs: [ { - "internalType": "uint256", - "name": "result", - "type": "uint256" + internalType: 'uint256', + name: 'result', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "spender", - "type": "address" + internalType: 'address', + name: 'spender', + type: 'address' }, { - "internalType": "uint256", - "name": "amount", - "type": "uint256" + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "approve", - "outputs": [ + name: 'approve', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "owner", - "type": "address" + internalType: 'address', + name: 'owner', + type: 'address' } ], - "name": "balanceOf", - "outputs": [ + name: 'balanceOf', + outputs: [ { - "internalType": "uint256", - "name": "result", - "type": "uint256" + internalType: 'uint256', + name: 'result', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_from", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_from", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "crosschainBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'crosschainBurn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "crosschainMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'crosschainMint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "decimals", - "outputs": [ + inputs: [], + name: 'decimals', + outputs: [ { - "internalType": "uint8", - "name": "", - "type": "uint8" + internalType: 'uint8', + name: '', + type: 'uint8' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_remoteToken", - "type": "address" + internalType: 'address', + name: '_remoteToken', + type: 'address' }, { - "internalType": "string", - "name": "_name", - "type": "string" + internalType: 'string', + name: '_name', + type: 'string' }, { - "internalType": "string", - "name": "_symbol", - "type": "string" + internalType: 'string', + name: '_symbol', + type: 'string' }, { - "internalType": "uint8", - "name": "_decimals", - "type": "uint8" + internalType: 'uint8', + name: '_decimals', + type: 'uint8' } ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "name", - "outputs": [ + inputs: [], + name: 'name', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "owner", - "type": "address" + internalType: 'address', + name: 'owner', + type: 'address' } ], - "name": "nonces", - "outputs": [ + name: 'nonces', + outputs: [ { - "internalType": "uint256", - "name": "result", - "type": "uint256" + internalType: 'uint256', + name: 'result', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "owner", - "type": "address" + internalType: 'address', + name: 'owner', + type: 'address' }, { - "internalType": "address", - "name": "spender", - "type": "address" + internalType: 'address', + name: 'spender', + type: 'address' }, { - "internalType": "uint256", - "name": "value", - "type": "uint256" + internalType: 'uint256', + name: 'value', + type: 'uint256' }, { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" + internalType: 'uint256', + name: 'deadline', + type: 'uint256' }, { - "internalType": "uint8", - "name": "v", - "type": "uint8" + internalType: 'uint8', + name: 'v', + type: 'uint8' }, { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" + internalType: 'bytes32', + name: 'r', + type: 'bytes32' }, { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" + internalType: 'bytes32', + name: 's', + type: 'bytes32' } ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "remoteToken", - "outputs": [ + inputs: [], + name: 'remoteToken', + outputs: [ { - "internalType": "address", - "name": "", - "type": "address" + internalType: 'address', + name: '', + type: 'address' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "bytes4", - "name": "_interfaceId", - "type": "bytes4" + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4' } ], - "name": "supportsInterface", - "outputs": [ + name: 'supportsInterface', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "symbol", - "outputs": [ + inputs: [], + name: 'symbol', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "totalSupply", - "outputs": [ + inputs: [], + name: 'totalSupply', + outputs: [ { - "internalType": "uint256", - "name": "result", - "type": "uint256" + internalType: 'uint256', + name: 'result', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "to", - "type": "address" + internalType: 'address', + name: 'to', + type: 'address' }, { - "internalType": "uint256", - "name": "amount", - "type": "uint256" + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "transfer", - "outputs": [ + name: 'transfer', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "from", - "type": "address" + internalType: 'address', + name: 'from', + type: 'address' }, { - "internalType": "address", - "name": "to", - "type": "address" + internalType: 'address', + name: 'to', + type: 'address' }, { - "internalType": "uint256", - "name": "amount", - "type": "uint256" + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "transferFrom", - "outputs": [ + name: 'transferFrom', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "version", - "outputs": [ + inputs: [], + name: 'version', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "Approval", - "type": "event" + name: 'Approval', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "Burn", - "type": "event" + name: 'Burn', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address' } ], - "name": "CrosschainBurn", - "type": "event" + name: 'CrosschainBurn', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address' } ], - "name": "CrosschainMint", - "type": "event" + name: 'CrosschainMint', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" + indexed: false, + internalType: 'uint64', + name: 'version', + type: 'uint64' } ], - "name": "Initialized", - "type": "event" + name: 'Initialized', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "Mint", - "type": "event" + name: 'Mint', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' } ], - "name": "Transfer", - "type": "event" + name: 'Transfer', + type: 'event' }, { - "inputs": [], - "name": "AllowanceOverflow", - "type": "error" + inputs: [], + name: 'AllowanceOverflow', + type: 'error' }, { - "inputs": [], - "name": "AllowanceUnderflow", - "type": "error" + inputs: [], + name: 'AllowanceUnderflow', + type: 'error' }, { - "inputs": [], - "name": "InsufficientAllowance", - "type": "error" + inputs: [], + name: 'InsufficientAllowance', + type: 'error' }, { - "inputs": [], - "name": "InsufficientBalance", - "type": "error" + inputs: [], + name: 'InsufficientBalance', + type: 'error' }, { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" + inputs: [], + name: 'InvalidInitialization', + type: 'error' }, { - "inputs": [], - "name": "InvalidPermit", - "type": "error" + inputs: [], + name: 'InvalidPermit', + type: 'error' }, { - "inputs": [], - "name": "NotInitializing", - "type": "error" + inputs: [], + name: 'NotInitializing', + type: 'error' }, { - "inputs": [], - "name": "Permit2AllowanceIsFixedAtInfinity", - "type": "error" + inputs: [], + name: 'Permit2AllowanceIsFixedAtInfinity', + type: 'error' }, { - "inputs": [], - "name": "PermitExpired", - "type": "error" + inputs: [], + name: 'PermitExpired', + type: 'error' }, { - "inputs": [], - "name": "TotalSupplyOverflow", - "type": "error" + inputs: [], + name: 'TotalSupplyOverflow', + type: 'error' }, { - "inputs": [], - "name": "Unauthorized", - "type": "error" + inputs: [], + name: 'Unauthorized', + type: 'error' }, { - "inputs": [], - "name": "ZeroAddress", - "type": "error" + inputs: [], + name: 'ZeroAddress', + type: 'error' } ] as const @@ -1149,539 +1149,539 @@ export const optimismSuperchainERC20Abi = [ */ export const superchainWETHAbi = [ { - "stateMutability": "payable", - "type": "fallback" + stateMutability: 'payable', + type: 'fallback' }, { - "stateMutability": "payable", - "type": "receive" + stateMutability: 'payable', + type: 'receive' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "owner", - "type": "address" + internalType: 'address', + name: 'owner', + type: 'address' }, { - "internalType": "address", - "name": "spender", - "type": "address" + internalType: 'address', + name: 'spender', + type: 'address' } ], - "name": "allowance", - "outputs": [ + name: 'allowance', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "guy", - "type": "address" + internalType: 'address', + name: 'guy', + type: 'address' }, { - "internalType": "uint256", - "name": "wad", - "type": "uint256" + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "approve", - "outputs": [ + name: 'approve', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "src", - "type": "address" + internalType: 'address', + name: 'src', + type: 'address' } ], - "name": "balanceOf", - "outputs": [ + name: 'balanceOf', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_from", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "crosschainBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'crosschainBurn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "crosschainMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'crosschainMint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "decimals", - "outputs": [ + inputs: [], + name: 'decimals', + outputs: [ { - "internalType": "uint8", - "name": "", - "type": "uint8" + internalType: 'uint8', + name: '', + type: 'uint8' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" + inputs: [], + name: 'deposit', + outputs: [], + stateMutability: 'payable', + type: 'function' }, { - "inputs": [], - "name": "name", - "outputs": [ + inputs: [], + name: 'name', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_from", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "relayETH", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'relayETH', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" + internalType: 'uint256', + name: '_chainId', + type: 'uint256' } ], - "name": "sendETH", - "outputs": [ + name: 'sendETH', + outputs: [ { - "internalType": "bytes32", - "name": "msgHash_", - "type": "bytes32" + internalType: 'bytes32', + name: 'msgHash_', + type: 'bytes32' } ], - "stateMutability": "payable", - "type": "function" + stateMutability: 'payable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "bytes4", - "name": "_interfaceId", - "type": "bytes4" + internalType: 'bytes4', + name: '_interfaceId', + type: 'bytes4' } ], - "name": "supportsInterface", - "outputs": [ + name: 'supportsInterface', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "symbol", - "outputs": [ + inputs: [], + name: 'symbol', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [], - "name": "totalSupply", - "outputs": [ + inputs: [], + name: 'totalSupply', + outputs: [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + internalType: 'uint256', + name: '', + type: 'uint256' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "dst", - "type": "address" + internalType: 'address', + name: 'dst', + type: 'address' }, { - "internalType": "uint256", - "name": "wad", - "type": "uint256" + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "transfer", - "outputs": [ + name: 'transfer', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "src", - "type": "address" + internalType: 'address', + name: 'src', + type: 'address' }, { - "internalType": "address", - "name": "dst", - "type": "address" + internalType: 'address', + name: 'dst', + type: 'address' }, { - "internalType": "uint256", - "name": "wad", - "type": "uint256" + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "transferFrom", - "outputs": [ + name: 'transferFrom', + outputs: [ { - "internalType": "bool", - "name": "", - "type": "bool" + internalType: 'bool', + name: '', + type: 'bool' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "version", - "outputs": [ + inputs: [], + name: 'version', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" + indexed: true, + internalType: 'address', + name: 'src', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "guy", - "type": "address" + indexed: true, + internalType: 'address', + name: 'guy', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "Approval", - "type": "event" + name: 'Approval', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address' } ], - "name": "CrosschainBurn", - "type": "event" + name: 'CrosschainBurn', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address' } ], - "name": "CrosschainMint", - "type": "event" + name: 'CrosschainMint', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "dst", - "type": "address" + indexed: true, + internalType: 'address', + name: 'dst', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "Deposit", - "type": "event" + name: 'Deposit', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": false, - "internalType": "uint256", - "name": "source", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'source', + type: 'uint256' } ], - "name": "RelayETH", - "type": "event" + name: 'RelayETH', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": false, - "internalType": "uint256", - "name": "destination", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'destination', + type: 'uint256' } ], - "name": "SendETH", - "type": "event" + name: 'SendETH', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" + indexed: true, + internalType: 'address', + name: 'src', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "dst", - "type": "address" + indexed: true, + internalType: 'address', + name: 'dst', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "Transfer", - "type": "event" + name: 'Transfer', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "src", - "type": "address" + indexed: true, + internalType: 'address', + name: 'src', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "wad", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'wad', + type: 'uint256' } ], - "name": "Withdrawal", - "type": "event" + name: 'Withdrawal', + type: 'event' }, { - "inputs": [], - "name": "InvalidCrossDomainSender", - "type": "error" + inputs: [], + name: 'InvalidCrossDomainSender', + type: 'error' }, { - "inputs": [], - "name": "NotCustomGasToken", - "type": "error" + inputs: [], + name: 'NotCustomGasToken', + type: 'error' }, { - "inputs": [], - "name": "Unauthorized", - "type": "error" + inputs: [], + name: 'Unauthorized', + type: 'error' }, { - "inputs": [], - "name": "ZeroAddress", - "type": "error" + inputs: [], + name: 'ZeroAddress', + type: 'error' } ] as const @@ -1691,173 +1691,173 @@ export const superchainWETHAbi = [ */ export const superchainTokenBridgeAbi = [ { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_token", - "type": "address" + internalType: 'address', + name: '_token', + type: 'address' }, { - "internalType": "address", - "name": "_from", - "type": "address" + internalType: 'address', + name: '_from', + type: 'address' }, { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' } ], - "name": "relayERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + name: 'relayERC20', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [ + inputs: [ { - "internalType": "address", - "name": "_token", - "type": "address" + internalType: 'address', + name: '_token', + type: 'address' }, { - "internalType": "address", - "name": "_to", - "type": "address" + internalType: 'address', + name: '_to', + type: 'address' }, { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" + internalType: 'uint256', + name: '_amount', + type: 'uint256' }, { - "internalType": "uint256", - "name": "_chainId", - "type": "uint256" + internalType: 'uint256', + name: '_chainId', + type: 'uint256' } ], - "name": "sendERC20", - "outputs": [ + name: 'sendERC20', + outputs: [ { - "internalType": "bytes32", - "name": "msgHash_", - "type": "bytes32" + internalType: 'bytes32', + name: 'msgHash_', + type: 'bytes32' } ], - "stateMutability": "nonpayable", - "type": "function" + stateMutability: 'nonpayable', + type: 'function' }, { - "inputs": [], - "name": "version", - "outputs": [ + inputs: [], + name: 'version', + outputs: [ { - "internalType": "string", - "name": "", - "type": "string" + internalType: 'string', + name: '', + type: 'string' } ], - "stateMutability": "view", - "type": "function" + stateMutability: 'view', + type: 'function' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" + indexed: true, + internalType: 'address', + name: 'token', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": false, - "internalType": "uint256", - "name": "source", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'source', + type: 'uint256' } ], - "name": "RelayERC20", - "type": "event" + name: 'RelayERC20', + type: 'event' }, { - "anonymous": false, - "inputs": [ + anonymous: false, + inputs: [ { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" + indexed: true, + internalType: 'address', + name: 'token', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + indexed: true, + internalType: 'address', + name: 'from', + type: 'address' }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" + indexed: true, + internalType: 'address', + name: 'to', + type: 'address' }, { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256' }, { - "indexed": false, - "internalType": "uint256", - "name": "destination", - "type": "uint256" + indexed: false, + internalType: 'uint256', + name: 'destination', + type: 'uint256' } ], - "name": "SendERC20", - "type": "event" + name: 'SendERC20', + type: 'event' }, { - "inputs": [], - "name": "InvalidCrossDomainSender", - "type": "error" + inputs: [], + name: 'InvalidCrossDomainSender', + type: 'error' }, { - "inputs": [], - "name": "InvalidERC7802", - "type": "error" + inputs: [], + name: 'InvalidERC7802', + type: 'error' }, { - "inputs": [], - "name": "Unauthorized", - "type": "error" + inputs: [], + name: 'Unauthorized', + type: 'error' }, { - "inputs": [], - "name": "ZeroAddress", - "type": "error" + inputs: [], + name: 'ZeroAddress', + type: 'error' } ] as const From 997a5ed64ed62acbfa1cb09adc4598246a8919f0 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 12:14:55 -0500 Subject: [PATCH 05/11] final touches --- packages/viem/scripts/abigen.ts | 18 +- packages/viem/src/abis.ts | 818 ++++++++++++++++---------------- 2 files changed, 413 insertions(+), 423 deletions(-) diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index d411b390..08f79f67 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -26,18 +26,6 @@ function camelCase(str: string): string { return start.toLowerCase() + rest.join('') } -function prettyPrintJSON(obj: any): string { - const str = JSON.stringify(obj, null, 2) - - // Remove quotes from keys - const cleaned = str.replace(/^[\t ]*"[^:\n\r]+(? JSON.stringify(obj, null, 2), + }) + fs.writeFileSync(`src/abis.ts`, fileContents) } diff --git a/packages/viem/src/abis.ts b/packages/viem/src/abis.ts index c4caa7ef..bf8bbf7a 100644 --- a/packages/viem/src/abis.ts +++ b/packages/viem/src/abis.ts @@ -1,6 +1,5 @@ // DO NOT MODIFY THIS FILE IS AUTOGENERATED - /** * ABI for the OP Stack contract `CrossL2Inbox` * @category ABI @@ -13,11 +12,11 @@ export const crossL2InboxAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -26,11 +25,11 @@ export const crossL2InboxAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -39,11 +38,11 @@ export const crossL2InboxAbi = [ { internalType: 'uint256', name: 'interopStart_', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -52,11 +51,11 @@ export const crossL2InboxAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -65,18 +64,18 @@ export const crossL2InboxAbi = [ { internalType: 'address', name: '', - type: 'address' - } + type: 'address', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], name: 'setInteropStart', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -85,11 +84,11 @@ export const crossL2InboxAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ @@ -98,43 +97,43 @@ export const crossL2InboxAbi = [ { internalType: 'address', name: 'origin', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'blockNumber', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'logIndex', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'timestamp', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'chainId', - type: 'uint256' - } + type: 'uint256', + }, ], internalType: 'struct Identifier', name: '_id', - type: 'tuple' + type: 'tuple', }, { internalType: 'bytes32', name: '_msgHash', - type: 'bytes32' - } + type: 'bytes32', + }, ], name: 'validateMessage', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -143,11 +142,11 @@ export const crossL2InboxAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { anonymous: false, @@ -156,70 +155,70 @@ export const crossL2InboxAbi = [ indexed: true, internalType: 'bytes32', name: 'msgHash', - type: 'bytes32' + type: 'bytes32', }, { components: [ { internalType: 'address', name: 'origin', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'blockNumber', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'logIndex', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'timestamp', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'chainId', - type: 'uint256' - } + type: 'uint256', + }, ], indexed: false, internalType: 'struct Identifier', name: 'id', - type: 'tuple' - } + type: 'tuple', + }, ], name: 'ExecutingMessage', - type: 'event' + type: 'event', }, { inputs: [], name: 'InteropStartAlreadySet', - type: 'error' + type: 'error', }, { inputs: [], name: 'NoExecutingDeposits', - type: 'error' + type: 'error', }, { inputs: [], name: 'NotDepositor', - type: 'error' + type: 'error', }, { inputs: [], name: 'NotEntered', - type: 'error' + type: 'error', }, { inputs: [], name: 'ReentrantCall', - type: 'error' - } + type: 'error', + }, ] as const /** @@ -234,16 +233,16 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'address', name: 'sender_', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'source_', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -252,11 +251,11 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'address', name: 'sender_', - type: 'address' - } + type: 'address', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -265,11 +264,11 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'uint256', name: 'source_', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -278,11 +277,11 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -291,11 +290,11 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'uint16', name: '', - type: 'uint16' - } + type: 'uint16', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ @@ -304,97 +303,97 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'address', name: 'origin', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'blockNumber', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'logIndex', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'timestamp', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'chainId', - type: 'uint256' - } + type: 'uint256', + }, ], internalType: 'struct Identifier', name: '_id', - type: 'tuple' + type: 'tuple', }, { internalType: 'bytes', name: '_sentMessage', - type: 'bytes' - } + type: 'bytes', + }, ], name: 'relayMessage', outputs: [ { internalType: 'bytes', name: 'returnData_', - type: 'bytes' - } + type: 'bytes', + }, ], stateMutability: 'payable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_destination', - type: 'uint256' + type: 'uint256', }, { internalType: 'address', name: '_target', - type: 'address' + type: 'address', }, { internalType: 'bytes', name: '_message', - type: 'bytes' - } + type: 'bytes', + }, ], name: 'sendMessage', outputs: [ { internalType: 'bytes32', name: '', - type: 'bytes32' - } + type: 'bytes32', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'bytes32', name: '', - type: 'bytes32' - } + type: 'bytes32', + }, ], name: 'successfulMessages', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -403,11 +402,11 @@ export const l2ToL2CrossDomainMessengerAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { anonymous: false, @@ -416,23 +415,23 @@ export const l2ToL2CrossDomainMessengerAbi = [ indexed: true, internalType: 'uint256', name: 'source', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'uint256', name: 'messageNonce', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'bytes32', name: 'messageHash', - type: 'bytes32' - } + type: 'bytes32', + }, ], name: 'RelayedMessage', - type: 'event' + type: 'event', }, { anonymous: false, @@ -441,91 +440,91 @@ export const l2ToL2CrossDomainMessengerAbi = [ indexed: true, internalType: 'uint256', name: 'destination', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'address', name: 'target', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'uint256', name: 'messageNonce', - type: 'uint256' + type: 'uint256', }, { indexed: false, internalType: 'address', name: 'sender', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'bytes', name: 'message', - type: 'bytes' - } + type: 'bytes', + }, ], name: 'SentMessage', - type: 'event' + type: 'event', }, { inputs: [], name: 'EventPayloadNotSentMessage', - type: 'error' + type: 'error', }, { inputs: [], name: 'IdOriginNotL2ToL2CrossDomainMessenger', - type: 'error' + type: 'error', }, { inputs: [], name: 'InvalidChainId', - type: 'error' + type: 'error', }, { inputs: [], name: 'MessageAlreadyRelayed', - type: 'error' + type: 'error', }, { inputs: [], name: 'MessageDestinationNotRelayChain', - type: 'error' + type: 'error', }, { inputs: [], name: 'MessageDestinationSameChain', - type: 'error' + type: 'error', }, { inputs: [], name: 'MessageTargetCrossL2Inbox', - type: 'error' + type: 'error', }, { inputs: [], name: 'MessageTargetL2ToL2CrossDomainMessenger', - type: 'error' + type: 'error', }, { inputs: [], name: 'NotEntered', - type: 'error' + type: 'error', }, { inputs: [], name: 'ReentrantCall', - type: 'error' + type: 'error', }, { inputs: [], name: 'TargetCallFailed', - type: 'error' - } + type: 'error', + }, ] as const /** @@ -536,7 +535,7 @@ export const optimismSuperchainERC20Abi = [ { inputs: [], stateMutability: 'nonpayable', - type: 'constructor' + type: 'constructor', }, { inputs: [], @@ -545,132 +544,132 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'bytes32', name: 'result', - type: 'bytes32' - } + type: 'bytes32', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', - type: 'address' + type: 'address', }, { internalType: 'address', name: 'spender', - type: 'address' - } + type: 'address', + }, ], name: 'allowance', outputs: [ { internalType: 'uint256', name: 'result', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'spender', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'approve', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', - type: 'address' - } + type: 'address', + }, ], name: 'balanceOf', outputs: [ { internalType: 'uint256', name: 'result', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_from', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'burn', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_from', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'crosschainBurn', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'crosschainMint', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -679,57 +678,57 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'uint8', name: '', - type: 'uint8' - } + type: 'uint8', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_remoteToken', - type: 'address' + type: 'address', }, { internalType: 'string', name: '_name', - type: 'string' + type: 'string', }, { internalType: 'string', name: '_symbol', - type: 'string' + type: 'string', }, { internalType: 'uint8', name: '_decimals', - type: 'uint8' - } + type: 'uint8', + }, ], name: 'initialize', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'mint', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -738,73 +737,73 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', - type: 'address' - } + type: 'address', + }, ], name: 'nonces', outputs: [ { internalType: 'uint256', name: 'result', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'owner', - type: 'address' + type: 'address', }, { internalType: 'address', name: 'spender', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'value', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: 'deadline', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint8', name: 'v', - type: 'uint8' + type: 'uint8', }, { internalType: 'bytes32', name: 'r', - type: 'bytes32' + type: 'bytes32', }, { internalType: 'bytes32', name: 's', - type: 'bytes32' - } + type: 'bytes32', + }, ], name: 'permit', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -813,30 +812,30 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'address', name: '', - type: 'address' - } + type: 'address', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'bytes4', name: '_interfaceId', - type: 'bytes4' - } + type: 'bytes4', + }, ], name: 'supportsInterface', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -845,11 +844,11 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -858,64 +857,64 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'uint256', name: 'result', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'transfer', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'transferFrom', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -924,11 +923,11 @@ export const optimismSuperchainERC20Abi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { anonymous: false, @@ -937,23 +936,23 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'owner', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'spender', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Approval', - type: 'event' + type: 'event', }, { anonymous: false, @@ -962,17 +961,17 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Burn', - type: 'event' + type: 'event', }, { anonymous: false, @@ -981,23 +980,23 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'address', name: 'sender', - type: 'address' - } + type: 'address', + }, ], name: 'CrosschainBurn', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1006,23 +1005,23 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'address', name: 'sender', - type: 'address' - } + type: 'address', + }, ], name: 'CrosschainMint', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1031,11 +1030,11 @@ export const optimismSuperchainERC20Abi = [ indexed: false, internalType: 'uint64', name: 'version', - type: 'uint64' - } + type: 'uint64', + }, ], name: 'Initialized', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1044,17 +1043,17 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Mint', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1063,84 +1062,84 @@ export const optimismSuperchainERC20Abi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Transfer', - type: 'event' + type: 'event', }, { inputs: [], name: 'AllowanceOverflow', - type: 'error' + type: 'error', }, { inputs: [], name: 'AllowanceUnderflow', - type: 'error' + type: 'error', }, { inputs: [], name: 'InsufficientAllowance', - type: 'error' + type: 'error', }, { inputs: [], name: 'InsufficientBalance', - type: 'error' + type: 'error', }, { inputs: [], name: 'InvalidInitialization', - type: 'error' + type: 'error', }, { inputs: [], name: 'InvalidPermit', - type: 'error' + type: 'error', }, { inputs: [], name: 'NotInitializing', - type: 'error' + type: 'error', }, { inputs: [], name: 'Permit2AllowanceIsFixedAtInfinity', - type: 'error' + type: 'error', }, { inputs: [], name: 'PermitExpired', - type: 'error' + type: 'error', }, { inputs: [], name: 'TotalSupplyOverflow', - type: 'error' + type: 'error', }, { inputs: [], name: 'Unauthorized', - type: 'error' + type: 'error', }, { inputs: [], name: 'ZeroAddress', - type: 'error' - } + type: 'error', + }, ] as const /** @@ -1150,114 +1149,114 @@ export const optimismSuperchainERC20Abi = [ export const superchainWETHAbi = [ { stateMutability: 'payable', - type: 'fallback' + type: 'fallback', }, { stateMutability: 'payable', - type: 'receive' + type: 'receive', }, { inputs: [ { internalType: 'address', name: 'owner', - type: 'address' + type: 'address', }, { internalType: 'address', name: 'spender', - type: 'address' - } + type: 'address', + }, ], name: 'allowance', outputs: [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'guy', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'approve', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'src', - type: 'address' - } + type: 'address', + }, ], name: 'balanceOf', outputs: [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_from', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'crosschainBurn', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'crosschainMint', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -1266,18 +1265,18 @@ export const superchainWETHAbi = [ { internalType: 'uint8', name: '', - type: 'uint8' - } + type: 'uint8', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], name: 'deposit', outputs: [], stateMutability: 'payable', - type: 'function' + type: 'function', }, { inputs: [], @@ -1286,77 +1285,77 @@ export const superchainWETHAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_from', - type: 'address' + type: 'address', }, { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'relayETH', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_chainId', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'sendETH', outputs: [ { internalType: 'bytes32', name: 'msgHash_', - type: 'bytes32' - } + type: 'bytes32', + }, ], stateMutability: 'payable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'bytes4', name: '_interfaceId', - type: 'bytes4' - } + type: 'bytes4', + }, ], name: 'supportsInterface', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -1365,11 +1364,11 @@ export const superchainWETHAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [], @@ -1378,64 +1377,64 @@ export const superchainWETHAbi = [ { internalType: 'uint256', name: '', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'dst', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'transfer', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: 'src', - type: 'address' + type: 'address', }, { internalType: 'address', name: 'dst', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'transferFrom', outputs: [ { internalType: 'bool', name: '', - type: 'bool' - } + type: 'bool', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -1444,24 +1443,24 @@ export const superchainWETHAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'withdraw', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { anonymous: false, @@ -1470,23 +1469,23 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'src', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'guy', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Approval', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1495,23 +1494,23 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'address', name: 'sender', - type: 'address' - } + type: 'address', + }, ], name: 'CrosschainBurn', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1520,23 +1519,23 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: true, internalType: 'address', name: 'sender', - type: 'address' - } + type: 'address', + }, ], name: 'CrosschainMint', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1545,17 +1544,17 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'dst', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Deposit', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1564,29 +1563,29 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'source', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'RelayETH', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1595,29 +1594,29 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'destination', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'SendETH', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1626,23 +1625,23 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'src', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'dst', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Transfer', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1651,38 +1650,38 @@ export const superchainWETHAbi = [ indexed: true, internalType: 'address', name: 'src', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'wad', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'Withdrawal', - type: 'event' + type: 'event', }, { inputs: [], name: 'InvalidCrossDomainSender', - type: 'error' + type: 'error', }, { inputs: [], name: 'NotCustomGasToken', - type: 'error' + type: 'error', }, { inputs: [], name: 'Unauthorized', - type: 'error' + type: 'error', }, { inputs: [], name: 'ZeroAddress', - type: 'error' - } + type: 'error', + }, ] as const /** @@ -1695,62 +1694,62 @@ export const superchainTokenBridgeAbi = [ { internalType: 'address', name: '_token', - type: 'address' + type: 'address', }, { internalType: 'address', name: '_from', - type: 'address' + type: 'address', }, { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'relayERC20', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [ { internalType: 'address', name: '_token', - type: 'address' + type: 'address', }, { internalType: 'address', name: '_to', - type: 'address' + type: 'address', }, { internalType: 'uint256', name: '_amount', - type: 'uint256' + type: 'uint256', }, { internalType: 'uint256', name: '_chainId', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'sendERC20', outputs: [ { internalType: 'bytes32', name: 'msgHash_', - type: 'bytes32' - } + type: 'bytes32', + }, ], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }, { inputs: [], @@ -1759,11 +1758,11 @@ export const superchainTokenBridgeAbi = [ { internalType: 'string', name: '', - type: 'string' - } + type: 'string', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }, { anonymous: false, @@ -1772,35 +1771,35 @@ export const superchainTokenBridgeAbi = [ indexed: true, internalType: 'address', name: 'token', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'source', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'RelayERC20', - type: 'event' + type: 'event', }, { anonymous: false, @@ -1809,55 +1808,54 @@ export const superchainTokenBridgeAbi = [ indexed: true, internalType: 'address', name: 'token', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'from', - type: 'address' + type: 'address', }, { indexed: true, internalType: 'address', name: 'to', - type: 'address' + type: 'address', }, { indexed: false, internalType: 'uint256', name: 'amount', - type: 'uint256' + type: 'uint256', }, { indexed: false, internalType: 'uint256', name: 'destination', - type: 'uint256' - } + type: 'uint256', + }, ], name: 'SendERC20', - type: 'event' + type: 'event', }, { inputs: [], name: 'InvalidCrossDomainSender', - type: 'error' + type: 'error', }, { inputs: [], name: 'InvalidERC7802', - type: 'error' + type: 'error', }, { inputs: [], name: 'Unauthorized', - type: 'error' + type: 'error', }, { inputs: [], name: 'ZeroAddress', - type: 'error' - } + type: 'error', + }, ] as const - From 9b17bf5b0968eb7783e6e3d11470452d24fcaa39 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 12:15:43 -0500 Subject: [PATCH 06/11] changeset --- .changeset/calm-yaks-join.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/calm-yaks-join.md diff --git a/.changeset/calm-yaks-join.md b/.changeset/calm-yaks-join.md new file mode 100644 index 00000000..baca2d1a --- /dev/null +++ b/.changeset/calm-yaks-join.md @@ -0,0 +1,5 @@ +--- +"@eth-optimism/viem": patch +--- + +abigen script from a submodule dependency on the optimism repo From d7db395093c36c0aabffbb2441bbc99fea870569 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 13:50:39 -0500 Subject: [PATCH 07/11] update imports --- packages/viem/src/actions/crosschainSendETH.ts | 10 +++++----- .../src/actions/depositSuperchainWETH.spec.ts | 6 +++--- .../viem/src/actions/depositSuperchainWETH.ts | 10 +++++----- .../viem/src/actions/relayL2ToL2Message.spec.ts | 4 ++-- packages/viem/src/actions/relayL2ToL2Message.ts | 10 +++++----- .../viem/src/actions/sendL2ToL2Message.spec.ts | 4 ++-- packages/viem/src/actions/sendL2ToL2Message.ts | 10 +++++----- packages/viem/src/actions/sendSupERC20.spec.ts | 6 +++--- packages/viem/src/actions/sendSupERC20.ts | 10 +++++----- .../viem/src/actions/sendSuperchainWETH.spec.ts | 6 +++--- .../src/actions/withdrawSuperchainWETH.spec.ts | 6 +++--- .../viem/src/actions/withdrawSuperchainWETH.ts | 10 +++++----- packages/viem/src/test/e2e/interop.spec.ts | 16 ++++++++-------- packages/viem/src/test/setupTicTacToe.ts | 2 +- packages/viem/src/utils/interop.ts | 4 ++-- .../viem/src/utils/l2ToL2CrossDomainMessenger.ts | 6 +++--- 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/packages/viem/src/actions/crosschainSendETH.ts b/packages/viem/src/actions/crosschainSendETH.ts index c76a327b..72a24633 100644 --- a/packages/viem/src/actions/crosschainSendETH.ts +++ b/packages/viem/src/actions/crosschainSendETH.ts @@ -14,7 +14,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import type { BaseWriteContractActionParameters } from '@/core/baseWriteAction.js' import { baseWriteAction } from '@/core/baseWriteAction.js' @@ -44,7 +44,7 @@ export type CrossChainSendETHParameters< * @category Types */ export type CrossChainSendETHContractReturnType = ContractFunctionReturnType< - typeof superchainWETHABI, + typeof superchainWETHAbi, 'payable', 'sendETH' > @@ -77,7 +77,7 @@ export async function crossChainSendETH< return baseWriteAction( client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, contractAddress: contracts.superchainWETH.address, contractFunctionName: 'sendETH', contractArgs: [to, chainId], @@ -104,7 +104,7 @@ export async function estimateCrossChainSendETHGas< const { to, chainId, ...txParameters } = parameters return estimateContractGas(client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, functionName: 'sendETH', args: [to, chainId], @@ -131,7 +131,7 @@ export async function simulateCrossChainSendETH< const res = await simulateContract(client, { account, - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, chain: client.chain, functionName: 'sendETH', diff --git a/packages/viem/src/actions/depositSuperchainWETH.spec.ts b/packages/viem/src/actions/depositSuperchainWETH.spec.ts index 7284adc9..9c18d309 100644 --- a/packages/viem/src/actions/depositSuperchainWETH.spec.ts +++ b/packages/viem/src/actions/depositSuperchainWETH.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import { publicClientA, testAccount, walletClientA } from '@/test/clients.js' @@ -11,7 +11,7 @@ describe('depositSuperchainWETH', () => { it('should return expected request', async () => { const startingBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -24,7 +24,7 @@ describe('depositSuperchainWETH', () => { const endingBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/depositSuperchainWETH.ts b/packages/viem/src/actions/depositSuperchainWETH.ts index 5cf21eed..e3227aa6 100644 --- a/packages/viem/src/actions/depositSuperchainWETH.ts +++ b/packages/viem/src/actions/depositSuperchainWETH.ts @@ -14,7 +14,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import type { BaseWriteContractActionParameters } from '@/core/baseWriteAction.js' import { baseWriteAction } from '@/core/baseWriteAction.js' @@ -44,7 +44,7 @@ export type DepositSuperchainWETHReturnType = Hash * @category Types */ export type DepositSuperchainWETHContractReturnType = - ContractFunctionReturnType + ContractFunctionReturnType /** * @category Types @@ -72,7 +72,7 @@ export async function depositSuperchainWETH< return baseWriteAction( client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, contractAddress: contracts.superchainWETH.address, contractFunctionName: 'deposit', contractArgs: [], @@ -97,7 +97,7 @@ export async function estimateDepositSuperchainWETHGas< parameters: DepositSuperchainWETHParameters, ): Promise { return estimateContractGas(client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, functionName: 'deposit', args: [], @@ -124,7 +124,7 @@ export async function simulateDepositSuperchainWETH< const res = await simulateContract(client, { account, - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, chain: client.chain, functionName: 'deposit', diff --git a/packages/viem/src/actions/relayL2ToL2Message.spec.ts b/packages/viem/src/actions/relayL2ToL2Message.spec.ts index 39fab174..795149cc 100644 --- a/packages/viem/src/actions/relayL2ToL2Message.spec.ts +++ b/packages/viem/src/actions/relayL2ToL2Message.spec.ts @@ -9,7 +9,7 @@ import { walletClientA, walletClientB, } from '@/test/clients.js' -import { ticTacToeABI, ticTacToeAddress } from '@/test/setupTicTacToe.js' +import { ticTacToeAbi, ticTacToeAddress } from '@/test/setupTicTacToe.js' import { createInteropSentL2ToL2Messages, decodeRelayedL2ToL2Messages, @@ -19,7 +19,7 @@ import { describe('relayL2ToL2Message', () => { const calldata = encodeFunctionData({ - abi: ticTacToeABI, + abi: ticTacToeAbi, functionName: 'createGame', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/relayL2ToL2Message.ts b/packages/viem/src/actions/relayL2ToL2Message.ts index a774a45c..96d9c242 100644 --- a/packages/viem/src/actions/relayL2ToL2Message.ts +++ b/packages/viem/src/actions/relayL2ToL2Message.ts @@ -13,7 +13,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { l2ToL2CrossDomainMessengerABI } from '@/abis.js' +import { l2ToL2CrossDomainMessengerAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import { baseWriteAction, @@ -51,7 +51,7 @@ export type RelayL2ToL2MessageReturnType = Hash * @category Types */ export type RelayL2ToL2MessageContractReturnType = ContractFunctionReturnType< - typeof l2ToL2CrossDomainMessengerABI, + typeof l2ToL2CrossDomainMessengerAbi, 'payable', 'relayMessage' > @@ -84,7 +84,7 @@ export async function relayL2ToL2Message< return baseWriteAction( client, { - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, contractAddress: contracts.l2ToL2CrossDomainMessenger.address, contractFunctionName: 'relayMessage', contractArgs: [sentMessageId, sentMessagePayload], @@ -111,7 +111,7 @@ export async function estimateRelayL2ToL2MessageGas< const { sentMessageId, sentMessagePayload, ...txParameters } = parameters return estimateContractGas(client, { - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, functionName: 'relayMessage', args: [sentMessageId, sentMessagePayload], @@ -138,7 +138,7 @@ export async function simulateRelayL2ToL2Message< const res = await simulateContract(client, { account, - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, chain: client.chain, functionName: 'relayMessage', diff --git a/packages/viem/src/actions/sendL2ToL2Message.spec.ts b/packages/viem/src/actions/sendL2ToL2Message.spec.ts index 5e5d52e5..19f4d4f8 100644 --- a/packages/viem/src/actions/sendL2ToL2Message.spec.ts +++ b/packages/viem/src/actions/sendL2ToL2Message.spec.ts @@ -3,12 +3,12 @@ import { describe, expect, it } from 'vitest' import { supersimL2B } from '@/chains/supersim.js' import { publicClientA, testAccount, walletClientA } from '@/test/clients.js' -import { ticTacToeABI, ticTacToeAddress } from '@/test/setupTicTacToe.js' +import { ticTacToeAbi, ticTacToeAddress } from '@/test/setupTicTacToe.js' import { decodeSentL2ToL2Messages } from '@/utils/l2ToL2CrossDomainMessenger.js' describe('sendL2ToL2Message', () => { const calldata = encodeFunctionData({ - abi: ticTacToeABI, + abi: ticTacToeAbi, functionName: 'createGame', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/sendL2ToL2Message.ts b/packages/viem/src/actions/sendL2ToL2Message.ts index b71c8c40..1640cf49 100644 --- a/packages/viem/src/actions/sendL2ToL2Message.ts +++ b/packages/viem/src/actions/sendL2ToL2Message.ts @@ -16,7 +16,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { l2ToL2CrossDomainMessengerABI } from '@/abis.js' +import { l2ToL2CrossDomainMessengerAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import type { BaseWriteContractActionParameters } from '@/core/baseWriteAction.js' import { baseWriteAction } from '@/core/baseWriteAction.js' @@ -53,7 +53,7 @@ export type SendL2ToL2MessageReturnType = Hash * @category Types */ export type SendL2ToL2MessageContractReturnType = ContractFunctionReturnType< - typeof l2ToL2CrossDomainMessengerABI, + typeof l2ToL2CrossDomainMessengerAbi, 'nonpayable', 'sendMessage' > @@ -86,7 +86,7 @@ export async function sendL2ToL2Message< return baseWriteAction( client, { - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, contractAddress: contracts.l2ToL2CrossDomainMessenger.address, contractFunctionName: 'sendMessage', contractArgs: [destinationChainId, target, message], @@ -113,7 +113,7 @@ export async function estimateSendL2ToL2MessageGas< const { destinationChainId, target, message, ...txParameters } = parameters return estimateContractGas(client, { - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, functionName: 'sendMessage', args: [destinationChainId, target, message], @@ -140,7 +140,7 @@ export async function simulateSendL2ToL2Message< const res = await simulateContract(client, { account, - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, chain: client.chain, functionName: 'sendMessage', diff --git a/packages/viem/src/actions/sendSupERC20.spec.ts b/packages/viem/src/actions/sendSupERC20.spec.ts index 9512dc72..45aef5bf 100644 --- a/packages/viem/src/actions/sendSupERC20.spec.ts +++ b/packages/viem/src/actions/sendSupERC20.spec.ts @@ -6,7 +6,7 @@ import { publicClientA, testAccount, walletClientA } from '@/test/clients.js' import { SUPERSIM_SUPERC20_ADDRESS } from '@/test/supERC20.js' import { createInteropSentL2ToL2Messages } from '@/utils/l2ToL2CrossDomainMessenger.js' -const balanceOfABI = parseAbi([ +const balanceOfAbi = parseAbi([ 'function balanceOf(address account) view returns (uint256)', ]) @@ -28,7 +28,7 @@ describe('sendSupERC20', () => { it('should return expected request', async () => { const startingBalance = await publicClientA.readContract({ address: SUPERSIM_SUPERC20_ADDRESS, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -50,7 +50,7 @@ describe('sendSupERC20', () => { const endingBalance = await publicClientA.readContract({ address: SUPERSIM_SUPERC20_ADDRESS, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/sendSupERC20.ts b/packages/viem/src/actions/sendSupERC20.ts index 2a3db8b0..bf46b76c 100644 --- a/packages/viem/src/actions/sendSupERC20.ts +++ b/packages/viem/src/actions/sendSupERC20.ts @@ -15,7 +15,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { superchainTokenBridgeABI } from '@/abis.js' +import { superchainTokenBridgeAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import type { BaseWriteContractActionParameters } from '@/core/baseWriteAction.js' import { baseWriteAction } from '@/core/baseWriteAction.js' @@ -54,7 +54,7 @@ export type SendSupERC20ReturnType = Hash * @category Types */ export type SendSupERC20ContractReturnType = ContractFunctionReturnType< - typeof superchainTokenBridgeABI, + typeof superchainTokenBridgeAbi, 'nonpayable', 'sendERC20' > @@ -87,7 +87,7 @@ export async function sendSupERC20< return baseWriteAction( client, { - abi: superchainTokenBridgeABI, + abi: superchainTokenBridgeAbi, contractAddress: contracts.superchainTokenBridge.address, contractFunctionName: 'sendERC20', contractArgs: [tokenAddress, to, amount, BigInt(chainId)], @@ -114,7 +114,7 @@ export async function estimateSendSupERC20Gas< const { tokenAddress, to, amount, chainId, ...txParameters } = parameters return estimateContractGas(client, { - abi: superchainTokenBridgeABI, + abi: superchainTokenBridgeAbi, address: contracts.superchainTokenBridge.address, functionName: 'sendERC20', args: [tokenAddress, to, amount, BigInt(chainId)], @@ -141,7 +141,7 @@ export async function simulateSendSupERC20< const res = await simulateContract(client, { account, - abi: superchainTokenBridgeABI, + abi: superchainTokenBridgeAbi, address: contracts.superchainTokenBridge.address, chain: client.chain, functionName: 'sendERC20', diff --git a/packages/viem/src/actions/sendSuperchainWETH.spec.ts b/packages/viem/src/actions/sendSuperchainWETH.spec.ts index 4d8efab7..8d157e7e 100644 --- a/packages/viem/src/actions/sendSuperchainWETH.spec.ts +++ b/packages/viem/src/actions/sendSuperchainWETH.spec.ts @@ -6,7 +6,7 @@ import { contracts } from '@/contracts.js' import { publicClientA, testAccount, walletClientA } from '@/test/clients.js' import { createInteropSentL2ToL2Messages } from '@/utils/l2ToL2CrossDomainMessenger.js' -const balanceOfABI = parseAbi([ +const balanceOfAbi = parseAbi([ 'function balanceOf(address account) view returns (uint256)', ]) @@ -25,7 +25,7 @@ describe('sendSuperchainWETH', () => { it('should return expected request', async () => { const startingBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -46,7 +46,7 @@ describe('sendSuperchainWETH', () => { const endingBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/withdrawSuperchainWETH.spec.ts b/packages/viem/src/actions/withdrawSuperchainWETH.spec.ts index b1d10815..f04b61c5 100644 --- a/packages/viem/src/actions/withdrawSuperchainWETH.spec.ts +++ b/packages/viem/src/actions/withdrawSuperchainWETH.spec.ts @@ -1,6 +1,6 @@ import { beforeAll, describe, expect, it } from 'vitest' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import { publicClientA, testAccount, walletClientA } from '@/test/clients.js' import { SUPERSIM_SUPERC20_ADDRESS } from '@/test/supERC20.js' @@ -20,7 +20,7 @@ describe('withdrawSuperchainWETH', () => { it('should return expected request', async () => { const startingSuperchainWETHBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -35,7 +35,7 @@ describe('withdrawSuperchainWETH', () => { const endingSuperchainWETHBalance = await publicClientA.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) diff --git a/packages/viem/src/actions/withdrawSuperchainWETH.ts b/packages/viem/src/actions/withdrawSuperchainWETH.ts index 8022c404..ce7979b6 100644 --- a/packages/viem/src/actions/withdrawSuperchainWETH.ts +++ b/packages/viem/src/actions/withdrawSuperchainWETH.ts @@ -14,7 +14,7 @@ import type { } from 'viem' import { estimateContractGas, simulateContract } from 'viem/actions' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { contracts } from '@/contracts.js' import type { BaseWriteContractActionParameters } from '@/core/baseWriteAction.js' import { baseWriteAction } from '@/core/baseWriteAction.js' @@ -47,7 +47,7 @@ export type WithdrawSuperchainWETHReturnType = Hash * @category Types */ export type WithdrawSuperchainWETHContractReturnType = - ContractFunctionReturnType + ContractFunctionReturnType /** * @category Types @@ -77,7 +77,7 @@ export async function withdrawSuperchainWETH< return baseWriteAction( client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, contractAddress: contracts.superchainWETH.address, contractFunctionName: 'withdraw', contractArgs: [amount], @@ -108,7 +108,7 @@ export async function estimateWithdrawSuperchainWETHGas< const { amount, ...txParameters } = parameters return estimateContractGas(client, { - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, functionName: 'withdraw', args: [amount], @@ -139,7 +139,7 @@ export async function simulateWithdrawSuperchainWETH< const res = await simulateContract(client, { account, - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, chain: client.chain, functionName: 'withdraw', diff --git a/packages/viem/src/test/e2e/interop.spec.ts b/packages/viem/src/test/e2e/interop.spec.ts index bb768a55..e594207e 100644 --- a/packages/viem/src/test/e2e/interop.spec.ts +++ b/packages/viem/src/test/e2e/interop.spec.ts @@ -1,7 +1,7 @@ import { encodeFunctionData, parseAbi } from 'viem' import { beforeAll, describe, expect, it } from 'vitest' -import { superchainWETHABI } from '@/abis.js' +import { superchainWETHAbi } from '@/abis.js' import { supersimL2B } from '@/chains/supersim.js' import { contracts } from '@/contracts.js' import { @@ -11,7 +11,7 @@ import { walletClientA, walletClientB, } from '@/test/clients.js' -import { ticTacToeABI, ticTacToeAddress } from '@/test/setupTicTacToe.js' +import { ticTacToeAbi, ticTacToeAddress } from '@/test/setupTicTacToe.js' import { createInteropSentL2ToL2Messages, decodeRelayedL2ToL2Messages, @@ -21,7 +21,7 @@ import { SUPERSIM_SUPERC20_ADDRESS } from '../supERC20.js' describe('Generic Interop Flow', () => { const calldata = encodeFunctionData({ - abi: ticTacToeABI, + abi: ticTacToeAbi, functionName: 'createGame', args: [testAccount.address], }) @@ -61,7 +61,7 @@ describe('Generic Interop Flow', () => { }) describe('SuperchainERC20 Flow', () => { - const balanceOfABI = parseAbi([ + const balanceOfAbi = parseAbi([ 'function balanceOf(address account) view returns (uint256)', ]) @@ -79,7 +79,7 @@ describe('SuperchainERC20 Flow', () => { it('should send supERC20 and relay cross chain message to burn/mint tokens', async () => { const startingBalance = await publicClientB.readContract({ address: SUPERSIM_SUPERC20_ADDRESS, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -116,7 +116,7 @@ describe('SuperchainERC20 Flow', () => { const endingBalance = await publicClientB.readContract({ address: SUPERSIM_SUPERC20_ADDRESS, - abi: balanceOfABI, + abi: balanceOfAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -139,7 +139,7 @@ describe('SuperchainWETH Flow', () => { it('should send SuperchainWETH and relay cross chain message to burn/mint tokens', async () => { const startingWETHBalance = await publicClientB.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) @@ -175,7 +175,7 @@ describe('SuperchainWETH Flow', () => { const endingWETHBalance = await publicClientB.readContract({ address: contracts.superchainWETH.address, - abi: superchainWETHABI, + abi: superchainWETHAbi, functionName: 'balanceOf', args: [testAccount.address], }) diff --git a/packages/viem/src/test/setupTicTacToe.ts b/packages/viem/src/test/setupTicTacToe.ts index 287fc283..271c014a 100644 --- a/packages/viem/src/test/setupTicTacToe.ts +++ b/packages/viem/src/test/setupTicTacToe.ts @@ -5,7 +5,7 @@ export const ticTacToeAddress = '0x057ef64E23666F000b34aE31332854aCBd1c8544' export const ticTacToeBytecode = '0x608060405234801561001057600080fd5b50600436106100625760003560e01c80630e84706214610067578063117a5b901461008f578063474d0b5a146100fc578063a2f77bcc1461011d578063cd7628271461013d578063f27cfb6914610150575b600080fd5b61007a610075366004611071565b610163565b60405190151581526020015b60405180910390f35b6100ea61009d36600461109b565b600160208190526000918252604090912080549181015460029091015460ff808316926001600160a01b0361010090910481169290811691600160a01b8204811691600160a81b90041686565b604051610086969594939291906110ee565b61010f61010a36600461113a565b6105fd565b604051908152602001610086565b61013061012b36600461109b565b6107db565b604051610086919061115c565b61007a61014b366004611071565b610928565b61007a61015e366004611234565b610a8c565b6000816000548111156101915760405162461bcd60e51b815260040161018890611281565b60405180910390fd5b6000838152600160208190526040909120908101546001600160a01b038681166101009092041614806101d3575060028101546001600160a01b038681169116145b61021f5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420612076616c696420706c6179657220696e207468652067616d6500006044820152606401610188565b60018101546000906001600160a01b03878116610100909204161461024557601e610248565b600f5b905060005b60038160ff1610156104d557600060028260ff1660038110610271576102716112aa565b015460ff620100009091048116906003808701918516908110610296576102966112aa565b01546102ab919062010000900460ff166112d6565b60028360ff16600381106102c1576102c16112aa565b015460ff61010090910481169060038088019186169081106102e5576102e56112aa565b01546102f99190610100900460ff166112d6565b60028460ff166003811061030f5761030f6112aa565b015460ff90811690600380890191871690811061032e5761032e6112aa565b015461033d919060ff166112d6565b61034791906112f2565b61035191906112f2565b90506000600460ff84166003811061036b5761036b6112aa565b602081049091015460ff601f9092166101000a900416600386016002018460ff166003811061039c5761039c6112aa565b602091828204019190069054906101000a900460ff166103bc91906112d6565b600360ff85168181106103d1576103d16112aa565b602081049091015460ff601f9092166101000a900416600387016001018560ff1660038110610402576104026112aa565b602091828204019190069054906101000a900460ff1661042291906112d6565b600260ff861660038110610438576104386112aa565b602081049091015460ff601f9092166101000a900416600388016000018660ff1660038110610469576104696112aa565b602091828204019190069054906101000a900460ff1661048991906112d6565b61049391906112f2565b61049d91906112f2565b90508360ff168260ff1614806104b857508360ff168160ff16145b156104cb576001965050505050506105f6565b505060010161024d565b5060045460058301546000916104fb9160ff6201000092839004811692909104166112d6565b600354600485015461051d9160ff6101009182900481169291909104166112d6565b60025460038601546105359160ff90811691166112d6565b61053f91906112f2565b61054991906112f2565b60045460058501549192506000916105679160ff90811691166112d6565b60035460048601546105899160ff6101009182900481169291909104166112d6565b60025460038701546105ac9160ff620100009182900481169291909104166112d6565b6105b691906112f2565b6105c091906112f2565b90508260ff168260ff1614806105db57508260ff168160ff16145b156105ed5760019550505050506105f6565b60009550505050505b5092915050565b60008054818061060c83611311565b90915550506040805160e0810182526000805480835260208084018381526001600160a01b038816858701526060808601859052608080870186905260a0808801879052885160c08082018b5281850189815293820189905291810188905291825288518084018a52878152808601889052808a0188905282860152885192830189528683528285018790528289018790528189019290925290860152918352600190819052939091208251815590518184018054939492939192909160ff1916908360048111156106e0576106e06110b4565b02179055506040820151600180830180546001600160a01b0393841661010002610100600160a81b03199091161790556060840151600284018054919093166001600160a01b0319821681178455608086015193926001600160a81b03199092161790600160a01b90849081111561075a5761075a6110b4565b021790555060a082015160028201805460ff909216600160a81b0260ff60a81b1990921691909117905560c08201516107999060038084019190610ec3565b5050600080546040516001600160a01b038616935090917fc3e0f84839dc888c892a013d10c8f9d6dc05a21a879d0ce468ca558013e9121c91a3505060005490565b6107e3610f0d565b600082815260016020818152604092839020835160e0810190945280548452918201549083019060ff16600481111561081e5761081e6110b4565b600481111561082f5761082f6110b4565b815260018281015461010090046001600160a01b03908116602084015260028401549081166040840152606090920191600160a01b900460ff1690811115610879576108796110b4565b600181111561088a5761088a6110b4565b81526002820154600160a81b900460ff166020820152604080516060810182529101906003808401906000835b8282101561091a576040805160608101918290529085840190600390826000855b825461010083900a900460ff168152602060019283018181049485019490930390920291018084116108d85790505050505050815260200190600101906108b7565b505050915250909392505050565b60008160005481111561094d5760405162461bcd60e51b815260040161018890611281565b600083815260016020526040812090600182015460ff166004811115610975576109756110b4565b146109c25760405162461bcd60e51b815260206004820152601f60248201527f47616d6520616c72656164792068617320656e6f75676820706c6179657273006044820152606401610188565b60018101546001600160a01b038087166101009092041603610a265760405162461bcd60e51b815260206004820152601960248201527f506c6179657273206d75737420626520646966666572656e74000000000000006044820152606401610188565b6002810180546001600160a01b0319166001600160a01b0387169081179091556001808301805460ff1916909117905581546040517fe52d81459d9994c73740ea14247d27531f0f00be7c54bc1b8b759df2feda9fe790600090a3506001949350505050565b600083600054811115610ab15760405162461bcd60e51b815260040161018890611281565b600085815260016020819052604090912090600182015460ff166004811115610adc57610adc6110b4565b14610b435760405162461bcd60e51b815260206004820152603160248201527f47616d65206861736e27742073746172746564206f722068617320616c726561604482015270191e481899595b8818dbdb5c1b195d1959607a1b6064820152608401610188565b6000806002830154600160a01b900460ff166001811115610b6657610b666110b4565b14905080610b865760028201546001600160a01b03898116911614610b9f565b60018201546001600160a01b0389811661010090920416145b610beb5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420612076616c696420706c6179657220696e207468652067616d6500006044820152606401610188565b60028660ff16111580610c02575060028560ff1611155b610c435760405162461bcd60e51b81526020600482015260126024820152714d6f7665206f7574206f6620626f756e647360701b6044820152606401610188565b816003018660ff1660038110610c5b57610c5b6112aa565b018560ff1660038110610c7057610c706112aa565b602081049091015460ff601f9092166101000a90041615610cc25760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206d6f766560a01b6044820152606401610188565b80610cce576002610cd1565b60015b826003018760ff1660038110610ce957610ce96112aa565b018660ff1660038110610cfe57610cfe6112aa565b602091828204019190066101000a81548160ff021916908360ff16021790555080610d2a576000610d2d565b60015b60028301805460ff60a01b1916600160a01b836001811115610d5157610d516110b4565b0217905550600282018054600160a81b900460ff16906015610d728361132a565b91906101000a81548160ff021916908360ff1602179055505081600001547f0bee9c3b3b392e4e69b46cf21e397190b585b0ce4bd26eca0d752fe1536d66e88787604051610dd092919060ff92831681529116602082015260400190565b60405180910390a26000610de8898460000154610163565b90508015610e625781610dfc576004610dff565b60035b60018085018054909160ff1990911690836004811115610e2157610e216110b4565b021790555082546040516001600160a01b038b1691907f66a510f95625276cd762265aa3b18dca38765e7ea0a5f047aae0db64bb5caf5f90600090a3610eb4565b60028301546009600160a81b90910460ff1610610eb45760018301805460ff1916600217905582546040517f7100df8a0f152e72c848c10d7b88142c09ee0f3d2df2be5ea52949d5b7e6466b90600090a25b50600198975050505050505050565b8260038101928215610efd579160200282015b82811115610efd578251610eed9083906003610f53565b5091602001919060010190610ed6565b50610f09929150610fe2565b5090565b6040805160e0810190915260008082526020820190815260006020820181905260408201819052606090910190815260006020820152604001610f4e610ff6565b905290565b600183019183908215610fd65791602002820160005b83821115610fa757835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302610f69565b8015610fd45782816101000a81549060ff0219169055600101602081600001049283019260010302610fa7565b505b50610f09929150611023565b80821115610f095760008155600101610fe2565b60405180606001604052806003905b61100d611037565b8152602001906001900390816110055790505090565b80821115610f095760008155600101610fe2565b60405180606001604052806003906020820280368337509192915050565b80356001600160a01b038116811461106c57600080fd5b919050565b6000806040838503121561108457600080fd5b61108d83611055565b946020939093013593505050565b6000602082840312156110ad57600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b600581106110da576110da6110b4565b9052565b600281106110da576110da6110b4565b86815260c0810161110260208301886110ca565b6001600160a01b0386811660408401528516606083015261112660808301856110de565b60ff831660a0830152979650505050505050565b60006020828403121561114c57600080fd5b61115582611055565b9392505050565b815181526020808301516101e083019190611179828501826110ca565b50604084015160018060a01b038082166040860152606091508060608701511660608601525060808501516111b160808601826110de565b5060a085015160ff80821660a087015260c0870151915060c086016000805b60038082106111df5750611216565b855184845b8381101561120257825188168252918a0191908a01906001016111e4565b5050509487019450918501916001016111d0565b5050505050505092915050565b803560ff8116811461106c57600080fd5b6000806000806080858703121561124a57600080fd5b61125385611055565b93506020850135925061126860408601611223565b915061127660608601611223565b905092959194509250565b6020808252600f908201526e125b9d985b1a590819d85b59481a59608a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff81811683821602908116908181146105f6576105f66112c0565b60ff818116838216019081111561130b5761130b6112c0565b92915050565b600060018201611323576113236112c0565b5060010190565b600060ff821660ff8103611340576113406112c0565b6001019291505056fea2646970667358221220a1f96433f21bb7ce1757003b36b6b4a9cebc469ec97c29efdbc739b5f243d68064736f6c63430008190033' -export const ticTacToeABI = [ +export const ticTacToeAbi = [ { type: 'function', name: 'checkForWin', diff --git a/packages/viem/src/utils/interop.ts b/packages/viem/src/utils/interop.ts index cb90f74f..b82720c6 100644 --- a/packages/viem/src/utils/interop.ts +++ b/packages/viem/src/utils/interop.ts @@ -9,7 +9,7 @@ import type { } from 'viem' import { concat, parseEventLogs } from 'viem' -import { crossL2InboxABI } from '@/abis.js' +import { crossL2InboxAbi } from '@/abis.js' import type { MessageIdentifier, MessagePayload } from '@/types/interop.js' export type CreateInteropMessageParameters = { log: Log } @@ -67,7 +67,7 @@ export function decodeExecutingMessages( params: DecodeExecutingMessagesParameters, ): DecodeExecutingMessagesReturnType { const logs = parseEventLogs({ - abi: crossL2InboxABI, + abi: crossL2InboxAbi, eventName: 'ExecutingMessage', logs: params.receipt.logs, }) diff --git a/packages/viem/src/utils/l2ToL2CrossDomainMessenger.ts b/packages/viem/src/utils/l2ToL2CrossDomainMessenger.ts index 3fe4def9..c12dd81a 100644 --- a/packages/viem/src/utils/l2ToL2CrossDomainMessenger.ts +++ b/packages/viem/src/utils/l2ToL2CrossDomainMessenger.ts @@ -17,7 +17,7 @@ import { toHex, } from 'viem' -import { l2ToL2CrossDomainMessengerABI } from '@/abis.js' +import { l2ToL2CrossDomainMessengerAbi } from '@/abis.js' import type { MessageIdentifier, MessagePayload } from '@/types/interop.js' import { createInteropMessage } from '@/utils/interop.js' @@ -86,7 +86,7 @@ export function decodeSentL2ToL2Messages( params: DecodeSentL2ToL2MessagesParameters, ): DecodeSentL2ToL2MessagesReturnType { const sentMessages = parseEventLogs({ - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, eventName: 'SentMessage', logs: params.receipt.logs, }) @@ -108,7 +108,7 @@ export function decodeRelayedL2ToL2Messages( ): DecodeRelayedL2ToL2MessagesReturnType { const RelayedMessageEventName = 'RelayedMessage' const relayedMessages = parseEventLogs({ - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, eventName: [RelayedMessageEventName], logs: params.receipt.logs, strict: true, From ea4f1c56a87aabd1f457cb5eb5fbb4f88b9c2956 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 18:02:13 -0500 Subject: [PATCH 08/11] gen abi from forge artifacts --- package.json | 3 +- packages/viem/scripts/abigen.ts | 33 +- packages/viem/src/abis.ts | 1060 +++++++++++++------------------ 3 files changed, 479 insertions(+), 617 deletions(-) diff --git a/package.json b/package.json index 0c48d819..e16b4394 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "create:app": "cd apps && pnpm create vite --template=react-ts ", "create:react:library": "cd packages && pnpm create vite --template=react-ts ", "release:publish": "pnpm install --frozen-lockfile && pnpm nx run-many --target=build && changeset publish", - "release:version": "changeset version && pnpm install --lockfile-only", - "fetch:artifacts": "bash ./scripts/pull-contract-artifacts.sh" + "release:version": "changeset version && pnpm install --lockfile-only" }, "private": true, "devDependencies": { diff --git a/packages/viem/scripts/abigen.ts b/packages/viem/scripts/abigen.ts index 08f79f67..b15a30b2 100644 --- a/packages/viem/scripts/abigen.ts +++ b/packages/viem/scripts/abigen.ts @@ -1,20 +1,14 @@ +import { execSync } from 'child_process' import { Eta } from 'eta' import fs from 'fs' import path from 'path' // Hardcoded. Can take a more elaborate approach if needed. const OPTIMISM_PATH = path.join('..', '..', 'lib', 'optimism') -const ABI_SNAPSHOTS_PATH = path.join( - OPTIMISM_PATH, - 'packages', - 'contracts-bedrock', - 'snapshots', - 'abi', -) const CONTRACTS = [ 'CrossL2Inbox', 'L2ToL2CrossDomainMessenger', - 'OptimismSuperchainERC20', + 'SuperchainERC20', 'SuperchainWETH', 'SuperchainTokenBridge', ] @@ -29,7 +23,19 @@ function camelCase(str: string): string { /** Abi Generation */ async function main() { - console.log('Running Abi generation...') + console.log('Generating forge artifacts...') + const contractsBedrockPath = path.join( + OPTIMISM_PATH, + 'packages', + 'contracts-bedrock', + ) + try { + execSync('forge build', { cwd: contractsBedrockPath, stdio: 'inherit' }) + } catch (error) { + throw new Error(`Failed to generate forge artifacts: ${error}`) + } + + console.log('Extracting abi generation...') const eta = new Eta({ views: './scripts/templates', debug: true, @@ -38,8 +44,13 @@ async function main() { const contracts = CONTRACTS.map((contract) => { console.log(`Generating Abi for ${contract}`) - const abiPath = path.join(ABI_SNAPSHOTS_PATH, `${contract}.json`) - const abi = JSON.parse(fs.readFileSync(abiPath, 'utf8')) + const abiPath = path.join( + contractsBedrockPath, + 'forge-artifacts', + `${contract}.sol`, + `${contract}.json`, + ) + const abi = JSON.parse(fs.readFileSync(abiPath, 'utf8')).abi return { name: contract, exportName: camelCase(contract), abi } }) diff --git a/packages/viem/src/abis.ts b/packages/viem/src/abis.ts index bf8bbf7a..fbd7dd32 100644 --- a/packages/viem/src/abis.ts +++ b/packages/viem/src/abis.ts @@ -6,218 +6,218 @@ */ export const crossL2InboxAbi = [ { - inputs: [], + type: 'function', name: 'blockNumber', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'chainId', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'interopStart', + inputs: [], outputs: [ { - internalType: 'uint256', name: 'interopStart_', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'logIndex', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'origin', + inputs: [], outputs: [ { - internalType: 'address', name: '', type: 'address', + internalType: 'address', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'setInteropStart', + inputs: [], outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'timestamp', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'validateMessage', inputs: [ { + name: '_id', + type: 'tuple', + internalType: 'struct Identifier', components: [ { - internalType: 'address', name: 'origin', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'blockNumber', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'logIndex', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'timestamp', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'chainId', type: 'uint256', + internalType: 'uint256', }, ], - internalType: 'struct Identifier', - name: '_id', - type: 'tuple', }, { - internalType: 'bytes32', name: '_msgHash', type: 'bytes32', + internalType: 'bytes32', }, ], - name: 'validateMessage', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'version', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - anonymous: false, + type: 'event', + name: 'ExecutingMessage', inputs: [ { - indexed: true, - internalType: 'bytes32', name: 'msgHash', type: 'bytes32', + indexed: true, + internalType: 'bytes32', }, { + name: 'id', + type: 'tuple', + indexed: false, + internalType: 'struct Identifier', components: [ { - internalType: 'address', name: 'origin', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'blockNumber', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'logIndex', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'timestamp', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'chainId', type: 'uint256', + internalType: 'uint256', }, ], - indexed: false, - internalType: 'struct Identifier', - name: 'id', - type: 'tuple', }, ], - name: 'ExecutingMessage', - type: 'event', + anonymous: false, }, { - inputs: [], - name: 'InteropStartAlreadySet', type: 'error', + name: 'InteropStartAlreadySet', + inputs: [], }, { - inputs: [], - name: 'NoExecutingDeposits', type: 'error', + name: 'NoExecutingDeposits', + inputs: [], }, { - inputs: [], - name: 'NotDepositor', type: 'error', + name: 'NotDepositor', + inputs: [], }, { - inputs: [], - name: 'NotEntered', type: 'error', + name: 'NotEntered', + inputs: [], }, { - inputs: [], - name: 'ReentrantCall', type: 'error', + name: 'ReentrantCall', + inputs: [], }, ] as const @@ -227,918 +227,770 @@ export const crossL2InboxAbi = [ */ export const l2ToL2CrossDomainMessengerAbi = [ { - inputs: [], + type: 'function', name: 'crossDomainMessageContext', + inputs: [], outputs: [ { - internalType: 'address', name: 'sender_', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'source_', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'crossDomainMessageSender', + inputs: [], outputs: [ { - internalType: 'address', name: 'sender_', type: 'address', + internalType: 'address', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'crossDomainMessageSource', + inputs: [], outputs: [ { - internalType: 'uint256', name: 'source_', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'messageNonce', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'messageVersion', + inputs: [], outputs: [ { - internalType: 'uint16', name: '', type: 'uint16', + internalType: 'uint16', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'relayMessage', inputs: [ { + name: '_id', + type: 'tuple', + internalType: 'struct Identifier', components: [ { - internalType: 'address', name: 'origin', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'blockNumber', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'logIndex', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'timestamp', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'chainId', type: 'uint256', + internalType: 'uint256', }, ], - internalType: 'struct Identifier', - name: '_id', - type: 'tuple', }, { - internalType: 'bytes', name: '_sentMessage', type: 'bytes', + internalType: 'bytes', }, ], - name: 'relayMessage', outputs: [ { - internalType: 'bytes', name: 'returnData_', type: 'bytes', + internalType: 'bytes', }, ], stateMutability: 'payable', - type: 'function', }, { + type: 'function', + name: 'sendMessage', inputs: [ { - internalType: 'uint256', name: '_destination', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'address', name: '_target', type: 'address', + internalType: 'address', }, { - internalType: 'bytes', name: '_message', type: 'bytes', + internalType: 'bytes', }, ], - name: 'sendMessage', outputs: [ { - internalType: 'bytes32', name: '', type: 'bytes32', + internalType: 'bytes32', }, ], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'successfulMessages', inputs: [ { - internalType: 'bytes32', name: '', type: 'bytes32', + internalType: 'bytes32', }, ], - name: 'successfulMessages', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'version', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - anonymous: false, + type: 'event', + name: 'RelayedMessage', inputs: [ { - indexed: true, - internalType: 'uint256', name: 'source', type: 'uint256', - }, - { indexed: true, internalType: 'uint256', + }, + { name: 'messageNonce', type: 'uint256', + indexed: true, + internalType: 'uint256', }, { - indexed: true, - internalType: 'bytes32', name: 'messageHash', type: 'bytes32', + indexed: true, + internalType: 'bytes32', }, ], - name: 'RelayedMessage', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'SentMessage', inputs: [ { - indexed: true, - internalType: 'uint256', name: 'destination', type: 'uint256', + indexed: true, + internalType: 'uint256', }, { - indexed: true, - internalType: 'address', name: 'target', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: true, - internalType: 'uint256', name: 'messageNonce', type: 'uint256', + indexed: true, + internalType: 'uint256', }, { - indexed: false, - internalType: 'address', name: 'sender', type: 'address', + indexed: false, + internalType: 'address', }, { - indexed: false, - internalType: 'bytes', name: 'message', type: 'bytes', + indexed: false, + internalType: 'bytes', }, ], - name: 'SentMessage', - type: 'event', + anonymous: false, }, { - inputs: [], - name: 'EventPayloadNotSentMessage', type: 'error', + name: 'EventPayloadNotSentMessage', + inputs: [], }, { - inputs: [], - name: 'IdOriginNotL2ToL2CrossDomainMessenger', type: 'error', + name: 'IdOriginNotL2ToL2CrossDomainMessenger', + inputs: [], }, { - inputs: [], - name: 'InvalidChainId', type: 'error', + name: 'InvalidChainId', + inputs: [], }, { - inputs: [], - name: 'MessageAlreadyRelayed', type: 'error', + name: 'MessageAlreadyRelayed', + inputs: [], }, { - inputs: [], - name: 'MessageDestinationNotRelayChain', type: 'error', + name: 'MessageDestinationNotRelayChain', + inputs: [], }, { - inputs: [], - name: 'MessageDestinationSameChain', type: 'error', + name: 'MessageDestinationSameChain', + inputs: [], }, { - inputs: [], - name: 'MessageTargetCrossL2Inbox', type: 'error', + name: 'MessageTargetCrossL2Inbox', + inputs: [], }, { - inputs: [], - name: 'MessageTargetL2ToL2CrossDomainMessenger', type: 'error', + name: 'MessageTargetL2ToL2CrossDomainMessenger', + inputs: [], }, { - inputs: [], - name: 'NotEntered', type: 'error', + name: 'NotEntered', + inputs: [], }, { - inputs: [], - name: 'ReentrantCall', type: 'error', + name: 'ReentrantCall', + inputs: [], }, { - inputs: [], - name: 'TargetCallFailed', type: 'error', + name: 'TargetCallFailed', + inputs: [], }, ] as const /** - * ABI for the OP Stack contract `OptimismSuperchainERC20` + * ABI for the OP Stack contract `SuperchainERC20` * @category ABI */ -export const optimismSuperchainERC20Abi = [ - { - inputs: [], - stateMutability: 'nonpayable', - type: 'constructor', - }, +export const superchainERC20Abi = [ { - inputs: [], + type: 'function', name: 'DOMAIN_SEPARATOR', + inputs: [], outputs: [ { - internalType: 'bytes32', name: 'result', type: 'bytes32', + internalType: 'bytes32', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'allowance', inputs: [ { - internalType: 'address', name: 'owner', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'spender', type: 'address', + internalType: 'address', }, ], - name: 'allowance', outputs: [ { - internalType: 'uint256', name: 'result', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'approve', inputs: [ { - internalType: 'address', name: 'spender', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'approve', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'balanceOf', inputs: [ { - internalType: 'address', name: 'owner', type: 'address', + internalType: 'address', }, ], - name: 'balanceOf', outputs: [ { - internalType: 'uint256', name: 'result', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [ - { - internalType: 'address', - name: '_from', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', type: 'function', - }, - { + name: 'crosschainBurn', inputs: [ { - internalType: 'address', name: '_from', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'crosschainBurn', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'crosschainMint', inputs: [ { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'crosschainMint', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'decimals', + inputs: [], outputs: [ { - internalType: 'uint8', name: '', type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_remoteToken', - type: 'address', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - { internalType: 'uint8', - name: '_decimals', - type: 'uint8', }, ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', + stateMutability: 'view', }, { - inputs: [ - { - internalType: 'address', - name: '_to', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', type: 'function', - }, - { - inputs: [], name: 'name', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'nonces', inputs: [ { - internalType: 'address', name: 'owner', type: 'address', + internalType: 'address', }, ], - name: 'nonces', outputs: [ { - internalType: 'uint256', name: 'result', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'permit', inputs: [ { - internalType: 'address', name: 'owner', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'spender', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'value', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: 'deadline', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint8', name: 'v', type: 'uint8', + internalType: 'uint8', }, { - internalType: 'bytes32', name: 'r', type: 'bytes32', + internalType: 'bytes32', }, { - internalType: 'bytes32', name: 's', type: 'bytes32', + internalType: 'bytes32', }, ], - name: 'permit', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], - name: 'remoteToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', type: 'function', - }, - { + name: 'supportsInterface', inputs: [ { - internalType: 'bytes4', name: '_interfaceId', type: 'bytes4', + internalType: 'bytes4', }, ], - name: 'supportsInterface', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'symbol', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'totalSupply', + inputs: [], outputs: [ { - internalType: 'uint256', name: 'result', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'transfer', inputs: [ { - internalType: 'address', name: 'to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'transfer', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'transferFrom', inputs: [ { - internalType: 'address', name: 'from', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'transferFrom', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'version', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - anonymous: false, + type: 'event', + name: 'Approval', inputs: [ { - indexed: true, - internalType: 'address', name: 'owner', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'spender', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Approval', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'CrosschainBurn', inputs: [ { - indexed: true, - internalType: 'address', name: 'from', type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Burn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', - name: 'from', - type: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, { - indexed: true, - internalType: 'address', name: 'sender', type: 'address', + indexed: true, + internalType: 'address', }, ], - name: 'CrosschainBurn', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'CrosschainMint', inputs: [ { - indexed: true, - internalType: 'address', name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, { - indexed: true, - internalType: 'address', name: 'sender', type: 'address', - }, - ], - name: 'CrosschainMint', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint64', - name: 'version', - type: 'uint64', - }, - ], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', }, ], - name: 'Mint', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'Transfer', inputs: [ { - indexed: true, - internalType: 'address', name: 'from', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Transfer', - type: 'event', + anonymous: false, }, { - inputs: [], - name: 'AllowanceOverflow', type: 'error', - }, - { + name: 'AllowanceOverflow', inputs: [], - name: 'AllowanceUnderflow', - type: 'error', }, { - inputs: [], - name: 'InsufficientAllowance', type: 'error', - }, - { + name: 'AllowanceUnderflow', inputs: [], - name: 'InsufficientBalance', - type: 'error', }, { - inputs: [], - name: 'InvalidInitialization', type: 'error', - }, - { + name: 'InsufficientAllowance', inputs: [], - name: 'InvalidPermit', - type: 'error', }, { - inputs: [], - name: 'NotInitializing', type: 'error', + name: 'InsufficientBalance', + inputs: [], }, { - inputs: [], - name: 'Permit2AllowanceIsFixedAtInfinity', type: 'error', + name: 'InvalidPermit', + inputs: [], }, { - inputs: [], - name: 'PermitExpired', type: 'error', + name: 'Permit2AllowanceIsFixedAtInfinity', + inputs: [], }, { - inputs: [], - name: 'TotalSupplyOverflow', type: 'error', + name: 'PermitExpired', + inputs: [], }, { - inputs: [], - name: 'Unauthorized', type: 'error', + name: 'TotalSupplyOverflow', + inputs: [], }, { - inputs: [], - name: 'ZeroAddress', type: 'error', + name: 'Unauthorized', + inputs: [], }, ] as const @@ -1148,539 +1000,539 @@ export const optimismSuperchainERC20Abi = [ */ export const superchainWETHAbi = [ { - stateMutability: 'payable', type: 'fallback', + stateMutability: 'payable', }, { - stateMutability: 'payable', type: 'receive', + stateMutability: 'payable', }, { + type: 'function', + name: 'allowance', inputs: [ { - internalType: 'address', name: 'owner', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'spender', type: 'address', + internalType: 'address', }, ], - name: 'allowance', outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'approve', inputs: [ { - internalType: 'address', name: 'guy', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'wad', type: 'uint256', + internalType: 'uint256', }, ], - name: 'approve', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'balanceOf', inputs: [ { - internalType: 'address', name: 'src', type: 'address', + internalType: 'address', }, ], - name: 'balanceOf', outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'crosschainBurn', inputs: [ { - internalType: 'address', name: '_from', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'crosschainBurn', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'crosschainMint', inputs: [ { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'crosschainMint', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'decimals', + inputs: [], outputs: [ { - internalType: 'uint8', name: '', type: 'uint8', + internalType: 'uint8', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'deposit', + inputs: [], outputs: [], stateMutability: 'payable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'name', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'relayETH', inputs: [ { - internalType: 'address', name: '_from', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'relayETH', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'sendETH', inputs: [ { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_chainId', type: 'uint256', + internalType: 'uint256', }, ], - name: 'sendETH', outputs: [ { - internalType: 'bytes32', name: 'msgHash_', type: 'bytes32', + internalType: 'bytes32', }, ], stateMutability: 'payable', - type: 'function', }, { + type: 'function', + name: 'supportsInterface', inputs: [ { - internalType: 'bytes4', name: '_interfaceId', type: 'bytes4', + internalType: 'bytes4', }, ], - name: 'supportsInterface', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'symbol', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - inputs: [], + type: 'function', name: 'totalSupply', + inputs: [], outputs: [ { - internalType: 'uint256', name: '', type: 'uint256', + internalType: 'uint256', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'transfer', inputs: [ { - internalType: 'address', name: 'dst', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'wad', type: 'uint256', + internalType: 'uint256', }, ], - name: 'transfer', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'transferFrom', inputs: [ { - internalType: 'address', name: 'src', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: 'dst', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: 'wad', type: 'uint256', + internalType: 'uint256', }, ], - name: 'transferFrom', outputs: [ { - internalType: 'bool', name: '', type: 'bool', + internalType: 'bool', }, ], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'version', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { + type: 'function', + name: 'withdraw', inputs: [ { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'withdraw', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { - anonymous: false, + type: 'event', + name: 'Approval', inputs: [ { - indexed: true, - internalType: 'address', name: 'src', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'guy', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'wad', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Approval', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'CrosschainBurn', inputs: [ { - indexed: true, - internalType: 'address', name: 'from', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, { - indexed: true, - internalType: 'address', name: 'sender', type: 'address', + indexed: true, + internalType: 'address', }, ], - name: 'CrosschainBurn', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'CrosschainMint', inputs: [ { - indexed: true, - internalType: 'address', name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', + indexed: false, + internalType: 'uint256', }, { - indexed: true, - internalType: 'address', name: 'sender', type: 'address', + indexed: true, + internalType: 'address', }, ], - name: 'CrosschainMint', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'Deposit', inputs: [ { - indexed: true, - internalType: 'address', name: 'dst', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'wad', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Deposit', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'RelayETH', inputs: [ { - indexed: true, - internalType: 'address', name: 'from', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', - }, - { indexed: false, internalType: 'uint256', + }, + { name: 'source', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'RelayETH', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'SendETH', inputs: [ { - indexed: true, - internalType: 'address', name: 'from', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', - }, - { indexed: false, internalType: 'uint256', + }, + { name: 'destination', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'SendETH', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'Transfer', inputs: [ { - indexed: true, - internalType: 'address', name: 'src', type: 'address', - }, - { indexed: true, internalType: 'address', + }, + { name: 'dst', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'wad', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Transfer', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'Withdrawal', inputs: [ { - indexed: true, - internalType: 'address', name: 'src', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'wad', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'Withdrawal', - type: 'event', + anonymous: false, }, { - inputs: [], - name: 'InvalidCrossDomainSender', type: 'error', + name: 'InvalidCrossDomainSender', + inputs: [], }, { - inputs: [], - name: 'NotCustomGasToken', type: 'error', + name: 'NotCustomGasToken', + inputs: [], }, { - inputs: [], - name: 'Unauthorized', type: 'error', + name: 'Unauthorized', + inputs: [], }, { - inputs: [], - name: 'ZeroAddress', type: 'error', + name: 'ZeroAddress', + inputs: [], }, ] as const @@ -1690,172 +1542,172 @@ export const superchainWETHAbi = [ */ export const superchainTokenBridgeAbi = [ { + type: 'function', + name: 'relayERC20', inputs: [ { - internalType: 'address', name: '_token', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: '_from', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, ], - name: 'relayERC20', outputs: [], stateMutability: 'nonpayable', - type: 'function', }, { + type: 'function', + name: 'sendERC20', inputs: [ { - internalType: 'address', name: '_token', type: 'address', + internalType: 'address', }, { - internalType: 'address', name: '_to', type: 'address', + internalType: 'address', }, { - internalType: 'uint256', name: '_amount', type: 'uint256', + internalType: 'uint256', }, { - internalType: 'uint256', name: '_chainId', type: 'uint256', + internalType: 'uint256', }, ], - name: 'sendERC20', outputs: [ { - internalType: 'bytes32', name: 'msgHash_', type: 'bytes32', + internalType: 'bytes32', }, ], stateMutability: 'nonpayable', - type: 'function', }, { - inputs: [], + type: 'function', name: 'version', + inputs: [], outputs: [ { - internalType: 'string', name: '', type: 'string', + internalType: 'string', }, ], stateMutability: 'view', - type: 'function', }, { - anonymous: false, + type: 'event', + name: 'RelayERC20', inputs: [ { - indexed: true, - internalType: 'address', name: 'token', type: 'address', - }, - { indexed: true, internalType: 'address', - name: 'from', - type: 'address', }, { + name: 'from', + type: 'address', indexed: true, internalType: 'address', + }, + { name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', - }, - { indexed: false, internalType: 'uint256', + }, + { name: 'source', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'RelayERC20', - type: 'event', + anonymous: false, }, { - anonymous: false, + type: 'event', + name: 'SendERC20', inputs: [ { - indexed: true, - internalType: 'address', name: 'token', type: 'address', - }, - { indexed: true, internalType: 'address', - name: 'from', - type: 'address', }, { + name: 'from', + type: 'address', indexed: true, internalType: 'address', + }, + { name: 'to', type: 'address', + indexed: true, + internalType: 'address', }, { - indexed: false, - internalType: 'uint256', name: 'amount', type: 'uint256', - }, - { indexed: false, internalType: 'uint256', + }, + { name: 'destination', type: 'uint256', + indexed: false, + internalType: 'uint256', }, ], - name: 'SendERC20', - type: 'event', + anonymous: false, }, { - inputs: [], - name: 'InvalidCrossDomainSender', type: 'error', + name: 'InvalidCrossDomainSender', + inputs: [], }, { - inputs: [], - name: 'InvalidERC7802', type: 'error', + name: 'InvalidERC7802', + inputs: [], }, { - inputs: [], - name: 'Unauthorized', type: 'error', + name: 'Unauthorized', + inputs: [], }, { - inputs: [], - name: 'ZeroAddress', type: 'error', + name: 'ZeroAddress', + inputs: [], }, ] as const From d34ae48821ebb84b4ee4e5ccfe89c9eb7bcc0599 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 19:02:30 -0500 Subject: [PATCH 09/11] fix wagmi imports --- packages/viem/src/index.ts | 3 +++ packages/wagmi/src/hooks/useCrossChainSendETH.ts | 4 ++-- packages/wagmi/src/hooks/useRelayL2ToL2Message.ts | 4 ++-- packages/wagmi/src/hooks/useSendL2ToL2Message.ts | 4 ++-- packages/wagmi/src/hooks/useSendSupERC20.ts | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/viem/src/index.ts b/packages/viem/src/index.ts index 76dc33ea..b6d272d4 100644 --- a/packages/viem/src/index.ts +++ b/packages/viem/src/index.ts @@ -4,6 +4,9 @@ export type { MessageIdentifier } from '@/types/interop.js' // contracts export { contracts } from '@/contracts.js' +// abis (TEMPORARY) +export * from '@/abis.js' + // actions export type { CrossChainSendETHContractReturnType, diff --git a/packages/wagmi/src/hooks/useCrossChainSendETH.ts b/packages/wagmi/src/hooks/useCrossChainSendETH.ts index 8cdf1f09..219c1c92 100644 --- a/packages/wagmi/src/hooks/useCrossChainSendETH.ts +++ b/packages/wagmi/src/hooks/useCrossChainSendETH.ts @@ -1,7 +1,7 @@ import { contracts, type CrossChainSendETHParameters, - superchainWETHABI, + superchainWETHAbi, } from '@eth-optimism/viem' import { useCallback } from 'react' import { useConfig, useWriteContract } from 'wagmi' @@ -16,7 +16,7 @@ export const useCrossChainSendETH = () => { const { to, chainId, value } = params return writeContractAsync({ - abi: superchainWETHABI, + abi: superchainWETHAbi, address: contracts.superchainWETH.address, value, functionName: 'sendETH', diff --git a/packages/wagmi/src/hooks/useRelayL2ToL2Message.ts b/packages/wagmi/src/hooks/useRelayL2ToL2Message.ts index 1bd830be..a4cb969e 100644 --- a/packages/wagmi/src/hooks/useRelayL2ToL2Message.ts +++ b/packages/wagmi/src/hooks/useRelayL2ToL2Message.ts @@ -1,5 +1,5 @@ import type { RelayL2ToL2MessageParameters } from '@eth-optimism/viem' -import { contracts, l2ToL2CrossDomainMessengerABI } from '@eth-optimism/viem' +import { contracts, l2ToL2CrossDomainMessengerAbi } from '@eth-optimism/viem' import { useCallback } from 'react' import { useConfig, useWriteContract } from 'wagmi' @@ -21,7 +21,7 @@ export const useRelayL2ToL2Message = () => { } = params return writeContractAsync({ - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, functionName: 'relayMessage', args: [sentMessageId, sentMessagePayload], diff --git a/packages/wagmi/src/hooks/useSendL2ToL2Message.ts b/packages/wagmi/src/hooks/useSendL2ToL2Message.ts index c3d29dda..e8f87c0b 100644 --- a/packages/wagmi/src/hooks/useSendL2ToL2Message.ts +++ b/packages/wagmi/src/hooks/useSendL2ToL2Message.ts @@ -1,5 +1,5 @@ import type { SendL2ToL2MessageParameters } from '@eth-optimism/viem' -import { contracts, l2ToL2CrossDomainMessengerABI } from '@eth-optimism/viem' +import { contracts, l2ToL2CrossDomainMessengerAbi } from '@eth-optimism/viem' import { useCallback } from 'react' import { useConfig, useWriteContract } from 'wagmi' @@ -13,7 +13,7 @@ export const useSendL2ToL2Message = () => { const { destinationChainId, target, message } = params return writeContractAsync({ - abi: l2ToL2CrossDomainMessengerABI, + abi: l2ToL2CrossDomainMessengerAbi, address: contracts.l2ToL2CrossDomainMessenger.address, functionName: 'sendMessage', args: [BigInt(destinationChainId), target, message], diff --git a/packages/wagmi/src/hooks/useSendSupERC20.ts b/packages/wagmi/src/hooks/useSendSupERC20.ts index 3959a233..fc512479 100644 --- a/packages/wagmi/src/hooks/useSendSupERC20.ts +++ b/packages/wagmi/src/hooks/useSendSupERC20.ts @@ -1,5 +1,5 @@ import type { SendSupERC20Parameters } from '@eth-optimism/viem' -import { contracts, superchainTokenBridgeABI } from '@eth-optimism/viem' +import { contracts, superchainTokenBridgeAbi } from '@eth-optimism/viem' import { useCallback } from 'react' import { useConfig, useWriteContract } from 'wagmi' @@ -14,7 +14,7 @@ export const useSendSupERC20 = () => { const { tokenAddress, to, amount, chainId } = params return writeContractAsync({ - abi: superchainTokenBridgeABI, + abi: superchainTokenBridgeAbi, address: contracts.superchainTokenBridge.address, functionName: 'sendERC20', args: [tokenAddress, to, amount, BigInt(chainId)], From f2f66aa7b92d10dfad6b3c85c9fd439c469841f2 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 19:04:11 -0500 Subject: [PATCH 10/11] changeset --- .changeset/calm-yaks-join.md | 5 ----- .changeset/old-paws-eat.md | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 .changeset/calm-yaks-join.md create mode 100644 .changeset/old-paws-eat.md diff --git a/.changeset/calm-yaks-join.md b/.changeset/calm-yaks-join.md deleted file mode 100644 index baca2d1a..00000000 --- a/.changeset/calm-yaks-join.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@eth-optimism/viem": patch ---- - -abigen script from a submodule dependency on the optimism repo diff --git a/.changeset/old-paws-eat.md b/.changeset/old-paws-eat.md new file mode 100644 index 00000000..a05c67ba --- /dev/null +++ b/.changeset/old-paws-eat.md @@ -0,0 +1,6 @@ +--- +"@eth-optimism/wagmi": patch +"@eth-optimism/viem": patch +--- + +update generated abi and fix imports. abi will be exported temporarily From 5929de6b66698eb0ac0c0f16abc46c24eefa6ba1 Mon Sep 17 00:00:00 2001 From: Hamdi Allam Date: Thu, 16 Jan 2025 19:12:12 -0500 Subject: [PATCH 11/11] temporarily remove relayMessage output --- packages/viem/src/abis.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/viem/src/abis.ts b/packages/viem/src/abis.ts index fbd7dd32..b7368a14 100644 --- a/packages/viem/src/abis.ts +++ b/packages/viem/src/abis.ts @@ -338,13 +338,7 @@ export const l2ToL2CrossDomainMessengerAbi = [ internalType: 'bytes', }, ], - outputs: [ - { - name: 'returnData_', - type: 'bytes', - internalType: 'bytes', - }, - ], + outputs: [], // TODO: will fix after supersim update stateMutability: 'payable', }, {