diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c1fc5097..10ed23c3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,17 +13,17 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 - uses: actions/checkout@v3 with: submodules: recursive - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "16" - uses: bahmutov/npm-install@v1 with: install-command: npm install - run: npm run lint - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - name: Check formatting run: forge fmt --check diff --git a/.gitignore b/.gitignore index d47d7a74..d62344aa 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,3 @@ artifacts # Coverage Report report/ lcov.info - diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..1df31c14 --- /dev/null +++ b/.npmignore @@ -0,0 +1,40 @@ +# specific to npm package +deployments + +node_modules +.env +coverage +coverage.json +typechain +typechain-types +dist/ + +#Hardhat files +cache +artifacts + +# Foundry files +out/ +forge-cache/ + +*.tgz +src/contracts.template.ts + +.idea/ +.direnv/ +forge-cache/ + +node_modules +.env +coverage +coverage.json +typechain +typechain-types + +#Hardhat files +cache +artifacts + +# Coverage Report +report +lcov.info diff --git a/README.md b/README.md index 61e8b785..98e063b7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # vIBC Core Smart Contracts -This project includes the core smart contracts for the vIBC protocol, and a few demo contracts that simulate testing and serve as a template for integrating dapp devs. +This project includes the core smart contracts for the vIBC protocol, a few demo contracts that simulate testing and serve as a template for integrating dapp devs, and an npm package to aid with deploying and sending transactions to deployed contracts. -![](./diagrams/vibcContractsOverview.jpg) +![vIBC Contracts Overview](./diagrams/vibcContractsOverview.jpg) ## Repo Structure @@ -35,35 +35,118 @@ The optimisticProofVerifier verifies proofs for the optimistic light client. ## UniversalChannelHandler The UniversalChannelHandler is a middleware contract that can be used to save dapps from having to go through the 4-step channel handshake to send or receive Ibc packets. -## Quick Start with Forge/Foundry +## Building Contracts and Testing +This repository uses Foundry for testing and development of smart contracts -### Install Forge +## Deploying Contracts +All deployments can either be done through the command line, or through javascript code through importing modules. +After each deployment, deployment files are saved in deployment artifacts as json files, structured similar to how [hardhat deploy stores its deployment files](https://github.com/wighawag/hardhat-deploy). -```sh -curl -L https://foundry.paradigm.xyz | bash -``` - -This will install Foundryup, then simply follow the instructions on-screen, which will make the `foundryup` command available in your CLI. +Before deploying, the accounts used to deploy and any constructor arguments must be configured. This configuration can either be read from a yaml file or set through environment variables (see the sections below on how to configure each deployment). -Running `foundryup` by itself will install the latest (nightly) precompiled binaries: `forge`, `cast`, `anvil`, and `chisel`. See `foundryup --help` for more options, like installing from a specific version or commit. +The constructor arguments for each deployment. This supports syntax - which looks through written. You can also specify. +This file is read in-order, so each entry in this file should be in-order, where dependencies come first and the contract that depends on them comes later. -Or go to https://book.getfoundry.sh/getting-started/installation for more installation options. +### Deploying via Command Line +This npm package exposes two commands - one to deploy new contacts (which automatically creates persisted deployment files), and one to send transactions to contracts from persisted artifact files. The following steps are needed to deploy contracts via the command line: -### Build contracts +1. Ensure that your deployer account and constructor arguments are configured. This can either be done through adding contract spec yaml files located in the specs/ from the root of where this npm module is installed from (requires adding a `specs/evm.accounts.yaml` file and either a `specs/contracts.spec.yaml` or `specs/upgrade.spec.yaml`), or by setting the KEY_POLYMER, RPC_URL, DEPLOYMENT_CHAIN_ID, CHAIN_NAME environment variables. For examples of contract and account spec files, see the `/specs` folder in this repo. +2. Run either `npx deploy-vibc-core-smart-contracts` to deploy contracts from the contract spec, or `npx upgrade-vibc-core-smart-contracts` to send an upgrade transaction. -```sh -forge build -``` +### Deploying via imports +Deployments can also be done through calls through the `deployToChain` and the `sendTxToChain` methods. -### Run Tests +#### Deploying new contracts via imports -```sh -forge test ``` +import { + AccountRegistry, + Chain, + ContractRegistryLoader, + deployToChain, + parseObjFromFile, +} from "@open-ibc/vibc-core-smart-contracts"; + +import { getMainLogger } from "@open-ibc/vibc-core-smart-contracts/utils/cli"; +import { DEFAULT_RPC_URL } from "../utils/constants"; + +// Or can parse it form the env +const accountConfig = { + name: "local", + registry: [ + { + name: "KEY_POLYMER", + privateKey: process.env.KEY_POLYMER + }, + ], +}; + +const accounts = AccountRegistry.loadMultiple([accountConfig]); +const contracts = ContractRegistryLoader.loadSingle( + parseObjFromFile("specs/contracts.spec.yaml") +); + +const chain: Chain = { + rpc: process.env.RPC_URL , + chainId: process.env.DEPLOYMENT_CHAIN_ID, + chainName: process.env.CHAIN_NAME, + vmType: "evm", + description: "local chain", +}; + +deployToChain( + chain, + accounts.mustGet(chain.chainName), + contracts.subset(), + getMainLogger(), + false +); +``` + +similar to the command line deploy, this will create a deployment artifact file in the `deployments/` folder. -### Clean environment +#### Upgrading existing contracts via imports +Proxy upgrades to existing contracts can be done through the `sendTxToChain` method : -```sh -forge clean +``` +#!/usr/bin/env node +import { + AccountRegistry, + Chain, + parseObjFromFile, +} from "@open-ibc/vibc-core-smart-contracts"; +import { loadTxRegistry } from "@open-ibc/vibc-core-smart-contracts/evm/schemas/tx"; +import { sendTxToChain } from "@open-ibc/vibc-core-smart-contracts"; + +import { getOutputLogger } from "@open-ibc/vibc-core-smart-contracts/utils/cli"; +// Or can parse it form the env +const accountConfig = { + name: "local", + registry: [ + { + name: "KEY_POLYMER", + privateKey: process.env.KEY_POLYMER, + }, + ], +}; + +const accounts = AccountRegistry.loadMultiple([accountConfig]); +const upgradeTxs = loadTxRegistry(parseObjFromFile("specs/upgrade.spec.yaml")); + +const chain: Chain = { + rpc: process.env.RPC_URL, + chainId: process.env.CHAIN_ID, + chainName: "local", + vmType: "evm", + description: "local chain", +}; + +sendTxToChain( + chain, + accounts.mustGet(chain.chainName), + upgradeTxs.subset(), + getOutputLogger(), + false +); ``` diff --git a/package.json b/package.json index 3ccb6a53..e5c4f54f 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,91 @@ { - "name": "vibc-core-smart-contracts", - "version": "1.0.0", - "main": "index.js", - "repository": "https://github.com/open-ibc/vibc-core-smart-contracts", + "name": "@open-ibc/vibc-core-smart-contracts", + "version": "2.1.0", + "main": "dist/index.js", + "bin": { + "deploy-vibc-core-smart-contracts": "./dist/scripts/deploy-script.js", + "upgrade-vibc-core-smart-contracts": "./dist/scripts/upgrade-script.js", + "setup-vibc-core-dispatcher": "./dist/scripts/setup-dispatcher-script.js" + }, "license": "MIT", "dependencies": { - "solhint": "^4.1.1" + "@commander-js/extra-typings": "^12.0.1", + "@typechain/ethers-v6": "^0.5.0", + "ethers": "^6.7.1", + "nunjucks": "^3.2.4", + "solhint": "^4.1.1", + "typechain": "^8.3.2", + "winston": "^3.13.0", + "yaml": "^2.4.1", + "yargs": "^17.7.2", + "zod": "^3.23.4", + "zx": "^8.0.2" + }, + "devDependencies": { + "@types/nunjucks": "^3.2.6", + "@types/winston": "^2.4.4", + "@types/yargs": "^17.0.32", + "chai": "^4.2.0", + "solidity-coverage": "^0.8.0", + "tsup": "^8.0.2" }, "scripts": { - "lint": "solhint contracts/**/*.sol" + "lint": "solhint contracts/**/*.sol", + "test": "forge test", + "build": "npm run build-ts-contract-bindings && npm run build-go-contract-bindings && tsup", + "build-ts-contract-bindings": "npm run build-contracts && typechain --target ethers-v6 --out-dir src/evm/contracts/ './out/?(OptimisticProofVerifier|ProofVerifier|Ibc|IbcUtils|Channel|Dispatcher|Mars|Earth|UniversalChannelHandler|DummyProofVerifier|DummyLightClient|ERC1967Proxy|OptimisticLightClient).sol/*.json'", + "build-go-contract-bindings": "echo go bindings generation not yet implemented!", + "build-contracts": "forge build", + "deploy-contracts": "npm run build && node dist/deploy.js", + "deploy-simple": "node dist/deploy.js", + "prepublish": "npm run build" + }, + "keywords": [ + "evm", + "cosmos", + "rollup", + "op-stack", + "interoperability", + "solidity" + ], + "author": "Polymer Labs", + "type": "module", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./contracts": { + "require": "./dist/evm/contracts/index.js", + "import": "./dist/evm/contracts/index.js", + "types": "./dist/evm/contracts/d.ts" + }, + "./contracts/*": { + "require": "./dist/evm/contracts/*.js", + "import": "./dist/evm/contracts/*.js", + "types": "./dist/evm/contracts/*.d.ts" + }, + "./evm": { + "require": "./dist/evm/index.js", + "import": "./dist/evm/index.js", + "types": "./dist/evm/index.d.ts" + }, + "./evm/account": "./dist/evm/account.js", + "./evm/chain": "./dist/evm/chain.js", + "./evm/schemas/contract": "./dist/evm/schemas/contract.js", + "./evm/schemas/tx": "./dist/evm/schemas/tx.js", + "./utils": { + "require": "./dist/utils/index.js", + "import": "./dist/utils/index.js", + "types": "./dist/utils/index.d.ts" + }, + "./utils/cli": "./dist/utils/cli.js", + "./utils/io": "./dist/utils/io.js", + "./constants": { + "require": "./dist/utils/constants/index.js", + "import": "./dist/utils/constants/index.js", + "types": "./dist/utils/constants/index.d.ts" + } } } diff --git a/specs/contracts.setup.spec.yaml b/specs/contracts.setup.spec.yaml new file mode 100644 index 00000000..61f4ce85 --- /dev/null +++ b/specs/contracts.setup.spec.yaml @@ -0,0 +1,29 @@ +# This file contains a tx spec for setting the right connections in the dispatcher contract. This spec needs to be run before the e2e test suite after deploying contracts. + +## The following arguments can be specified in tx spec: +# name: name of entry that will be stored in tx registry +# description: description in tx registry +# factoryName: factory to use to read abi to send tx +# deployer: can be set in the accounts.yaml +# address: address of contract to call method on +# signature: signature of method to call for this tx +# args: args to make the function call with, need to be compatible with the signature +- name: DispatcherClientSetup-Connection-0 + description: 'Setup client for dispatcher contracts' + deployer: 'KEY_POLYMER' + signature: "setClientForConnection(string,address)" + address: '{{DispatcherProxy}}' + factoryName: "Dispatcher" + args: + - 'connection-0' + - '{{LightClient}}' + +- name: DispatcherClientSetup-Connection-1 + description: 'Setup client for dispatcher contracts' + deployer: 'KEY_POLYMER' + signature: "setClientForConnection(string,address)" + address: '{{DispatcherProxy}}' + factoryName: "Dispatcher" + args: + - 'connection-2' + - '{{LightClient}}' \ No newline at end of file diff --git a/specs/contracts.spec.yaml b/specs/contracts.spec.yaml new file mode 100644 index 00000000..660caaca --- /dev/null +++ b/specs/contracts.spec.yaml @@ -0,0 +1,86 @@ +# spec for deploying contracts +# {{name}} is replaced with one of the following, whichever matches first +# - the deployed contract address whose name matches `name` (not factoryName) +# - variables of the running chain, e.g. {{chain.chainName}}, {{chain.chainId}} +# - deployment factory names from written deployment files +# NOTE: order of the contracts matters, as some contracts depend on others +# contracts with no deps should be placed before those with deps + +## The following arguments can be specified in contracts spec: +# name: name of key that will be stored in the contract registry +# deployer: must be # name of key that will be stored in the contract registry a valid name in accountRegistry; default to 'default' if not specified +# description: description to be stored in the contract registry +# factoryName: the name of the typechain factory used to deploy the contract +# deployer: deployer key, should correspond to either a private key or one that can be looked up in the evm.accounts.yaml +# libraries: if a contract depends on libraries, the location of the library file & the deployed library address can be specified here, as an array with 2 elements +# deployArgs: The arguments that will be called in the contract constructor. Note: if $INITARGS is passed in as an argument, it will be abi.encode the arguments passed to the init paramater +# init: any arguments that need to be abi encoded (e.g. for calling upgradeToAndCall for ERC1967Proxy). These will be rendered in the place of $INITARGS + + +- name: LightClient + description: 'DummyLightClient' + factoryName: 'DummyLightClient' + deployer: 'KEY_POLYMER' + +- name: Ibc + description: 'IBC library' + factoryName: 'Ibc' + deployer: 'KEY_POLYMER' + +- name: IbcUtils + description: 'IBC utils library' + factoryName: 'IbcUtils' + deployer: 'KEY_POLYMER' + +- name: Dispatcher + description: 'IBC Core contract' + factoryName: 'Dispatcher' + libraries: + - name: 'contracts/libs/Ibc.sol:Ibc' + address: '{{Ibc}}' + deployer: 'KEY_POLYMER' + +- name: DispatcherProxy + description: 'Dispatcher proxy contract' + factoryName: 'ERC1967Proxy' + deployArgs: + - '{{Dispatcher}}' + - '$INITARGS' + init: + signature: 'initialize(string)' + args: + - 'polyibc.{{chain.chainName}}.' + deployer: 'KEY_POLYMER' + +- name: UC + description: 'Universal Chanel IBC-middleware contract' + factoryName: 'UniversalChannelHandler' + deployer: 'KEY_POLYMER' + libraries: + - name: 'contracts/libs/IbcUtils.sol:IbcUtils' + address: '{{IbcUtils}}' + +- name: UCProxy + description: 'Universal Chanel IBC-middleware proxy' + factoryName: 'ERC1967Proxy' + deployer: 'KEY_POLYMER' + deployArgs: + - '{{UC}}' + - '$INITARGS' + init: + signature: 'initialize(address)' + args: + - '{{DispatcherProxy}}' + +# dApp contracts for testing and as examples +- name: Mars + description: 'Mars contract directly owns a IBC channel' + deployArgs: + - '{{DispatcherProxy}}' + deployer: 'KEY_POLYMER' + +- name: Earth + description: 'Earth contract uses shared universal channel' + deployArgs: + - '{{UCProxy}}' + deployer: 'KEY_POLYMER' diff --git a/specs/evm.accounts.yaml b/specs/evm.accounts.yaml new file mode 100644 index 00000000..d917dbc9 --- /dev/null +++ b/specs/evm.accounts.yaml @@ -0,0 +1,3 @@ +# These accounts are derived from a test mnemonic by Anvil/Hardhat and used for testing purposes only. +- name: 'KEY_POLYMER' + privateKey: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' \ No newline at end of file diff --git a/specs/upgrade.spec.yaml b/specs/upgrade.spec.yaml new file mode 100644 index 00000000..57525d6f --- /dev/null +++ b/specs/upgrade.spec.yaml @@ -0,0 +1,26 @@ +# This file contains a sample spec for sending Txs to contracts. +# This spec can be used for sending any tx to a contract, including proxy upgrades, calling setters, transferring ownership, etc. +# similar to in contract specs, {{name}} is replaced with one of the following, whichever matches first +# - the deployed contract address whose name matches `name` (not factoryName) +# - variables of the running chain, e.g. {{chain.chainName}}, {{chain.chainId}} +# - deployment factory names from written deployment files +# NOTE: order of the txs matters, as some txs might depend on others +# deployer: must be a valid name in accountRegistry; default to 'default' if not specified + +## The following arguments can be specified in tx spec: +# name: name of entry that will be stored in tx registry +# description: description in tx registry +# factoryName: factory to use to read abi to send tx +# deployer: can be set in the accounts.yaml +# address: address of contract to call method on +# signature: signature of method to call for this tx +# args: args to make the function call with, need to be compatible with the signature + +- name: DispatcherUpgrade + description: 'UUPS Upgrade for dispatcher contract implementation' + deployer: 'KEY_POLYMER' + signature: "upgradeTo(address)" + address: '{{DispatcherProxy}}' + factoryName: "Dispatcher" + args: + - '{{Dispatcher}}' \ No newline at end of file diff --git a/src/deploy.ts b/src/deploy.ts new file mode 100644 index 00000000..1c1ae467 --- /dev/null +++ b/src/deploy.ts @@ -0,0 +1,174 @@ +import { ethers } from "ethers"; +import { + StringToStringMap, + readDeploymentFilesIntoEnv, + renderArgs, + renderString, + writeDeployedContractToFile, +} from "./utils/io"; +import assert from "assert"; +import { AccountRegistry } from "./evm/account"; +import { + ContractRegistry, + ContractRegistryLoader, +} from "./evm/schemas/contract"; +import { Logger } from "./utils/cli"; +import { DEFAULT_DEPLOYER } from "./utils/constants"; +import { Chain } from "./evm/chain"; +import * as contracts from "./evm/contracts/index"; + +/** + * Return deployment libraries, factory, factory constructor, + * and rendered arguments for a contract deployment + */ +const getDeployData = ( + factoryName: string, + deployArgs: any[] | undefined, + env: StringToStringMap, + libraries: any[] = [], + init: { args: any[]; signature: string } | undefined +) => { + // @ts-ignore + const contractFactoryConstructor = contracts[`${factoryName}__factory`]; + assert( + contractFactoryConstructor, + `cannot find contract factory constructor for contract: ${factoryName}` + ); + + const libs = libraries + ? libraries.map((arg: any) => { + return { [arg.name]: renderString(arg.address, env) }; + }) + : []; + + const factory = new contractFactoryConstructor(...libs); + if (!factory) { + throw new Error( + `cannot load contract factory for contract: ${factoryName} with factory name: ${factoryName}__factory` + ); + } + + // var encodedInitData = ""; + let initData = ""; + + if (init) { + const initArgs = init.args.map((arg: any) => { + return typeof arg === "string" ? renderString(arg, env) : arg; + }); + const iFace = new ethers.Interface([`function ${init.signature}`]); + initData = iFace.encodeFunctionData(init.signature, initArgs); + } + return { + args: renderArgs(deployArgs, initData, env), + libraries: libs, + factory, + contractFactoryConstructor, + }; +}; + +export async function deployToChain( + chain: Chain, + accountRegistry: AccountRegistry, + deploySpec: ContractRegistry, + logger: Logger, + dryRun = false, + forceDeployNewContracts = false, // True if you want to use existing deployments when possible + writeContracts: boolean = true // True if you want to save persisted artifact files. +) { + logger.info( + `deploying ${deploySpec.size} contract(s) to chain ${ + chain.chainName + } with contractNames: [${deploySpec.keys()}]` + ); + + if (!dryRun) { + const provider = ethers.getDefaultProvider(chain.rpc); + const newAccounts = accountRegistry.subset([]); + for (const [name, wallet] of accountRegistry.entries()) { + newAccounts.set(name, wallet.connect(provider)); + } + accountRegistry = newAccounts; + } + + // @ts-ignore + const env: StringToStringMap = { chain }; + if (!forceDeployNewContracts) { + // Only read from existing contract files if we want to deploy new ones + await readDeploymentFilesIntoEnv(env); + } + + // result is the final contract registry after deployment, modified in place + const result = ContractRegistryLoader.loadSingle( + JSON.parse(JSON.stringify(deploySpec.serialize())) + ); + + const eachContract = async ( + contract: ReturnType + ) => { + try { + const factoryName = contract.factoryName + ? contract.factoryName + : contract.name; + + const constructorData = getDeployData( + factoryName, + contract.deployArgs, + env, + contract.libraries, + contract.init + ); + + logger.info( + `[${chain.chainName}]: deploying ${contract.name} with args: [${ + constructorData.args + }] with libraries: ${JSON.stringify(constructorData.libraries)}` + ); + let deployedAddr = `new.${contract.name}.address`; + const deployer = accountRegistry.mustGet( + contract.deployer ? contract.deployer : DEFAULT_DEPLOYER + ); + + if (!dryRun) { + const deployed = await constructorData.factory + .connect(deployer) + .deploy(...constructorData.args); + await deployed.deploymentTransaction()?.wait(); + deployedAddr = await deployed.getAddress(); + } + // save deployed contract address for its dependencies + env[contract.name] = deployedAddr; + // update contract in registry as output result + contract.address = deployedAddr; + contract.deployer = deployer.address; + contract.abi = constructorData.contractFactoryConstructor.abi; + if (writeContracts) { + const contractObject = { + factory: factoryName, + address: deployedAddr, + abi: constructorData.contractFactoryConstructor.abi, + bytecode: constructorData.factory.bytecode, + name: contract.name, + args: constructorData.args, + }; + writeDeployedContractToFile(chain, contractObject); + } + } catch (err) { + logger.error( + `[${chain.chainName}] deploy ${contract.name} failed: ${err}` + ); + throw err; + } + }; + for (const contract of result.values()) { + await eachContract(contract); + } + + logger.info( + `[${chain.chainName}]: finished deploying ${result.size} contracts` + ); + + return { + chainName: chain.chainName, + contracts: result, + }; +} diff --git a/src/evm/account.ts b/src/evm/account.ts new file mode 100644 index 00000000..e3157293 --- /dev/null +++ b/src/evm/account.ts @@ -0,0 +1,134 @@ +import { z } from "zod"; +import { ethers } from "ethers"; +import fs from "fs"; +import path from "path"; +import { Registry } from "../utils/registry"; +import { parseZodSchema } from "../utils/io"; + +const privateKey = z.object({ + name: z.string().min(1), + // privateKey should be a hex string prefixed with 0x + privateKey: z.string().min(1), +}); + +const mnemonic = z.object({ + name: z.string().min(1), + // a 12-word mnemonic; or more words per BIP-39 spec + mnemonic: z.string().min(1), + path: z.optional(z.string().min(1)), + index: z.optional(z.number().int().min(0)), +}); + +// geth compatible keystore +const keyStore = z.object({ + dir: z.string().min(1), + password: z.optional(z.string()), +}); + +export const EvmAccountsSchema = z.union([ + z.array(z.union([privateKey, mnemonic])), + keyStore, +]); + +// ethers wallet with encryption +export type Wallet = ethers.Wallet | ethers.HDNodeWallet; + +export class AccountRegistry extends Registry { + static load(config: any[], name: string): AccountRegistry { + return new AccountRegistry(loadEvmAccounts(config), config, name); + } + + static loadMultiple(registryItems: { name: string; registry: any }[]) { + const result = new Registry([] as AccountRegistry[], { + toObj: (t) => { + return { name: t.name, registry: t.serialize() }; + }, + }); + for (const item of registryItems) { + result.set(item.name, AccountRegistry.load(item.registry, item.name)); + } + return result; + } + + constructor(r: Registry, private config: any[], name: string) { + super([], { nameInParent: name }); + for (const [name, wallet] of r.entries()) { + this.set(name, wallet); + } + } + + // return the same config obj that was used to load the accounts, but filtered by current account names + public serialize() { + const wallets = this.toList(); + return this.config.map((item, index) => { + return { + name: item.name, + privateKey: wallets[index].privateKey, + address: wallets[index].address, + ...item, + }; + }); + } +} + +// load a Map of { [name: string]: Wallet } from EvmAccountsSchema object +export function loadEvmAccounts(config: any): Registry { + const accountsConfig = parseZodSchema( + "EvmAccountsSchema", + config, + EvmAccountsSchema.parse + ); + const walletMap = new Registry([]); + if (Array.isArray(accountsConfig)) { + for (const account of accountsConfig) { + walletMap.set(account.name, createWallet(account)); + } + } else if ("dir" in accountsConfig) { + const files = fs.readdirSync(accountsConfig.dir); + for (const file of files) { + const filePath = path.join(accountsConfig.dir, file); + const json = fs.readFileSync(filePath, "utf8"); + const wallet = ethers.Wallet.fromEncryptedJsonSync( + json, + accountsConfig.password ?? "" + ); + walletMap.set(wallet.address, wallet); + } + } else { + throw new Error( + `invalid accounts config: ${JSON.stringify(accountsConfig)}` + ); + } + return walletMap; +} + +export function createWallet(opt: { + privateKey?: string; + mnemonic?: string; + path?: string; + index?: number; +}): Wallet { + if (opt.privateKey && typeof opt.privateKey === "string") { + return new ethers.Wallet(opt.privateKey); + } + if (opt.mnemonic && typeof opt.mnemonic === "string") { + let wallet = ethers.Wallet.fromPhrase(opt.mnemonic); + if (typeof opt.path === "string" && opt.path.length > 0) { + wallet = ethers.HDNodeWallet.fromPhrase( + opt.mnemonic, + undefined, + opt.path + ); + } + // if account.index is specified, derive the child wallet by index + if (Number.isInteger(opt.index)) { + wallet = wallet.deriveChild(opt.index!); + } + return wallet; + } + throw new Error( + `invalid wallet config, must provide at least one of {privateKey, mnemonic}, but got: ${JSON.stringify( + opt + )}` + ); +} diff --git a/src/evm/chain.ts b/src/evm/chain.ts new file mode 100644 index 00000000..d1370dac --- /dev/null +++ b/src/evm/chain.ts @@ -0,0 +1,25 @@ +import { parseZodSchema } from "../utils/io"; +import { Registry } from "../utils/registry"; +import { z } from "zod"; + +const ChainConfigSchema = z.object({ + chainName: z.string().min(1), + chainId: z.number().int().min(1), + vmType: z.enum(["evm", "polymer", "cosmos"]).optional().default("evm"), + description: z.optional(z.string()), + rpc: z.string().min(1), +}); + +export const chainRegistrySchema = z.array(ChainConfigSchema).min(1); +export type ChainRegistry = Registry>; +export type Chain = ChainRegistry["Element"]; + +// load chain registry from a config object +export function loadChainRegistry(config: z.input) { + const chainRegistry = parseZodSchema( + "ChainRegistry", + config, + chainRegistrySchema.parse + ); + return new Registry(chainRegistry, { nameFunc: (c) => c.chainName }); +} diff --git a/src/evm/contracts/Dispatcher.ts b/src/evm/contracts/Dispatcher.ts new file mode 100644 index 00000000..33d80e67 --- /dev/null +++ b/src/evm/contracts/Dispatcher.ts @@ -0,0 +1,1736 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export type ChannelEndStruct = { + portId: string; + channelId: BytesLike; + version: string; +}; + +export type ChannelEndStructOutput = [ + portId: string, + channelId: string, + version: string +] & { portId: string; channelId: string; version: string }; + +export type ChannelStruct = { + version: string; + ordering: BigNumberish; + feeEnabled: boolean; + connectionHops: string[]; + counterpartyPortId: string; + counterpartyChannelId: BytesLike; + portId: string; +}; + +export type ChannelStructOutput = [ + version: string, + ordering: bigint, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: string, + portId: string +] & { + version: string; + ordering: bigint; + feeEnabled: boolean; + connectionHops: string[]; + counterpartyPortId: string; + counterpartyChannelId: string; + portId: string; +}; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface DispatcherInterface extends Interface { + getFunction( + nameOrSignature: + | "acknowledgement" + | "channelCloseConfirm" + | "channelCloseInit" + | "channelOpenAck" + | "channelOpenConfirm" + | "channelOpenInit" + | "channelOpenTry" + | "getChannel" + | "getOptimisticConsensusState" + | "initialize" + | "owner" + | "portPrefix" + | "portPrefixLen" + | "proxiableUUID" + | "recvPacket" + | "removeConnection" + | "renounceOwnership" + | "sendPacket" + | "setClientForConnection" + | "setPortPrefix" + | "timeout" + | "transferOwnership" + | "updateClientWithOptimisticConsensusState" + | "upgradeTo" + | "upgradeToAndCall" + | "writeTimeoutPacket" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "Acknowledgement" + | "AcknowledgementError" + | "AdminChanged" + | "BeaconUpgraded" + | "ChannelCloseConfirm" + | "ChannelCloseConfirmError" + | "ChannelCloseInit" + | "ChannelCloseInitError" + | "ChannelOpenAck" + | "ChannelOpenAckError" + | "ChannelOpenConfirm" + | "ChannelOpenConfirmError" + | "ChannelOpenInit" + | "ChannelOpenInitError" + | "ChannelOpenTry" + | "ChannelOpenTryError" + | "Initialized" + | "OwnershipTransferred" + | "RecvPacket" + | "SendPacket" + | "Timeout" + | "TimeoutError" + | "Upgraded" + | "WriteAckPacket" + | "WriteTimeoutPacket" + ): EventFragment; + + encodeFunctionData( + functionFragment: "acknowledgement", + values: [IbcPacketStruct, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "channelCloseConfirm", + values: [AddressLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "channelCloseInit", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "channelOpenAck", + values: [ + ChannelEndStruct, + string[], + BigNumberish, + boolean, + ChannelEndStruct, + Ics23ProofStruct + ] + ): string; + encodeFunctionData( + functionFragment: "channelOpenConfirm", + values: [ + ChannelEndStruct, + string[], + BigNumberish, + boolean, + ChannelEndStruct, + Ics23ProofStruct + ] + ): string; + encodeFunctionData( + functionFragment: "channelOpenInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + encodeFunctionData( + functionFragment: "channelOpenTry", + values: [ + ChannelEndStruct, + BigNumberish, + boolean, + string[], + ChannelEndStruct, + Ics23ProofStruct + ] + ): string; + encodeFunctionData( + functionFragment: "getChannel", + values: [AddressLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getOptimisticConsensusState", + values: [BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "portPrefix", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "portPrefixLen", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "recvPacket", + values: [IbcPacketStruct, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "removeConnection", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "sendPacket", + values: [BytesLike, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setClientForConnection", + values: [string, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setPortPrefix", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "timeout", + values: [IbcPacketStruct, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "updateClientWithOptimisticConsensusState", + values: [ + L1HeaderStruct, + OpL2StateProofStruct, + BigNumberish, + BigNumberish, + string + ] + ): string; + encodeFunctionData( + functionFragment: "upgradeTo", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [AddressLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "writeTimeoutPacket", + values: [IbcPacketStruct, Ics23ProofStruct] + ): string; + + decodeFunctionResult( + functionFragment: "acknowledgement", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getChannel", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getOptimisticConsensusState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "portPrefix", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "portPrefixLen", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "recvPacket", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "removeConnection", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "sendPacket", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setClientForConnection", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPortPrefix", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "timeout", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateClientWithOptimisticConsensusState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "writeTimeoutPacket", + data: BytesLike + ): Result; +} + +export namespace AcknowledgementEvent { + export type InputTuple = [ + sourcePortAddress: AddressLike, + sourceChannelId: BytesLike, + sequence: BigNumberish + ]; + export type OutputTuple = [ + sourcePortAddress: string, + sourceChannelId: string, + sequence: bigint + ]; + export interface OutputObject { + sourcePortAddress: string; + sourceChannelId: string; + sequence: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace AcknowledgementErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace AdminChangedEvent { + export type InputTuple = [previousAdmin: AddressLike, newAdmin: AddressLike]; + export type OutputTuple = [previousAdmin: string, newAdmin: string]; + export interface OutputObject { + previousAdmin: string; + newAdmin: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace BeaconUpgradedEvent { + export type InputTuple = [beacon: AddressLike]; + export type OutputTuple = [beacon: string]; + export interface OutputObject { + beacon: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelCloseConfirmEvent { + export type InputTuple = [portAddress: AddressLike, channelId: BytesLike]; + export type OutputTuple = [portAddress: string, channelId: string]; + export interface OutputObject { + portAddress: string; + channelId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelCloseConfirmErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelCloseInitEvent { + export type InputTuple = [portAddress: AddressLike, channelId: BytesLike]; + export type OutputTuple = [portAddress: string, channelId: string]; + export interface OutputObject { + portAddress: string; + channelId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelCloseInitErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenAckEvent { + export type InputTuple = [receiver: AddressLike, channelId: BytesLike]; + export type OutputTuple = [receiver: string, channelId: string]; + export interface OutputObject { + receiver: string; + channelId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenAckErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenConfirmEvent { + export type InputTuple = [receiver: AddressLike, channelId: BytesLike]; + export type OutputTuple = [receiver: string, channelId: string]; + export interface OutputObject { + receiver: string; + channelId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenConfirmErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenInitEvent { + export type InputTuple = [ + receiver: AddressLike, + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ]; + export type OutputTuple = [ + receiver: string, + version: string, + ordering: bigint, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ]; + export interface OutputObject { + receiver: string; + version: string; + ordering: bigint; + feeEnabled: boolean; + connectionHops: string[]; + counterpartyPortId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenInitErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenTryEvent { + export type InputTuple = [ + receiver: AddressLike, + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: BytesLike + ]; + export type OutputTuple = [ + receiver: string, + version: string, + ordering: bigint, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: string + ]; + export interface OutputObject { + receiver: string; + version: string; + ordering: bigint; + feeEnabled: boolean; + connectionHops: string[]; + counterpartyPortId: string; + counterpartyChannelId: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ChannelOpenTryErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace InitializedEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RecvPacketEvent { + export type InputTuple = [ + destPortAddress: AddressLike, + destChannelId: BytesLike, + sequence: BigNumberish + ]; + export type OutputTuple = [ + destPortAddress: string, + destChannelId: string, + sequence: bigint + ]; + export interface OutputObject { + destPortAddress: string; + destChannelId: string; + sequence: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SendPacketEvent { + export type InputTuple = [ + sourcePortAddress: AddressLike, + sourceChannelId: BytesLike, + packet: BytesLike, + sequence: BigNumberish, + timeoutTimestamp: BigNumberish + ]; + export type OutputTuple = [ + sourcePortAddress: string, + sourceChannelId: string, + packet: string, + sequence: bigint, + timeoutTimestamp: bigint + ]; + export interface OutputObject { + sourcePortAddress: string; + sourceChannelId: string; + packet: string; + sequence: bigint; + timeoutTimestamp: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TimeoutEvent { + export type InputTuple = [ + sourcePortAddress: AddressLike, + sourceChannelId: BytesLike, + sequence: BigNumberish + ]; + export type OutputTuple = [ + sourcePortAddress: string, + sourceChannelId: string, + sequence: bigint + ]; + export interface OutputObject { + sourcePortAddress: string; + sourceChannelId: string; + sequence: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TimeoutErrorEvent { + export type InputTuple = [receiver: AddressLike, error: BytesLike]; + export type OutputTuple = [receiver: string, error: string]; + export interface OutputObject { + receiver: string; + error: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UpgradedEvent { + export type InputTuple = [implementation: AddressLike]; + export type OutputTuple = [implementation: string]; + export interface OutputObject { + implementation: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WriteAckPacketEvent { + export type InputTuple = [ + writerPortAddress: AddressLike, + writerChannelId: BytesLike, + sequence: BigNumberish, + ackPacket: AckPacketStruct + ]; + export type OutputTuple = [ + writerPortAddress: string, + writerChannelId: string, + sequence: bigint, + ackPacket: AckPacketStructOutput + ]; + export interface OutputObject { + writerPortAddress: string; + writerChannelId: string; + sequence: bigint; + ackPacket: AckPacketStructOutput; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WriteTimeoutPacketEvent { + export type InputTuple = [ + writerPortAddress: AddressLike, + writerChannelId: BytesLike, + sequence: BigNumberish, + timeoutHeight: HeightStruct, + timeoutTimestamp: BigNumberish + ]; + export type OutputTuple = [ + writerPortAddress: string, + writerChannelId: string, + sequence: bigint, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint + ]; + export interface OutputObject { + writerPortAddress: string; + writerChannelId: string; + sequence: bigint; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface Dispatcher extends BaseContract { + connect(runner?: ContractRunner | null): Dispatcher; + waitForDeployment(): Promise; + + interface: DispatcherInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + acknowledgement: TypedContractMethod< + [packet: IbcPacketStruct, ack: BytesLike, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + channelCloseConfirm: TypedContractMethod< + [portAddress: AddressLike, channelId: BytesLike, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + channelCloseInit: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + channelOpenAck: TypedContractMethod< + [ + local: ChannelEndStruct, + connectionHops: string[], + ordering: BigNumberish, + feeEnabled: boolean, + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + + channelOpenConfirm: TypedContractMethod< + [ + local: ChannelEndStruct, + connectionHops: string[], + ordering: BigNumberish, + feeEnabled: boolean, + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + + channelOpenInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + channelOpenTry: TypedContractMethod< + [ + local: ChannelEndStruct, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + + getChannel: TypedContractMethod< + [portAddress: AddressLike, channelId: BytesLike], + [ChannelStructOutput], + "view" + >; + + getOptimisticConsensusState: TypedContractMethod< + [height: BigNumberish, connection: string], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + + initialize: TypedContractMethod< + [initPortPrefix: string], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + portPrefix: TypedContractMethod<[], [string], "view">; + + portPrefixLen: TypedContractMethod<[], [bigint], "view">; + + proxiableUUID: TypedContractMethod<[], [string], "view">; + + recvPacket: TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + removeConnection: TypedContractMethod< + [connection: string], + [void], + "nonpayable" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + sendPacket: TypedContractMethod< + [channelId: BytesLike, packet: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + setClientForConnection: TypedContractMethod< + [connection: string, lightClient: AddressLike], + [void], + "nonpayable" + >; + + setPortPrefix: TypedContractMethod< + [_portPrefix: string], + [void], + "nonpayable" + >; + + timeout: TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + updateClientWithOptimisticConsensusState: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish, + connection: string + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + + upgradeTo: TypedContractMethod< + [newImplementation: AddressLike], + [void], + "nonpayable" + >; + + upgradeToAndCall: TypedContractMethod< + [newImplementation: AddressLike, data: BytesLike], + [void], + "payable" + >; + + writeTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "acknowledgement" + ): TypedContractMethod< + [packet: IbcPacketStruct, ack: BytesLike, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "channelCloseConfirm" + ): TypedContractMethod< + [portAddress: AddressLike, channelId: BytesLike, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "channelCloseInit" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "channelOpenAck" + ): TypedContractMethod< + [ + local: ChannelEndStruct, + connectionHops: string[], + ordering: BigNumberish, + feeEnabled: boolean, + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "channelOpenConfirm" + ): TypedContractMethod< + [ + local: ChannelEndStruct, + connectionHops: string[], + ordering: BigNumberish, + feeEnabled: boolean, + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "channelOpenInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "channelOpenTry" + ): TypedContractMethod< + [ + local: ChannelEndStruct, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterparty: ChannelEndStruct, + proof: Ics23ProofStruct + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "getChannel" + ): TypedContractMethod< + [portAddress: AddressLike, channelId: BytesLike], + [ChannelStructOutput], + "view" + >; + getFunction( + nameOrSignature: "getOptimisticConsensusState" + ): TypedContractMethod< + [height: BigNumberish, connection: string], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod<[initPortPrefix: string], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "portPrefix" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "portPrefixLen" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "proxiableUUID" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "removeConnection" + ): TypedContractMethod<[connection: string], [void], "nonpayable">; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "sendPacket" + ): TypedContractMethod< + [channelId: BytesLike, packet: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setClientForConnection" + ): TypedContractMethod< + [connection: string, lightClient: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setPortPrefix" + ): TypedContractMethod<[_portPrefix: string], [void], "nonpayable">; + getFunction( + nameOrSignature: "timeout" + ): TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "updateClientWithOptimisticConsensusState" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish, + connection: string + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + getFunction( + nameOrSignature: "upgradeTo" + ): TypedContractMethod< + [newImplementation: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "upgradeToAndCall" + ): TypedContractMethod< + [newImplementation: AddressLike, data: BytesLike], + [void], + "payable" + >; + getFunction( + nameOrSignature: "writeTimeoutPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct, proof: Ics23ProofStruct], + [void], + "nonpayable" + >; + + getEvent( + key: "Acknowledgement" + ): TypedContractEvent< + AcknowledgementEvent.InputTuple, + AcknowledgementEvent.OutputTuple, + AcknowledgementEvent.OutputObject + >; + getEvent( + key: "AcknowledgementError" + ): TypedContractEvent< + AcknowledgementErrorEvent.InputTuple, + AcknowledgementErrorEvent.OutputTuple, + AcknowledgementErrorEvent.OutputObject + >; + getEvent( + key: "AdminChanged" + ): TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + getEvent( + key: "BeaconUpgraded" + ): TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + getEvent( + key: "ChannelCloseConfirm" + ): TypedContractEvent< + ChannelCloseConfirmEvent.InputTuple, + ChannelCloseConfirmEvent.OutputTuple, + ChannelCloseConfirmEvent.OutputObject + >; + getEvent( + key: "ChannelCloseConfirmError" + ): TypedContractEvent< + ChannelCloseConfirmErrorEvent.InputTuple, + ChannelCloseConfirmErrorEvent.OutputTuple, + ChannelCloseConfirmErrorEvent.OutputObject + >; + getEvent( + key: "ChannelCloseInit" + ): TypedContractEvent< + ChannelCloseInitEvent.InputTuple, + ChannelCloseInitEvent.OutputTuple, + ChannelCloseInitEvent.OutputObject + >; + getEvent( + key: "ChannelCloseInitError" + ): TypedContractEvent< + ChannelCloseInitErrorEvent.InputTuple, + ChannelCloseInitErrorEvent.OutputTuple, + ChannelCloseInitErrorEvent.OutputObject + >; + getEvent( + key: "ChannelOpenAck" + ): TypedContractEvent< + ChannelOpenAckEvent.InputTuple, + ChannelOpenAckEvent.OutputTuple, + ChannelOpenAckEvent.OutputObject + >; + getEvent( + key: "ChannelOpenAckError" + ): TypedContractEvent< + ChannelOpenAckErrorEvent.InputTuple, + ChannelOpenAckErrorEvent.OutputTuple, + ChannelOpenAckErrorEvent.OutputObject + >; + getEvent( + key: "ChannelOpenConfirm" + ): TypedContractEvent< + ChannelOpenConfirmEvent.InputTuple, + ChannelOpenConfirmEvent.OutputTuple, + ChannelOpenConfirmEvent.OutputObject + >; + getEvent( + key: "ChannelOpenConfirmError" + ): TypedContractEvent< + ChannelOpenConfirmErrorEvent.InputTuple, + ChannelOpenConfirmErrorEvent.OutputTuple, + ChannelOpenConfirmErrorEvent.OutputObject + >; + getEvent( + key: "ChannelOpenInit" + ): TypedContractEvent< + ChannelOpenInitEvent.InputTuple, + ChannelOpenInitEvent.OutputTuple, + ChannelOpenInitEvent.OutputObject + >; + getEvent( + key: "ChannelOpenInitError" + ): TypedContractEvent< + ChannelOpenInitErrorEvent.InputTuple, + ChannelOpenInitErrorEvent.OutputTuple, + ChannelOpenInitErrorEvent.OutputObject + >; + getEvent( + key: "ChannelOpenTry" + ): TypedContractEvent< + ChannelOpenTryEvent.InputTuple, + ChannelOpenTryEvent.OutputTuple, + ChannelOpenTryEvent.OutputObject + >; + getEvent( + key: "ChannelOpenTryError" + ): TypedContractEvent< + ChannelOpenTryErrorEvent.InputTuple, + ChannelOpenTryErrorEvent.OutputTuple, + ChannelOpenTryErrorEvent.OutputObject + >; + getEvent( + key: "Initialized" + ): TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + getEvent( + key: "RecvPacket" + ): TypedContractEvent< + RecvPacketEvent.InputTuple, + RecvPacketEvent.OutputTuple, + RecvPacketEvent.OutputObject + >; + getEvent( + key: "SendPacket" + ): TypedContractEvent< + SendPacketEvent.InputTuple, + SendPacketEvent.OutputTuple, + SendPacketEvent.OutputObject + >; + getEvent( + key: "Timeout" + ): TypedContractEvent< + TimeoutEvent.InputTuple, + TimeoutEvent.OutputTuple, + TimeoutEvent.OutputObject + >; + getEvent( + key: "TimeoutError" + ): TypedContractEvent< + TimeoutErrorEvent.InputTuple, + TimeoutErrorEvent.OutputTuple, + TimeoutErrorEvent.OutputObject + >; + getEvent( + key: "Upgraded" + ): TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + getEvent( + key: "WriteAckPacket" + ): TypedContractEvent< + WriteAckPacketEvent.InputTuple, + WriteAckPacketEvent.OutputTuple, + WriteAckPacketEvent.OutputObject + >; + getEvent( + key: "WriteTimeoutPacket" + ): TypedContractEvent< + WriteTimeoutPacketEvent.InputTuple, + WriteTimeoutPacketEvent.OutputTuple, + WriteTimeoutPacketEvent.OutputObject + >; + + filters: { + "Acknowledgement(address,bytes32,uint64)": TypedContractEvent< + AcknowledgementEvent.InputTuple, + AcknowledgementEvent.OutputTuple, + AcknowledgementEvent.OutputObject + >; + Acknowledgement: TypedContractEvent< + AcknowledgementEvent.InputTuple, + AcknowledgementEvent.OutputTuple, + AcknowledgementEvent.OutputObject + >; + + "AcknowledgementError(address,bytes)": TypedContractEvent< + AcknowledgementErrorEvent.InputTuple, + AcknowledgementErrorEvent.OutputTuple, + AcknowledgementErrorEvent.OutputObject + >; + AcknowledgementError: TypedContractEvent< + AcknowledgementErrorEvent.InputTuple, + AcknowledgementErrorEvent.OutputTuple, + AcknowledgementErrorEvent.OutputObject + >; + + "AdminChanged(address,address)": TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + AdminChanged: TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + + "BeaconUpgraded(address)": TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + BeaconUpgraded: TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + + "ChannelCloseConfirm(address,bytes32)": TypedContractEvent< + ChannelCloseConfirmEvent.InputTuple, + ChannelCloseConfirmEvent.OutputTuple, + ChannelCloseConfirmEvent.OutputObject + >; + ChannelCloseConfirm: TypedContractEvent< + ChannelCloseConfirmEvent.InputTuple, + ChannelCloseConfirmEvent.OutputTuple, + ChannelCloseConfirmEvent.OutputObject + >; + + "ChannelCloseConfirmError(address,bytes)": TypedContractEvent< + ChannelCloseConfirmErrorEvent.InputTuple, + ChannelCloseConfirmErrorEvent.OutputTuple, + ChannelCloseConfirmErrorEvent.OutputObject + >; + ChannelCloseConfirmError: TypedContractEvent< + ChannelCloseConfirmErrorEvent.InputTuple, + ChannelCloseConfirmErrorEvent.OutputTuple, + ChannelCloseConfirmErrorEvent.OutputObject + >; + + "ChannelCloseInit(address,bytes32)": TypedContractEvent< + ChannelCloseInitEvent.InputTuple, + ChannelCloseInitEvent.OutputTuple, + ChannelCloseInitEvent.OutputObject + >; + ChannelCloseInit: TypedContractEvent< + ChannelCloseInitEvent.InputTuple, + ChannelCloseInitEvent.OutputTuple, + ChannelCloseInitEvent.OutputObject + >; + + "ChannelCloseInitError(address,bytes)": TypedContractEvent< + ChannelCloseInitErrorEvent.InputTuple, + ChannelCloseInitErrorEvent.OutputTuple, + ChannelCloseInitErrorEvent.OutputObject + >; + ChannelCloseInitError: TypedContractEvent< + ChannelCloseInitErrorEvent.InputTuple, + ChannelCloseInitErrorEvent.OutputTuple, + ChannelCloseInitErrorEvent.OutputObject + >; + + "ChannelOpenAck(address,bytes32)": TypedContractEvent< + ChannelOpenAckEvent.InputTuple, + ChannelOpenAckEvent.OutputTuple, + ChannelOpenAckEvent.OutputObject + >; + ChannelOpenAck: TypedContractEvent< + ChannelOpenAckEvent.InputTuple, + ChannelOpenAckEvent.OutputTuple, + ChannelOpenAckEvent.OutputObject + >; + + "ChannelOpenAckError(address,bytes)": TypedContractEvent< + ChannelOpenAckErrorEvent.InputTuple, + ChannelOpenAckErrorEvent.OutputTuple, + ChannelOpenAckErrorEvent.OutputObject + >; + ChannelOpenAckError: TypedContractEvent< + ChannelOpenAckErrorEvent.InputTuple, + ChannelOpenAckErrorEvent.OutputTuple, + ChannelOpenAckErrorEvent.OutputObject + >; + + "ChannelOpenConfirm(address,bytes32)": TypedContractEvent< + ChannelOpenConfirmEvent.InputTuple, + ChannelOpenConfirmEvent.OutputTuple, + ChannelOpenConfirmEvent.OutputObject + >; + ChannelOpenConfirm: TypedContractEvent< + ChannelOpenConfirmEvent.InputTuple, + ChannelOpenConfirmEvent.OutputTuple, + ChannelOpenConfirmEvent.OutputObject + >; + + "ChannelOpenConfirmError(address,bytes)": TypedContractEvent< + ChannelOpenConfirmErrorEvent.InputTuple, + ChannelOpenConfirmErrorEvent.OutputTuple, + ChannelOpenConfirmErrorEvent.OutputObject + >; + ChannelOpenConfirmError: TypedContractEvent< + ChannelOpenConfirmErrorEvent.InputTuple, + ChannelOpenConfirmErrorEvent.OutputTuple, + ChannelOpenConfirmErrorEvent.OutputObject + >; + + "ChannelOpenInit(address,string,uint8,bool,string[],string)": TypedContractEvent< + ChannelOpenInitEvent.InputTuple, + ChannelOpenInitEvent.OutputTuple, + ChannelOpenInitEvent.OutputObject + >; + ChannelOpenInit: TypedContractEvent< + ChannelOpenInitEvent.InputTuple, + ChannelOpenInitEvent.OutputTuple, + ChannelOpenInitEvent.OutputObject + >; + + "ChannelOpenInitError(address,bytes)": TypedContractEvent< + ChannelOpenInitErrorEvent.InputTuple, + ChannelOpenInitErrorEvent.OutputTuple, + ChannelOpenInitErrorEvent.OutputObject + >; + ChannelOpenInitError: TypedContractEvent< + ChannelOpenInitErrorEvent.InputTuple, + ChannelOpenInitErrorEvent.OutputTuple, + ChannelOpenInitErrorEvent.OutputObject + >; + + "ChannelOpenTry(address,string,uint8,bool,string[],string,bytes32)": TypedContractEvent< + ChannelOpenTryEvent.InputTuple, + ChannelOpenTryEvent.OutputTuple, + ChannelOpenTryEvent.OutputObject + >; + ChannelOpenTry: TypedContractEvent< + ChannelOpenTryEvent.InputTuple, + ChannelOpenTryEvent.OutputTuple, + ChannelOpenTryEvent.OutputObject + >; + + "ChannelOpenTryError(address,bytes)": TypedContractEvent< + ChannelOpenTryErrorEvent.InputTuple, + ChannelOpenTryErrorEvent.OutputTuple, + ChannelOpenTryErrorEvent.OutputObject + >; + ChannelOpenTryError: TypedContractEvent< + ChannelOpenTryErrorEvent.InputTuple, + ChannelOpenTryErrorEvent.OutputTuple, + ChannelOpenTryErrorEvent.OutputObject + >; + + "Initialized(uint8)": TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + Initialized: TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + "RecvPacket(address,bytes32,uint64)": TypedContractEvent< + RecvPacketEvent.InputTuple, + RecvPacketEvent.OutputTuple, + RecvPacketEvent.OutputObject + >; + RecvPacket: TypedContractEvent< + RecvPacketEvent.InputTuple, + RecvPacketEvent.OutputTuple, + RecvPacketEvent.OutputObject + >; + + "SendPacket(address,bytes32,bytes,uint64,uint64)": TypedContractEvent< + SendPacketEvent.InputTuple, + SendPacketEvent.OutputTuple, + SendPacketEvent.OutputObject + >; + SendPacket: TypedContractEvent< + SendPacketEvent.InputTuple, + SendPacketEvent.OutputTuple, + SendPacketEvent.OutputObject + >; + + "Timeout(address,bytes32,uint64)": TypedContractEvent< + TimeoutEvent.InputTuple, + TimeoutEvent.OutputTuple, + TimeoutEvent.OutputObject + >; + Timeout: TypedContractEvent< + TimeoutEvent.InputTuple, + TimeoutEvent.OutputTuple, + TimeoutEvent.OutputObject + >; + + "TimeoutError(address,bytes)": TypedContractEvent< + TimeoutErrorEvent.InputTuple, + TimeoutErrorEvent.OutputTuple, + TimeoutErrorEvent.OutputObject + >; + TimeoutError: TypedContractEvent< + TimeoutErrorEvent.InputTuple, + TimeoutErrorEvent.OutputTuple, + TimeoutErrorEvent.OutputObject + >; + + "Upgraded(address)": TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + Upgraded: TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + + "WriteAckPacket(address,bytes32,uint64,tuple)": TypedContractEvent< + WriteAckPacketEvent.InputTuple, + WriteAckPacketEvent.OutputTuple, + WriteAckPacketEvent.OutputObject + >; + WriteAckPacket: TypedContractEvent< + WriteAckPacketEvent.InputTuple, + WriteAckPacketEvent.OutputTuple, + WriteAckPacketEvent.OutputObject + >; + + "WriteTimeoutPacket(address,bytes32,uint64,tuple,uint64)": TypedContractEvent< + WriteTimeoutPacketEvent.InputTuple, + WriteTimeoutPacketEvent.OutputTuple, + WriteTimeoutPacketEvent.OutputObject + >; + WriteTimeoutPacket: TypedContractEvent< + WriteTimeoutPacketEvent.InputTuple, + WriteTimeoutPacketEvent.OutputTuple, + WriteTimeoutPacketEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/DummyLightClient.ts b/src/evm/contracts/DummyLightClient.ts new file mode 100644 index 00000000..f3dfbec3 --- /dev/null +++ b/src/evm/contracts/DummyLightClient.ts @@ -0,0 +1,272 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export interface DummyLightClientInterface extends Interface { + getFunction( + nameOrSignature: + | "addOpConsensusState" + | "getFraudProofEndtime" + | "getState" + | "verifyMembership" + | "verifyNonMembership" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "addOpConsensusState", + values: [L1HeaderStruct, OpL2StateProofStruct, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getFraudProofEndtime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [Ics23ProofStruct, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [Ics23ProofStruct, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "addOpConsensusState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFraudProofEndtime", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; +} + +export interface DummyLightClient extends BaseContract { + connect(runner?: ContractRunner | null): DummyLightClient; + waitForDeployment(): Promise; + + interface: DummyLightClientInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + addOpConsensusState: TypedContractMethod< + [ + arg0: L1HeaderStruct, + arg1: OpL2StateProofStruct, + arg2: BigNumberish, + arg3: BigNumberish + ], + [[bigint, boolean] & { endTime: bigint; ended: boolean }], + "view" + >; + + getFraudProofEndtime: TypedContractMethod< + [arg0: BigNumberish], + [bigint], + "view" + >; + + getState: TypedContractMethod< + [arg0: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndtime: bigint; + ended: boolean; + } + ], + "view" + >; + + verifyMembership: TypedContractMethod< + [proof: Ics23ProofStruct, arg1: BytesLike, arg2: BytesLike], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [proof: Ics23ProofStruct, arg1: BytesLike], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "addOpConsensusState" + ): TypedContractMethod< + [ + arg0: L1HeaderStruct, + arg1: OpL2StateProofStruct, + arg2: BigNumberish, + arg3: BigNumberish + ], + [[bigint, boolean] & { endTime: bigint; ended: boolean }], + "view" + >; + getFunction( + nameOrSignature: "getFraudProofEndtime" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getState" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndtime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, arg1: BytesLike, arg2: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, arg1: BytesLike], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/DummyProofVerifier.ts b/src/evm/contracts/DummyProofVerifier.ts new file mode 100644 index 00000000..777e2000 --- /dev/null +++ b/src/evm/contracts/DummyProofVerifier.ts @@ -0,0 +1,231 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export interface DummyProofVerifierInterface extends Interface { + getFunction( + nameOrSignature: + | "verifyMembership" + | "verifyNonMembership" + | "verifyStateUpdate" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "verifyMembership", + values: [BytesLike, BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyStateUpdate", + values: [ + L1HeaderStruct, + OpL2StateProofStruct, + BytesLike, + BytesLike, + BigNumberish + ] + ): string; + + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyStateUpdate", + data: BytesLike + ): Result; +} + +export interface DummyProofVerifier extends BaseContract { + connect(runner?: ContractRunner | null): DummyProofVerifier; + waitForDeployment(): Promise; + + interface: DummyProofVerifierInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + verifyMembership: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: BytesLike, arg3: Ics23ProofStruct], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + + verifyStateUpdate: TypedContractMethod< + [ + arg0: L1HeaderStruct, + arg1: OpL2StateProofStruct, + arg2: BytesLike, + arg3: BytesLike, + arg4: BigNumberish + ], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: BytesLike, arg3: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyStateUpdate" + ): TypedContractMethod< + [ + arg0: L1HeaderStruct, + arg1: OpL2StateProofStruct, + arg2: BytesLike, + arg3: BytesLike, + arg4: BigNumberish + ], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/ERC1967Proxy.ts b/src/evm/contracts/ERC1967Proxy.ts new file mode 100644 index 00000000..0ef8f02b --- /dev/null +++ b/src/evm/contracts/ERC1967Proxy.ts @@ -0,0 +1,168 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + FunctionFragment, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, +} from "./common"; + +export interface ERC1967ProxyInterface extends Interface { + getEvent( + nameOrSignatureOrTopic: "AdminChanged" | "BeaconUpgraded" | "Upgraded" + ): EventFragment; +} + +export namespace AdminChangedEvent { + export type InputTuple = [previousAdmin: AddressLike, newAdmin: AddressLike]; + export type OutputTuple = [previousAdmin: string, newAdmin: string]; + export interface OutputObject { + previousAdmin: string; + newAdmin: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace BeaconUpgradedEvent { + export type InputTuple = [beacon: AddressLike]; + export type OutputTuple = [beacon: string]; + export interface OutputObject { + beacon: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UpgradedEvent { + export type InputTuple = [implementation: AddressLike]; + export type OutputTuple = [implementation: string]; + export interface OutputObject { + implementation: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface ERC1967Proxy extends BaseContract { + connect(runner?: ContractRunner | null): ERC1967Proxy; + waitForDeployment(): Promise; + + interface: ERC1967ProxyInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + getFunction( + key: string | FunctionFragment + ): T; + + getEvent( + key: "AdminChanged" + ): TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + getEvent( + key: "BeaconUpgraded" + ): TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + getEvent( + key: "Upgraded" + ): TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + + filters: { + "AdminChanged(address,address)": TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + AdminChanged: TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + + "BeaconUpgraded(address)": TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + BeaconUpgraded: TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + + "Upgraded(address)": TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + Upgraded: TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Earth.ts b/src/evm/contracts/Earth.ts new file mode 100644 index 00000000..58fabb4e --- /dev/null +++ b/src/evm/contracts/Earth.ts @@ -0,0 +1,451 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type UniversalPacketStruct = { + srcPortAddr: BytesLike; + mwBitmap: BigNumberish; + destPortAddr: BytesLike; + appData: BytesLike; +}; + +export type UniversalPacketStructOutput = [ + srcPortAddr: string, + mwBitmap: bigint, + destPortAddr: string, + appData: string +] & { + srcPortAddr: string; + mwBitmap: bigint; + destPortAddr: string; + appData: string; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface EarthInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "authorizeMiddleware" + | "authorizedMws" + | "generateAckPacket" + | "greet" + | "mw" + | "onRecvUniversalPacket" + | "onTimeoutUniversalPacket" + | "onUniversalAcknowledgement" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "setDefaultMw" + | "timeoutPackets" + | "transferOwnership" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "authorizeMiddleware", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "authorizedMws", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "generateAckPacket", + values: [BytesLike, AddressLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [AddressLike, BytesLike, BytesLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "mw", values?: undefined): string; + encodeFunctionData( + functionFragment: "onRecvUniversalPacket", + values: [BytesLike, UniversalPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutUniversalPacket", + values: [BytesLike, UniversalPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onUniversalAcknowledgement", + values: [BytesLike, UniversalPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setDefaultMw", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "authorizeMiddleware", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "authorizedMws", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "generateAckPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mw", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onRecvUniversalPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutUniversalPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onUniversalAcknowledgement", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setDefaultMw", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface Earth extends BaseContract { + connect(runner?: ContractRunner | null): Earth; + waitForDeployment(): Promise; + + interface: EarthInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput, AckPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + ack: AckPacketStructOutput; + } + ], + "view" + >; + + authorizeMiddleware: TypedContractMethod< + [middleware: AddressLike], + [void], + "nonpayable" + >; + + authorizedMws: TypedContractMethod<[arg0: AddressLike], [boolean], "view">; + + generateAckPacket: TypedContractMethod< + [arg0: BytesLike, srcPortAddr: AddressLike, appData: BytesLike], + [AckPacketStructOutput], + "view" + >; + + greet: TypedContractMethod< + [ + destPortAddr: AddressLike, + channelId: BytesLike, + message: BytesLike, + timeoutTimestamp: BigNumberish + ], + [void], + "nonpayable" + >; + + mw: TypedContractMethod<[], [string], "view">; + + onRecvUniversalPacket: TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + + onTimeoutUniversalPacket: TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct], + [void], + "nonpayable" + >; + + onUniversalAcknowledgement: TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + setDefaultMw: TypedContractMethod< + [_middleware: AddressLike], + [void], + "nonpayable" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput, AckPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + ack: AckPacketStructOutput; + } + ], + "view" + >; + getFunction( + nameOrSignature: "authorizeMiddleware" + ): TypedContractMethod<[middleware: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "authorizedMws" + ): TypedContractMethod<[arg0: AddressLike], [boolean], "view">; + getFunction( + nameOrSignature: "generateAckPacket" + ): TypedContractMethod< + [arg0: BytesLike, srcPortAddr: AddressLike, appData: BytesLike], + [AckPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [ + destPortAddr: AddressLike, + channelId: BytesLike, + message: BytesLike, + timeoutTimestamp: BigNumberish + ], + [void], + "nonpayable" + >; + getFunction(nameOrSignature: "mw"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "onRecvUniversalPacket" + ): TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + getFunction( + nameOrSignature: "onTimeoutUniversalPacket" + ): TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onUniversalAcknowledgement" + ): TypedContractMethod< + [channelId: BytesLike, packet: UniversalPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "setDefaultMw" + ): TypedContractMethod<[_middleware: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [string, UniversalPacketStructOutput] & { + channelId: string; + packet: UniversalPacketStructOutput; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Ibc.ts b/src/evm/contracts/Ibc.ts new file mode 100644 index 00000000..6bd6c96b --- /dev/null +++ b/src/evm/contracts/Ibc.ts @@ -0,0 +1,373 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface IbcInterface extends Interface { + getFunction( + nameOrSignature: + | "_hexStrToAddress" + | "ackProofKey" + | "ackProofValue" + | "channelProofKey" + | "channelProofKeyMemory" + | "channelProofValue" + | "channelProofValueMemory" + | "packetCommitmentProofKey" + | "packetCommitmentProofValue" + | "parseAckData" + | "toStr(bytes32)" + | "toStr(uint256)" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "_hexStrToAddress", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "ackProofKey", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "ackProofValue", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "channelProofKey", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "channelProofKeyMemory", + values: [string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "channelProofValue", + values: [BigNumberish, BigNumberish, string, string[], string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "channelProofValueMemory", + values: [BigNumberish, BigNumberish, string, string[], string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "packetCommitmentProofKey", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "packetCommitmentProofValue", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "parseAckData", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "toStr(bytes32)", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "toStr(uint256)", + values: [BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "_hexStrToAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "ackProofKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "ackProofValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelProofKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelProofKeyMemory", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelProofValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "channelProofValueMemory", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "packetCommitmentProofKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "packetCommitmentProofValue", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "parseAckData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "toStr(bytes32)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "toStr(uint256)", + data: BytesLike + ): Result; +} + +export interface Ibc extends BaseContract { + connect(runner?: ContractRunner | null): Ibc; + waitForDeployment(): Promise; + + interface: IbcInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + _hexStrToAddress: TypedContractMethod<[hexStr: string], [string], "view">; + + ackProofKey: TypedContractMethod<[packet: IbcPacketStruct], [string], "view">; + + ackProofValue: TypedContractMethod<[ack: BytesLike], [string], "view">; + + channelProofKey: TypedContractMethod< + [portId: string, channelId: BytesLike], + [string], + "view" + >; + + channelProofKeyMemory: TypedContractMethod< + [portId: string, channelId: BytesLike], + [string], + "view" + >; + + channelProofValue: TypedContractMethod< + [ + state: BigNumberish, + ordering: BigNumberish, + version: string, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: BytesLike + ], + [string], + "view" + >; + + channelProofValueMemory: TypedContractMethod< + [ + state: BigNumberish, + ordering: BigNumberish, + version: string, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: BytesLike + ], + [string], + "view" + >; + + packetCommitmentProofKey: TypedContractMethod< + [packet: IbcPacketStruct], + [string], + "view" + >; + + packetCommitmentProofValue: TypedContractMethod< + [packet: IbcPacketStruct], + [string], + "view" + >; + + parseAckData: TypedContractMethod< + [ack: BytesLike], + [AckPacketStructOutput], + "view" + >; + + "toStr(bytes32)": TypedContractMethod<[b: BytesLike], [string], "view">; + + "toStr(uint256)": TypedContractMethod< + [_number: BigNumberish], + [string], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "_hexStrToAddress" + ): TypedContractMethod<[hexStr: string], [string], "view">; + getFunction( + nameOrSignature: "ackProofKey" + ): TypedContractMethod<[packet: IbcPacketStruct], [string], "view">; + getFunction( + nameOrSignature: "ackProofValue" + ): TypedContractMethod<[ack: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "channelProofKey" + ): TypedContractMethod< + [portId: string, channelId: BytesLike], + [string], + "view" + >; + getFunction( + nameOrSignature: "channelProofKeyMemory" + ): TypedContractMethod< + [portId: string, channelId: BytesLike], + [string], + "view" + >; + getFunction( + nameOrSignature: "channelProofValue" + ): TypedContractMethod< + [ + state: BigNumberish, + ordering: BigNumberish, + version: string, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: BytesLike + ], + [string], + "view" + >; + getFunction( + nameOrSignature: "channelProofValueMemory" + ): TypedContractMethod< + [ + state: BigNumberish, + ordering: BigNumberish, + version: string, + connectionHops: string[], + counterpartyPortId: string, + counterpartyChannelId: BytesLike + ], + [string], + "view" + >; + getFunction( + nameOrSignature: "packetCommitmentProofKey" + ): TypedContractMethod<[packet: IbcPacketStruct], [string], "view">; + getFunction( + nameOrSignature: "packetCommitmentProofValue" + ): TypedContractMethod<[packet: IbcPacketStruct], [string], "view">; + getFunction( + nameOrSignature: "parseAckData" + ): TypedContractMethod<[ack: BytesLike], [AckPacketStructOutput], "view">; + getFunction( + nameOrSignature: "toStr(bytes32)" + ): TypedContractMethod<[b: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "toStr(uint256)" + ): TypedContractMethod<[_number: BigNumberish], [string], "view">; + + filters: {}; +} diff --git a/src/evm/contracts/IbcUtils.ts b/src/evm/contracts/IbcUtils.ts new file mode 100644 index 00000000..40327890 --- /dev/null +++ b/src/evm/contracts/IbcUtils.ts @@ -0,0 +1,133 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type UniversalPacketStruct = { + srcPortAddr: BytesLike; + mwBitmap: BigNumberish; + destPortAddr: BytesLike; + appData: BytesLike; +}; + +export type UniversalPacketStructOutput = [ + srcPortAddr: string, + mwBitmap: bigint, + destPortAddr: string, + appData: string +] & { + srcPortAddr: string; + mwBitmap: bigint; + destPortAddr: string; + appData: string; +}; + +export interface IbcUtilsInterface extends Interface { + getFunction( + nameOrSignature: "fromUniversalPacketBytes" | "hexStrToAddress" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "fromUniversalPacketBytes", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "hexStrToAddress", + values: [string] + ): string; + + decodeFunctionResult( + functionFragment: "fromUniversalPacketBytes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "hexStrToAddress", + data: BytesLike + ): Result; +} + +export interface IbcUtils extends BaseContract { + connect(runner?: ContractRunner | null): IbcUtils; + waitForDeployment(): Promise; + + interface: IbcUtilsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + fromUniversalPacketBytes: TypedContractMethod< + [data: BytesLike], + [UniversalPacketStructOutput], + "view" + >; + + hexStrToAddress: TypedContractMethod<[hexStr: string], [string], "view">; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "fromUniversalPacketBytes" + ): TypedContractMethod< + [data: BytesLike], + [UniversalPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "hexStrToAddress" + ): TypedContractMethod<[hexStr: string], [string], "view">; + + filters: {}; +} diff --git a/src/evm/contracts/Mars.sol/Mars.ts b/src/evm/contracts/Mars.sol/Mars.ts new file mode 100644 index 00000000..f58bc1af --- /dev/null +++ b/src/evm/contracts/Mars.sol/Mars.ts @@ -0,0 +1,655 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface MarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface Mars extends BaseContract { + connect(runner?: ContractRunner | null): Mars; + waitForDeployment(): Promise; + + interface: MarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/PanickingMars.ts b/src/evm/contracts/Mars.sol/PanickingMars.ts new file mode 100644 index 00000000..1730d489 --- /dev/null +++ b/src/evm/contracts/Mars.sol/PanickingMars.ts @@ -0,0 +1,655 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface PanickingMarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface PanickingMars extends BaseContract { + connect(runner?: ContractRunner | null): PanickingMars; + waitForDeployment(): Promise; + + interface: PanickingMarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/RevertingBytesMars.ts b/src/evm/contracts/Mars.sol/RevertingBytesMars.ts new file mode 100644 index 00000000..9ad12c61 --- /dev/null +++ b/src/evm/contracts/Mars.sol/RevertingBytesMars.ts @@ -0,0 +1,651 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface RevertingBytesMarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface RevertingBytesMars extends BaseContract { + connect(runner?: ContractRunner | null): RevertingBytesMars; + waitForDeployment(): Promise; + + interface: RevertingBytesMarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + + onTimeoutPacket: TypedContractMethod<[arg0: IbcPacketStruct], [void], "view">; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[arg0: IbcPacketStruct], [void], "view">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/RevertingEmptyMars.ts b/src/evm/contracts/Mars.sol/RevertingEmptyMars.ts new file mode 100644 index 00000000..eb3b053c --- /dev/null +++ b/src/evm/contracts/Mars.sol/RevertingEmptyMars.ts @@ -0,0 +1,655 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface RevertingEmptyMarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface RevertingEmptyMars extends BaseContract { + connect(runner?: ContractRunner | null): RevertingEmptyMars; + waitForDeployment(): Promise; + + interface: RevertingEmptyMarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/RevertingStringCloseChannelMars.ts b/src/evm/contracts/Mars.sol/RevertingStringCloseChannelMars.ts new file mode 100644 index 00000000..91c9afe5 --- /dev/null +++ b/src/evm/contracts/Mars.sol/RevertingStringCloseChannelMars.ts @@ -0,0 +1,655 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface RevertingStringCloseChannelMarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface RevertingStringCloseChannelMars extends BaseContract { + connect(runner?: ContractRunner | null): RevertingStringCloseChannelMars; + waitForDeployment(): Promise; + + interface: RevertingStringCloseChannelMarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [arg0: BytesLike, arg1: string, arg2: BytesLike], + [void], + "view" + >; + + onChanCloseInit: TypedContractMethod< + [arg0: BytesLike, arg1: string, arg2: BytesLike], + [void], + "view" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [arg0: BytesLike, arg1: string, arg2: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [arg0: BytesLike, arg1: string, arg2: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/RevertingStringMars.ts b/src/evm/contracts/Mars.sol/RevertingStringMars.ts new file mode 100644 index 00000000..c71bd0ec --- /dev/null +++ b/src/evm/contracts/Mars.sol/RevertingStringMars.ts @@ -0,0 +1,655 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface RevertingStringMarsInterface extends Interface { + getFunction( + nameOrSignature: + | "ackPackets" + | "connectedChannels" + | "dispatcher" + | "greet" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "owner" + | "recvedPackets" + | "renounceOwnership" + | "supportedVersions" + | "timeoutPackets" + | "transferOwnership" + | "triggerChannelClose" + | "triggerChannelInit" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + + encodeFunctionData( + functionFragment: "ackPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "connectedChannels", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "greet", + values: [string, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "recvedPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "supportedVersions", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "timeoutPackets", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelClose", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "triggerChannelInit", + values: [string, BigNumberish, boolean, string[], string] + ): string; + + decodeFunctionResult(functionFragment: "ackPackets", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "connectedChannels", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "greet", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "recvedPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "supportedVersions", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "timeoutPackets", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelClose", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "triggerChannelInit", + data: BytesLike + ): Result; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface RevertingStringMars extends BaseContract { + connect(runner?: ContractRunner | null): RevertingStringMars; + waitForDeployment(): Promise; + + interface: RevertingStringMarsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + ackPackets: TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + + connectedChannels: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + greet: TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [arg0: IbcPacketStruct, arg1: AckPacketStruct], + [void], + "view" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: string], + [void], + "view" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, arg3: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + + onRecvPacket: TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + recvedPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + supportedVersions: TypedContractMethod< + [arg0: BigNumberish], + [string], + "view" + >; + + timeoutPackets: TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + triggerChannelClose: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + triggerChannelInit: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "ackPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [[boolean, string] & { success: boolean; data: string }], + "view" + >; + getFunction( + nameOrSignature: "connectedChannels" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "greet" + ): TypedContractMethod< + [message: string, channelId: BytesLike, timeoutTimestamp: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct, arg1: AckPacketStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: string], + [void], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, arg3: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [arg0: IbcPacketStruct], + [AckPacketStructOutput], + "view" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "recvedPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "supportedVersions" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "timeoutPackets" + ): TypedContractMethod< + [arg0: BigNumberish], + [ + [ + IbcEndpointStructOutput, + IbcEndpointStructOutput, + bigint, + string, + HeightStructOutput, + bigint + ] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelClose" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "triggerChannelInit" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortId: string + ], + [void], + "nonpayable" + >; + + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + filters: { + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/Mars.sol/index.ts b/src/evm/contracts/Mars.sol/index.ts new file mode 100644 index 00000000..e8f9b278 --- /dev/null +++ b/src/evm/contracts/Mars.sol/index.ts @@ -0,0 +1,9 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { Mars } from "./Mars"; +export type { PanickingMars } from "./PanickingMars"; +export type { RevertingBytesMars } from "./RevertingBytesMars"; +export type { RevertingEmptyMars } from "./RevertingEmptyMars"; +export type { RevertingStringCloseChannelMars } from "./RevertingStringCloseChannelMars"; +export type { RevertingStringMars } from "./RevertingStringMars"; diff --git a/src/evm/contracts/OpLightClient.sol/OptimisticLightClient.ts b/src/evm/contracts/OpLightClient.sol/OptimisticLightClient.ts new file mode 100644 index 00000000..82c814c7 --- /dev/null +++ b/src/evm/contracts/OpLightClient.sol/OptimisticLightClient.ts @@ -0,0 +1,374 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "../common"; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export interface OptimisticLightClientInterface extends Interface { + getFunction( + nameOrSignature: + | "addOpConsensusState" + | "consensusStates" + | "fraudProofEndtime" + | "fraudProofWindowSeconds" + | "getFraudProofEndtime" + | "getInternalState" + | "getState" + | "l1BlockProvider" + | "verifier" + | "verifyMembership" + | "verifyNonMembership" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "addOpConsensusState", + values: [L1HeaderStruct, OpL2StateProofStruct, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "consensusStates", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fraudProofEndtime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fraudProofWindowSeconds", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getFraudProofEndtime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getInternalState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "l1BlockProvider", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "verifier", values?: undefined): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [Ics23ProofStruct, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [Ics23ProofStruct, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "addOpConsensusState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "consensusStates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fraudProofEndtime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fraudProofWindowSeconds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFraudProofEndtime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInternalState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "l1BlockProvider", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; +} + +export interface OptimisticLightClient extends BaseContract { + connect(runner?: ContractRunner | null): OptimisticLightClient; + waitForDeployment(): Promise; + + interface: OptimisticLightClientInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + addOpConsensusState: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + + consensusStates: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + fraudProofEndtime: TypedContractMethod< + [arg0: BigNumberish], + [bigint], + "view" + >; + + fraudProofWindowSeconds: TypedContractMethod<[], [bigint], "view">; + + getFraudProofEndtime: TypedContractMethod< + [height: BigNumberish], + [bigint], + "view" + >; + + getInternalState: TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + + getState: TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + + l1BlockProvider: TypedContractMethod<[], [string], "view">; + + verifier: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "addOpConsensusState" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + getFunction( + nameOrSignature: "consensusStates" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "fraudProofEndtime" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "fraudProofWindowSeconds" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getFraudProofEndtime" + ): TypedContractMethod<[height: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getInternalState" + ): TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getState" + ): TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "l1BlockProvider" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifier" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/OpLightClient.sol/index.ts b/src/evm/contracts/OpLightClient.sol/index.ts new file mode 100644 index 00000000..c966f94f --- /dev/null +++ b/src/evm/contracts/OpLightClient.sol/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { OptimisticLightClient } from "./OptimisticLightClient"; diff --git a/src/evm/contracts/OpProofVerifier.ts b/src/evm/contracts/OpProofVerifier.ts new file mode 100644 index 00000000..734d8dda --- /dev/null +++ b/src/evm/contracts/OpProofVerifier.ts @@ -0,0 +1,255 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export interface OpProofVerifierInterface extends Interface { + getFunction( + nameOrSignature: + | "l2OutputOracleAddress" + | "verifyMembership" + | "verifyNonMembership" + | "verifyStateUpdate" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "l2OutputOracleAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [BytesLike, BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyStateUpdate", + values: [ + L1HeaderStruct, + OpL2StateProofStruct, + BytesLike, + BytesLike, + BigNumberish + ] + ): string; + + decodeFunctionResult( + functionFragment: "l2OutputOracleAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyStateUpdate", + data: BytesLike + ): Result; +} + +export interface OpProofVerifier extends BaseContract { + connect(runner?: ContractRunner | null): OpProofVerifier; + waitForDeployment(): Promise; + + interface: OpProofVerifierInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + l2OutputOracleAddress: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + + verifyStateUpdate: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "l2OutputOracleAddress" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyStateUpdate" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/OptimisticLightClient.ts b/src/evm/contracts/OptimisticLightClient.ts new file mode 100644 index 00000000..b88eff47 --- /dev/null +++ b/src/evm/contracts/OptimisticLightClient.ts @@ -0,0 +1,374 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export interface OptimisticLightClientInterface extends Interface { + getFunction( + nameOrSignature: + | "addOpConsensusState" + | "consensusStates" + | "fraudProofEndtime" + | "fraudProofWindowSeconds" + | "getFraudProofEndtime" + | "getInternalState" + | "getState" + | "l1BlockProvider" + | "verifier" + | "verifyMembership" + | "verifyNonMembership" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "addOpConsensusState", + values: [L1HeaderStruct, OpL2StateProofStruct, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "consensusStates", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fraudProofEndtime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "fraudProofWindowSeconds", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getFraudProofEndtime", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getInternalState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "l1BlockProvider", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "verifier", values?: undefined): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [Ics23ProofStruct, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [Ics23ProofStruct, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "addOpConsensusState", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "consensusStates", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fraudProofEndtime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "fraudProofWindowSeconds", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFraudProofEndtime", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInternalState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "l1BlockProvider", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; +} + +export interface OptimisticLightClient extends BaseContract { + connect(runner?: ContractRunner | null): OptimisticLightClient; + waitForDeployment(): Promise; + + interface: OptimisticLightClientInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + addOpConsensusState: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + + consensusStates: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + fraudProofEndtime: TypedContractMethod< + [arg0: BigNumberish], + [bigint], + "view" + >; + + fraudProofWindowSeconds: TypedContractMethod<[], [bigint], "view">; + + getFraudProofEndtime: TypedContractMethod< + [height: BigNumberish], + [bigint], + "view" + >; + + getInternalState: TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + + getState: TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + + l1BlockProvider: TypedContractMethod<[], [string], "view">; + + verifier: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "addOpConsensusState" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + height: BigNumberish, + appHash: BigNumberish + ], + [[bigint, boolean] & { fraudProofEndTime: bigint; ended: boolean }], + "nonpayable" + >; + getFunction( + nameOrSignature: "consensusStates" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "fraudProofEndtime" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "fraudProofWindowSeconds" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getFraudProofEndtime" + ): TypedContractMethod<[height: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getInternalState" + ): TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getState" + ): TypedContractMethod< + [height: BigNumberish], + [ + [bigint, bigint, boolean] & { + appHash: bigint; + fraudProofEndTime: bigint; + ended: boolean; + } + ], + "view" + >; + getFunction( + nameOrSignature: "l1BlockProvider" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifier" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/OptimisticProofVerifier.ts b/src/evm/contracts/OptimisticProofVerifier.ts new file mode 100644 index 00000000..db46db96 --- /dev/null +++ b/src/evm/contracts/OptimisticProofVerifier.ts @@ -0,0 +1,255 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export interface OptimisticProofVerifierInterface extends Interface { + getFunction( + nameOrSignature: + | "l2OutputOracleAddress" + | "verifyMembership" + | "verifyNonMembership" + | "verifyStateUpdate" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "l2OutputOracleAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [BytesLike, BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyStateUpdate", + values: [ + L1HeaderStruct, + OpL2StateProofStruct, + BytesLike, + BytesLike, + BigNumberish + ] + ): string; + + decodeFunctionResult( + functionFragment: "l2OutputOracleAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyStateUpdate", + data: BytesLike + ): Result; +} + +export interface OptimisticProofVerifier extends BaseContract { + connect(runner?: ContractRunner | null): OptimisticProofVerifier; + waitForDeployment(): Promise; + + interface: OptimisticProofVerifierInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + l2OutputOracleAddress: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + + verifyStateUpdate: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "l2OutputOracleAddress" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyStateUpdate" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/ProofVerifier.ts b/src/evm/contracts/ProofVerifier.ts new file mode 100644 index 00000000..7fed446a --- /dev/null +++ b/src/evm/contracts/ProofVerifier.ts @@ -0,0 +1,241 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export type L1HeaderStruct = { + header: BytesLike[]; + stateRoot: BytesLike; + number: BigNumberish; +}; + +export type L1HeaderStructOutput = [ + header: string[], + stateRoot: string, + number: bigint +] & { header: string[]; stateRoot: string; number: bigint }; + +export type OpL2StateProofStruct = { + accountProof: BytesLike[]; + outputRootProof: BytesLike[]; + l2OutputProposalKey: BytesLike; + l2BlockHash: BytesLike; +}; + +export type OpL2StateProofStructOutput = [ + accountProof: string[], + outputRootProof: string[], + l2OutputProposalKey: string, + l2BlockHash: string +] & { + accountProof: string[]; + outputRootProof: string[]; + l2OutputProposalKey: string; + l2BlockHash: string; +}; + +export interface ProofVerifierInterface extends Interface { + getFunction( + nameOrSignature: + | "verifyMembership" + | "verifyNonMembership" + | "verifyStateUpdate" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "verifyMembership", + values: [BytesLike, BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyStateUpdate", + values: [ + L1HeaderStruct, + OpL2StateProofStruct, + BytesLike, + BytesLike, + BigNumberish + ] + ): string; + + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyStateUpdate", + data: BytesLike + ): Result; +} + +export interface ProofVerifier extends BaseContract { + connect(runner?: ContractRunner | null): ProofVerifier; + waitForDeployment(): Promise; + + interface: ProofVerifierInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + verifyMembership: TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proof: Ics23ProofStruct + ], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [appHash: BytesLike, key: BytesLike, proof: Ics23ProofStruct], + [void], + "view" + >; + + verifyStateUpdate: TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proof: Ics23ProofStruct + ], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [appHash: BytesLike, key: BytesLike, proof: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyStateUpdate" + ): TypedContractMethod< + [ + l1header: L1HeaderStruct, + proof: OpL2StateProofStruct, + appHash: BytesLike, + trustedL1BlockHash: BytesLike, + trustedL1BlockNumber: BigNumberish + ], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/UniversalChannelHandler.ts b/src/evm/contracts/UniversalChannelHandler.ts new file mode 100644 index 00000000..7f5f7fbe --- /dev/null +++ b/src/evm/contracts/UniversalChannelHandler.ts @@ -0,0 +1,769 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type IbcEndpointStruct = { portId: string; channelId: BytesLike }; + +export type IbcEndpointStructOutput = [portId: string, channelId: string] & { + portId: string; + channelId: string; +}; + +export type HeightStruct = { + revision_number: BigNumberish; + revision_height: BigNumberish; +}; + +export type HeightStructOutput = [ + revision_number: bigint, + revision_height: bigint +] & { revision_number: bigint; revision_height: bigint }; + +export type IbcPacketStruct = { + src: IbcEndpointStruct; + dest: IbcEndpointStruct; + sequence: BigNumberish; + data: BytesLike; + timeoutHeight: HeightStruct; + timeoutTimestamp: BigNumberish; +}; + +export type IbcPacketStructOutput = [ + src: IbcEndpointStructOutput, + dest: IbcEndpointStructOutput, + sequence: bigint, + data: string, + timeoutHeight: HeightStructOutput, + timeoutTimestamp: bigint +] & { + src: IbcEndpointStructOutput; + dest: IbcEndpointStructOutput; + sequence: bigint; + data: string; + timeoutHeight: HeightStructOutput; + timeoutTimestamp: bigint; +}; + +export type AckPacketStruct = { success: boolean; data: BytesLike }; + +export type AckPacketStructOutput = [success: boolean, data: string] & { + success: boolean; + data: string; +}; + +export interface UniversalChannelHandlerInterface extends Interface { + getFunction( + nameOrSignature: + | "MW_ID" + | "VERSION" + | "closeChannel" + | "dispatcher" + | "initialize" + | "onAcknowledgementPacket" + | "onChanCloseConfirm" + | "onChanCloseInit" + | "onChanOpenAck" + | "onChanOpenConfirm" + | "onChanOpenInit" + | "onChanOpenTry" + | "onRecvPacket" + | "onTimeoutPacket" + | "openChannel" + | "owner" + | "proxiableUUID" + | "renounceOwnership" + | "sendUniversalPacket" + | "setDispatcher" + | "transferOwnership" + | "upgradeTo" + | "upgradeToAndCall" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "AdminChanged" + | "BeaconUpgraded" + | "Initialized" + | "OwnershipTransferred" + | "UCHPacketSent" + | "Upgraded" + ): EventFragment; + + encodeFunctionData(functionFragment: "MW_ID", values?: undefined): string; + encodeFunctionData(functionFragment: "VERSION", values?: undefined): string; + encodeFunctionData( + functionFragment: "closeChannel", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "dispatcher", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "onAcknowledgementPacket", + values: [IbcPacketStruct, AckPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseConfirm", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanCloseInit", + values: [BytesLike, string, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenAck", + values: [BytesLike, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenConfirm", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenInit", + values: [BigNumberish, string[], string, string] + ): string; + encodeFunctionData( + functionFragment: "onChanOpenTry", + values: [BigNumberish, string[], BytesLike, string, BytesLike, string] + ): string; + encodeFunctionData( + functionFragment: "onRecvPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "onTimeoutPacket", + values: [IbcPacketStruct] + ): string; + encodeFunctionData( + functionFragment: "openChannel", + values: [string, BigNumberish, boolean, string[], string] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "sendUniversalPacket", + values: [BytesLike, BytesLike, BytesLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setDispatcher", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "upgradeTo", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [AddressLike, BytesLike] + ): string; + + decodeFunctionResult(functionFragment: "MW_ID", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "closeChannel", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "dispatcher", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "onAcknowledgementPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanCloseInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenAck", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenConfirm", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenInit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onChanOpenTry", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onRecvPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "onTimeoutPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "openChannel", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "sendUniversalPacket", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setDispatcher", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; +} + +export namespace AdminChangedEvent { + export type InputTuple = [previousAdmin: AddressLike, newAdmin: AddressLike]; + export type OutputTuple = [previousAdmin: string, newAdmin: string]; + export interface OutputObject { + previousAdmin: string; + newAdmin: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace BeaconUpgradedEvent { + export type InputTuple = [beacon: AddressLike]; + export type OutputTuple = [beacon: string]; + export interface OutputObject { + beacon: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace InitializedEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UCHPacketSentEvent { + export type InputTuple = [source: AddressLike, destination: BytesLike]; + export type OutputTuple = [source: string, destination: string]; + export interface OutputObject { + source: string; + destination: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UpgradedEvent { + export type InputTuple = [implementation: AddressLike]; + export type OutputTuple = [implementation: string]; + export interface OutputObject { + implementation: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface UniversalChannelHandler extends BaseContract { + connect(runner?: ContractRunner | null): UniversalChannelHandler; + waitForDeployment(): Promise; + + interface: UniversalChannelHandlerInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + MW_ID: TypedContractMethod<[], [bigint], "view">; + + VERSION: TypedContractMethod<[], [string], "view">; + + closeChannel: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + dispatcher: TypedContractMethod<[], [string], "view">; + + initialize: TypedContractMethod< + [_dispatcher: AddressLike], + [void], + "nonpayable" + >; + + onAcknowledgementPacket: TypedContractMethod< + [packet: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + + onChanCloseConfirm: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanCloseInit: TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenAck: TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "view" + >; + + onChanOpenConfirm: TypedContractMethod< + [channelId: BytesLike], + [void], + "nonpayable" + >; + + onChanOpenInit: TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + + onChanOpenTry: TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "view" + >; + + onRecvPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + + onTimeoutPacket: TypedContractMethod< + [packet: IbcPacketStruct], + [void], + "nonpayable" + >; + + openChannel: TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortIdentifier: string + ], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + proxiableUUID: TypedContractMethod<[], [string], "view">; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + sendUniversalPacket: TypedContractMethod< + [ + channelId: BytesLike, + destPortAddr: BytesLike, + appData: BytesLike, + timeoutTimestamp: BigNumberish + ], + [void], + "nonpayable" + >; + + setDispatcher: TypedContractMethod< + [_dispatcher: AddressLike], + [void], + "nonpayable" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + upgradeTo: TypedContractMethod< + [newImplementation: AddressLike], + [void], + "nonpayable" + >; + + upgradeToAndCall: TypedContractMethod< + [newImplementation: AddressLike, data: BytesLike], + [void], + "payable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "MW_ID" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "VERSION" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "closeChannel" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "dispatcher" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod<[_dispatcher: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onAcknowledgementPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct, ack: AckPacketStruct], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseConfirm" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanCloseInit" + ): TypedContractMethod< + [channelId: BytesLike, arg1: string, arg2: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "onChanOpenAck" + ): TypedContractMethod< + [channelId: BytesLike, arg1: BytesLike, counterpartyVersion: string], + [void], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenConfirm" + ): TypedContractMethod<[channelId: BytesLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "onChanOpenInit" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: string[], arg2: string, version: string], + [string], + "view" + >; + getFunction( + nameOrSignature: "onChanOpenTry" + ): TypedContractMethod< + [ + arg0: BigNumberish, + arg1: string[], + channelId: BytesLike, + arg3: string, + arg4: BytesLike, + counterpartyVersion: string + ], + [string], + "view" + >; + getFunction( + nameOrSignature: "onRecvPacket" + ): TypedContractMethod< + [packet: IbcPacketStruct], + [AckPacketStructOutput], + "nonpayable" + >; + getFunction( + nameOrSignature: "onTimeoutPacket" + ): TypedContractMethod<[packet: IbcPacketStruct], [void], "nonpayable">; + getFunction( + nameOrSignature: "openChannel" + ): TypedContractMethod< + [ + version: string, + ordering: BigNumberish, + feeEnabled: boolean, + connectionHops: string[], + counterpartyPortIdentifier: string + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "proxiableUUID" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "sendUniversalPacket" + ): TypedContractMethod< + [ + channelId: BytesLike, + destPortAddr: BytesLike, + appData: BytesLike, + timeoutTimestamp: BigNumberish + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setDispatcher" + ): TypedContractMethod<[_dispatcher: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "upgradeTo" + ): TypedContractMethod< + [newImplementation: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "upgradeToAndCall" + ): TypedContractMethod< + [newImplementation: AddressLike, data: BytesLike], + [void], + "payable" + >; + + getEvent( + key: "AdminChanged" + ): TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + getEvent( + key: "BeaconUpgraded" + ): TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + getEvent( + key: "Initialized" + ): TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + getEvent( + key: "UCHPacketSent" + ): TypedContractEvent< + UCHPacketSentEvent.InputTuple, + UCHPacketSentEvent.OutputTuple, + UCHPacketSentEvent.OutputObject + >; + getEvent( + key: "Upgraded" + ): TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + + filters: { + "AdminChanged(address,address)": TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + AdminChanged: TypedContractEvent< + AdminChangedEvent.InputTuple, + AdminChangedEvent.OutputTuple, + AdminChangedEvent.OutputObject + >; + + "BeaconUpgraded(address)": TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + BeaconUpgraded: TypedContractEvent< + BeaconUpgradedEvent.InputTuple, + BeaconUpgradedEvent.OutputTuple, + BeaconUpgradedEvent.OutputObject + >; + + "Initialized(uint8)": TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + Initialized: TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + "UCHPacketSent(address,bytes32)": TypedContractEvent< + UCHPacketSentEvent.InputTuple, + UCHPacketSentEvent.OutputTuple, + UCHPacketSentEvent.OutputObject + >; + UCHPacketSent: TypedContractEvent< + UCHPacketSentEvent.InputTuple, + UCHPacketSentEvent.OutputTuple, + UCHPacketSentEvent.OutputObject + >; + + "Upgraded(address)": TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + Upgraded: TypedContractEvent< + UpgradedEvent.InputTuple, + UpgradedEvent.OutputTuple, + UpgradedEvent.OutputObject + >; + }; +} diff --git a/src/evm/contracts/common.ts b/src/evm/contracts/common.ts new file mode 100644 index 00000000..56b5f21e --- /dev/null +++ b/src/evm/contracts/common.ts @@ -0,0 +1,131 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + FunctionFragment, + Typed, + EventFragment, + ContractTransaction, + ContractTransactionResponse, + DeferredTopicFilter, + EventLog, + TransactionRequest, + LogDescription, +} from "ethers"; + +export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> + extends DeferredTopicFilter {} + +export interface TypedContractEvent< + InputTuple extends Array = any, + OutputTuple extends Array = any, + OutputObject = any +> { + (...args: Partial): TypedDeferredTopicFilter< + TypedContractEvent + >; + name: string; + fragment: EventFragment; + getFragment(...args: Partial): EventFragment; +} + +type __TypechainAOutputTuple = T extends TypedContractEvent< + infer _U, + infer W +> + ? W + : never; +type __TypechainOutputObject = T extends TypedContractEvent< + infer _U, + infer _W, + infer V +> + ? V + : never; + +export interface TypedEventLog + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export interface TypedLogDescription + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export type TypedListener = ( + ...listenerArg: [ + ...__TypechainAOutputTuple, + TypedEventLog, + ...undefined[] + ] +) => void; + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; + +export type StateMutability = "nonpayable" | "payable" | "view"; + +export type BaseOverrides = Omit; +export type NonPayableOverrides = Omit< + BaseOverrides, + "value" | "blockTag" | "enableCcipRead" +>; +export type PayableOverrides = Omit< + BaseOverrides, + "blockTag" | "enableCcipRead" +>; +export type ViewOverrides = Omit; +export type Overrides = S extends "nonpayable" + ? NonPayableOverrides + : S extends "payable" + ? PayableOverrides + : ViewOverrides; + +export type PostfixOverrides, S extends StateMutability> = + | A + | [...A, Overrides]; +export type ContractMethodArgs< + A extends Array, + S extends StateMutability +> = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>; + +export type DefaultReturnType = R extends Array ? R[0] : R; + +// export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { +export interface TypedContractMethod< + A extends Array = Array, + R = any, + S extends StateMutability = "payable" +> { + (...args: ContractMethodArgs): S extends "view" + ? Promise> + : Promise; + + name: string; + + fragment: FunctionFragment; + + getFragment(...args: ContractMethodArgs): FunctionFragment; + + populateTransaction( + ...args: ContractMethodArgs + ): Promise; + staticCall( + ...args: ContractMethodArgs + ): Promise>; + send(...args: ContractMethodArgs): Promise; + estimateGas(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; +} diff --git a/src/evm/contracts/factories/Dispatcher__factory.ts b/src/evm/contracts/factories/Dispatcher__factory.ts new file mode 100644 index 00000000..39912635 --- /dev/null +++ b/src/evm/contracts/factories/Dispatcher__factory.ts @@ -0,0 +1,2158 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { Dispatcher, DispatcherInterface } from "../Dispatcher"; + +const _abi = [ + { + type: "constructor", + inputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "acknowledgement", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "bytes", + internalType: "bytes", + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelCloseConfirm", + inputs: [ + { + name: "portAddress", + type: "address", + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelOpenAck", + inputs: [ + { + name: "local", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "counterparty", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelOpenConfirm", + inputs: [ + { + name: "local", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "counterparty", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelOpenInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "channelOpenTry", + inputs: [ + { + name: "local", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterparty", + type: "tuple", + internalType: "struct ChannelEnd", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "getChannel", + inputs: [ + { + name: "portAddress", + type: "address", + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "channel", + type: "tuple", + internalType: "struct Channel", + components: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + { + name: "counterpartyChannelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "portId", + type: "string", + internalType: "string", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getOptimisticConsensusState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + { + name: "connection", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "initialize", + inputs: [ + { + name: "initPortPrefix", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "portPrefix", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "portPrefixLen", + inputs: [], + outputs: [ + { + name: "", + type: "uint32", + internalType: "uint32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "proxiableUUID", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "removeConnection", + inputs: [ + { + name: "connection", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "sendPacket", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "setClientForConnection", + inputs: [ + { + name: "connection", + type: "string", + internalType: "string", + }, + { + name: "lightClient", + type: "address", + internalType: "contract ILightClient", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "setPortPrefix", + inputs: [ + { + name: "_portPrefix", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "timeout", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "updateClientWithOptimisticConsensusState", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "connection", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeTo", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeToAndCall", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "function", + name: "writeTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "Acknowledgement", + inputs: [ + { + name: "sourcePortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "sourceChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "sequence", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "AcknowledgementError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "AdminChanged", + inputs: [ + { + name: "previousAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + { + name: "newAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "BeaconUpgraded", + inputs: [ + { + name: "beacon", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelCloseConfirm", + inputs: [ + { + name: "portAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelCloseConfirmError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelCloseInit", + inputs: [ + { + name: "portAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelCloseInitError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenAck", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + indexed: false, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenAckError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenConfirm", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + indexed: false, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenConfirmError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenInit", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "version", + type: "string", + indexed: false, + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + indexed: false, + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + indexed: false, + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + indexed: false, + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + indexed: false, + internalType: "string", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenInitError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenTry", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "version", + type: "string", + indexed: false, + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + indexed: false, + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + indexed: false, + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + indexed: false, + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + indexed: false, + internalType: "string", + }, + { + name: "counterpartyChannelId", + type: "bytes32", + indexed: false, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ChannelOpenTryError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Initialized", + inputs: [ + { + name: "version", + type: "uint8", + indexed: false, + internalType: "uint8", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "RecvPacket", + inputs: [ + { + name: "destPortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "destChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "sequence", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "SendPacket", + inputs: [ + { + name: "sourcePortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "sourceChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "packet", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + { + name: "sequence", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + { + name: "timeoutTimestamp", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Timeout", + inputs: [ + { + name: "sourcePortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "sourceChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "sequence", + type: "uint64", + indexed: true, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "TimeoutError", + inputs: [ + { + name: "receiver", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "error", + type: "bytes", + indexed: false, + internalType: "bytes", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Upgraded", + inputs: [ + { + name: "implementation", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "WriteAckPacket", + inputs: [ + { + name: "writerPortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "writerChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "sequence", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + { + name: "ackPacket", + type: "tuple", + indexed: false, + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + anonymous: false, + }, + { + type: "event", + name: "WriteTimeoutPacket", + inputs: [ + { + name: "writerPortAddress", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "writerChannelId", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "sequence", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + { + name: "timeoutHeight", + type: "tuple", + indexed: false, + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ackPacketCommitmentAlreadyExists", + inputs: [], + }, + { + type: "error", + name: "channelIdNotFound", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + type: "error", + name: "channelNotOwnedByPortAddress", + inputs: [], + }, + { + type: "error", + name: "channelNotOwnedBySender", + inputs: [], + }, + { + type: "error", + name: "invalidAddress", + inputs: [], + }, + { + type: "error", + name: "invalidConnection", + inputs: [ + { + name: "connection", + type: "string", + internalType: "string", + }, + ], + }, + { + type: "error", + name: "invalidConnectionHops", + inputs: [], + }, + { + type: "error", + name: "invalidCounterParty", + inputs: [], + }, + { + type: "error", + name: "invalidPacketSequence", + inputs: [], + }, + { + type: "error", + name: "invalidPortPrefix", + inputs: [], + }, + { + type: "error", + name: "lightClientNotFound", + inputs: [ + { + name: "connection", + type: "string", + internalType: "string", + }, + ], + }, + { + type: "error", + name: "notEnoughGas", + inputs: [], + }, + { + type: "error", + name: "packetCommitmentNotFound", + inputs: [], + }, + { + type: "error", + name: "packetNotTimedOut", + inputs: [], + }, + { + type: "error", + name: "packetReceiptAlreadyExists", + inputs: [], + }, + { + type: "error", + name: "unexpectedPacketSequence", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60a0604052306080523480156200001557600080fd5b506001606555620000256200002b565b620000ec565b600054610100900460ff1615620000985760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000ea576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051615cc26200012460003960008181610b9701528181610be0015281816113ee0152818161142e01526114c10152615cc26000f3fe6080604052600436106101815760003560e01c8063715018a6116100d15780639f59ae711161008a578063c3e1155c11610064578063c3e1155c14610493578063f2fde38b146104b3578063f62d1888146104d3578063f90b8e96146104f357600080fd5b80639f59ae7114610433578063ba5a4d2514610453578063c00fa7c01461047357600080fd5b8063715018a6146103425780637774a6d31461035757806381bc079b146103795780638da5cb5b146103995780638dd34bb4146103c1578063940265cb146103fe57600080fd5b8063429446b61161013e578063556d517811610118578063556d5178146102c25780635d7adf96146102e25780636050b5f3146103025780636b67055e1461032257600080fd5b8063429446b61461026c5780634f1ef2861461028c57806352d1902d1461029f57600080fd5b80631eb9fc86146101865780632494546b146101a85780632bf5d19d146101df5780633659cfe6146101ff578063418925b71461021f57806342852d241461023f575b600080fd5b34801561019257600080fd5b506101a66101a1366004614276565b610513565b005b3480156101b457600080fd5b506097546101c59063ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b3480156101eb57600080fd5b506101a66101fa36600461434c565b61089d565b34801561020b57600080fd5b506101a661021a3660046143f6565b610b8d565b34801561022b57600080fd5b506101a661023a366004614454565b610c75565b34801561024b57600080fd5b5061025f61025a366004614515565b610dd5565b6040516101d69190614618565b34801561027857600080fd5b506101a6610287366004614276565b61112d565b6101a661029a36600461476b565b6113e4565b3480156102ab57600080fd5b506102b46114b4565b6040519081526020016101d6565b3480156102ce57600080fd5b506101a66102dd3660046147ce565b611567565b3480156102ee57600080fd5b506101a66102fd366004614836565b61157f565b34801561030e57600080fd5b506101a661031d366004614836565b61187d565b34801561032e57600080fd5b506101a661033d366004614836565b61188f565b34801561034e57600080fd5b506101a6611f7d565b34801561036357600080fd5b5061036c611f91565b6040516101d6919061488f565b34801561038557600080fd5b506101a66103943660046148a2565b61201f565b3480156103a557600080fd5b506033546040516001600160a01b0390911681526020016101d6565b3480156103cd57600080fd5b506103e16103dc3660046148bb565b61246d565b6040805193845260208401929092521515908201526060016101d6565b34801561040a57600080fd5b5061041e610419366004614906565b61252e565b604080519283529015156020830152016101d6565b34801561043f57600080fd5b506101a661044e3660046149af565b6125f2565b34801561045f57600080fd5b506101a661046e3660046149f0565b612647565b34801561047f57600080fd5b506101a661048e3660046149af565b612b83565b34801561049f57600080fd5b506101a66104ae366004614a94565b612bbe565b3480156104bf57600080fd5b506101a66104ce3660046143f6565b612c3c565b3480156104df57600080fd5b506101a66104ee366004614b11565b612cb2565b3480156104ff57600080fd5b506101a661050e366004614b45565b612e1a565b61051b61342f565b600285101561053d5760405163af0ba14d60e01b815260040160405180910390fd5b61056361054a8880614b9d565b60208a01356105598680614b9d565b8760200135613488565b6105c58686600081811061057957610579614be3565b905060200281019061058b9190614b9d565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134cb92505050565b6001600160a01b031663cb535ab58273__$d825222459c46c14afb2efe0967c30e98d$__634f9b0fb36105f88c80614b9d565b8d602001356040518463ffffffff1660e01b815260040161061b93929190614c22565b600060405180830381865af4158015610638573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106609190810190614c96565b73__$d825222459c46c14afb2efe0967c30e98d$__6325e0dd0e60078a8e806040019061068d9190614b9d565b8f8f6106998e80614b9d565b8f602001356040518a63ffffffff1660e01b81526004016106c299989796959493929190614d1f565b600060405180830381865af41580156106df573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107079190810190614c96565b6040518463ffffffff1660e01b815260040161072593929190614e39565b600060405180830381600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b506000925061076e915061076990508980614b9d565b613549565b90506000806107e0836301d08fc560e71b6020808e01359089013561079660408b018b614b9d565b6040516024016107a99493929190614fe7565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526135e3565b915091508115610845576107f9838b8b8b8b8b8b6136cf565b826001600160a01b03167fcf8be9ab2b5edf8beb2c45abe8e0cc7646318ac19f6c3164ba2e19e93a8a32af8b6020013560405161083891815260200190565b60405180910390a2610887565b826001600160a01b03167f971a4433f5bff5f011728a4123aeeca4b5275ac20b013cf276e65510491ac26f8260405161087e919061488f565b60405180910390a25b5050506108946001606555565b50505050505050565b6108a561342f565b60028310156108c75760405163af0ba14d60e01b815260040160405180910390fd5b6108d461054a8880614b9d565b6108ea8484600081811061057957610579614be3565b6001600160a01b031663cb535ab58273__$d825222459c46c14afb2efe0967c30e98d$__634f9b0fb361091d8c80614b9d565b8d602001356040518463ffffffff1660e01b815260040161094093929190614c22565b600060405180830381865af415801561095d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109859190810190614c96565b73__$d825222459c46c14afb2efe0967c30e98d$__6325e0dd0e60068c8e80604001906109b29190614b9d565b8d8d6109be8e80614b9d565b8f602001356040518a63ffffffff1660e01b81526004016109e799989796959493929190614d1f565b600060405180830381865af4158015610a04573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a2c9190810190614c96565b6040518463ffffffff1660e01b8152600401610a4a93929190614e39565b600060405180830381600087803b158015610a6457600080fd5b505af1158015610a78573d6000803e3d6000fd5b5060009250610a8e915061076990508980614b9d565b9050600080610ae483634bdb559760e01b8b8a8a8f602001358b8060000190610ab79190614b9d565b8d602001358e8060400190610acc9190614b9d565b6040516024016107a999989796959493929190615057565b915091508115610b5457826001600160a01b03167ff910705a7a768eb5958f281a5f84cae8bffc5dd811ca5cd303dda140a423698c82806020019051810190610b2d91906150bc565b8b8b8b8b610b3b8c80614b9d565b8d60200135604051610838989796959493929190615104565b826001600160a01b03167f9e2fe55a3b54b57f82334c273f8d048cd7f05ad19c16cf334276a8c1fec4b6fd8260405161087e919061488f565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610bde5760405162461bcd60e51b8152600401610bd59061516a565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c27600080516020615c46833981519152546001600160a01b031690565b6001600160a01b031614610c4d5760405162461bcd60e51b8152600401610bd5906151b6565b610c5681613967565b60408051600080825260208201909252610c729183919061396f565b50565b610c7d61342f565b6002831080610c8a575080155b15610ca857604051637d6ba8a560e01b815260040160405180910390fd5b600086858585858d8d604051602001610cc79796959493929190615202565b6040516020818303038152906040529050600080610d0d33637a9ccc4b60e01b85604051602001610cf9929190615259565b6040516020818303038152906040526135e3565b915091508115610d7c57336001600160a01b03167f20fd8a5856711b18d00def4aa6abafbe00ce6d60795e015cc1cad35eb9b4635982806020019051810190610d5691906150bc565b8b8b8b8b8b8b604051610d6f979695949392919061528a565b60405180910390a2610dbe565b336001600160a01b03167f69c1283cce89382f0f9ddf19b7c4f05b4d9b3c30c84fc148b1ec800284be58d582604051610db5919061488f565b60405180910390a25b505050610dcb6001606555565b5050505050505050565b610e1b6040805160e08101909152606081526020810160008152602001600015158152602001606081526020016060815260200160008019168152602001606081525090565b6001600160a01b038316600090815260986020908152604080832085845290915290819020815160e08101909252805482908290610e58906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054610e84906152da565b8015610ed15780601f10610ea657610100808354040283529160200191610ed1565b820191906000526020600020905b815481529060010190602001808311610eb457829003601f168201915b5050509183525050600182015460209091019060ff166002811115610ef857610ef8614599565b6002811115610f0957610f09614599565b81526001820154610100900460ff161515602080830191909152600283018054604080518285028101850182528281529401939260009084015b82821015610fef578382906000526020600020018054610f62906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054610f8e906152da565b8015610fdb5780601f10610fb057610100808354040283529160200191610fdb565b820191906000526020600020905b815481529060010190602001808311610fbe57829003601f168201915b505050505081526020019060010190610f43565b505050508152602001600382018054611007906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054611033906152da565b80156110805780601f1061105557610100808354040283529160200191611080565b820191906000526020600020905b81548152906001019060200180831161106357829003601f168201915b50505050508152602001600482015481526020016005820180546110a3906152da565b80601f01602080910402602001604051908101604052809291908181526020018280546110cf906152da565b801561111c5780601f106110f15761010080835404028352916020019161111c565b820191906000526020600020905b8154815290600101906020018083116110ff57829003601f168201915b505050505081525050905092915050565b61113561342f565b60028510156111575760405163af0ba14d60e01b815260040160405180910390fd5b61116461054a8880614b9d565b61117a8686600081811061057957610579614be3565b6001600160a01b031663cb535ab58273__$d825222459c46c14afb2efe0967c30e98d$__634f9b0fb36111ad8c80614b9d565b8d602001356040518463ffffffff1660e01b81526004016111d093929190614c22565b600060405180830381865af41580156111ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112159190810190614c96565b73__$d825222459c46c14afb2efe0967c30e98d$__6325e0dd0e60088a8e80604001906112429190614b9d565b8f8f61124e8e80614b9d565b8f602001356040518a63ffffffff1660e01b815260040161127799989796959493929190614d1f565b600060405180830381865af4158015611294573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112bc9190810190614c96565b6040518463ffffffff1660e01b81526004016112da93929190614e39565b600060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b506000925061131e915061076990508980614b9d565b905060008061135383633eb4a28960e21b60208d013561134160408a018a614b9d565b6040516024016107a99392919061530e565b9150915081156113ab5761136c838b8b8b8b8b8b6136cf565b826001600160a01b03167fe80f571f70f7cabf9d7ac60ece08421be374117776c311c327a083ca398f802f8b6020013560405161083891815260200190565b826001600160a01b03167ff6a58ef30f66943749e8c29c661c84da143a1c8ed017f5faa92b509e0000875a8260405161087e919061488f565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361142c5760405162461bcd60e51b8152600401610bd59061516a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611475600080516020615c46833981519152546001600160a01b031690565b6001600160a01b03161461149b5760405162461bcd60e51b8152600401610bd5906151b6565b6114a482613967565b6114b08282600161396f565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115545760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610bd5565b50600080516020615c4683398151915290565b61156f613ada565b61157a838383613b34565b505050565b61159861158f6020840184615328565b60200135613bce565b6001600160a01b031663cb535ab58273__$d825222459c46c14afb2efe0967c30e98d$__634b5728d1866040518263ffffffff1660e01b81526004016115de91906153aa565b600060405180830381865af41580156115fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116239190810190614c96565b604051637e4794ed60e11b815273__$d825222459c46c14afb2efe0967c30e98d$__9063fc8f29da9061165a9089906004016153aa565b602060405180830381865af4158015611677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169b919061546c565b6040516020016116ad91815260200190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016116da93929190614e39565b600060405180830381600087803b1580156116f457600080fd5b505af1158015611708573d6000803e3d6000fd5b5060009250611728915061171e90508480615328565b6107699080614b9d565b6001600160a01b0381166000908152609d602090815260408220929350909190829061175690870187615328565b602001358152602001908152602001600020600085604001602081019061177d9190615485565b6001600160401b0316815260208101919091526040016000205460ff16905080156117bb5760405163066c745760e01b815260040160405180910390fd5b6117e36117ce60e0860160c08701615485565b6117de60c0870160a08801615485565b613c98565b611800576040516312c9cc9f60e01b815260040160405180910390fd5b61180d6020850185615328565b602001356001600160a01b0383167fedbcd9eeb09d85c3ea1b5bf002c04478059cb261cab82c903885cefccae374bc61184c6060880160408901615485565b6080880161186060e08a0160c08b01615485565b60405161186f939291906154a0565b60405180910390a350505050565b61188561342f565b6114b06001606555565b61189761342f565b6118a761158f6020840184615328565b6001600160a01b031663cb535ab58273__$d825222459c46c14afb2efe0967c30e98d$__634b5728d1866040518263ffffffff1660e01b81526004016118ed91906153aa565b600060405180830381865af415801561190a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119329190810190614c96565b604051637e4794ed60e11b815273__$d825222459c46c14afb2efe0967c30e98d$__9063fc8f29da906119699089906004016153aa565b602060405180830381865af4158015611986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119aa919061546c565b6040516020016119bc91815260200190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016119e993929190614e39565b600060405180830381600087803b158015611a0357600080fd5b505af1158015611a17573d6000803e3d6000fd5b505050506000611a3083806020019061171e9190615328565b6001600160a01b0381166000908152609d6020908152604082209293509091908290611a5e90870187615328565b6020013581526020019081526020016000206000856040016020810190611a859190615485565b6001600160401b0316815260208101919091526040016000205460ff1690508015611ac35760405163066c745760e01b815260040160405180910390fd5b6001600160a01b0382166000908152609d6020908152604082206001929091611aee90880188615328565b6020013581526020019081526020016000206000866040016020810190611b159190615485565b6001600160401b031681526020810191909152604001600020805460ff191691151591909117905560026001600160a01b038316600090815260986020908152604082209190611b6790880188615328565b60209081013582528101919091526040016000206001015460ff166002811115611b9357611b93614599565b03611c92576001600160a01b0382166000908152609a6020908152604082209190611bc090870187615328565b60209081013582528101919091526040908101600020546001600160401b031690611bf19060608701908701615485565b6001600160401b031614611c185760405163362a414d60e01b815260040160405180910390fd5b611c286060850160408601615485565b611c339060016154d0565b6001600160a01b0383166000908152609a6020908152604082209190611c5b90880188615328565b60200135815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055505b611c9f6020850185615328565b602001356001600160a01b0383167fde5b57e6566d68a30b0979431df3d5df6db3b9aa89f8820f595b9315bf86d067611cde6060880160408901615485565b6040516001600160401b03909116815260200160405180910390a3611d0c6117ce60e0860160c08701615485565b15611d8f57611d1e6020850185615328565b602001356001600160a01b0383167fedbcd9eeb09d85c3ea1b5bf002c04478059cb261cab82c903885cefccae374bc611d5d6060880160408901615485565b60808801611d7160e08a0160c08b01615485565b604051611d80939291906154a0565b60405180910390a35050611885565b604080518082019091526000815260606020820152600080611dc485634dcc0aa660e01b896040516024016107a991906155ba565b915091508115611de95780806020019051810190611de291906155cd565b9250611e01565b60408051808201909152600081526020810182905292505b6001600160a01b0385166000908152609e602090815260408220908290611e2a908b018b615328565b6020013581526020019081526020016000206000896040016020810190611e519190615485565b6001600160401b0316815260208101919091526040016000205460ff1690508015611e8f57604051637aa549d360e01b815260040160405180910390fd5b6001600160a01b0386166000908152609e6020908152604082206001929091611eba908c018c615328565b60200135815260200190815260200160002060008a6040016020810190611ee19190615485565b6001600160401b03168152602080820192909252604001600020805460ff191692151592909217909155611f1790890189615328565b602001356001600160a01b0387167fa32e6f42b1d63fb83ad73b009a6dbb9413d1da02e95b1bb08f081815eea8db20611f5660608c0160408d01615485565b87604051611f65929190615683565b60405180910390a35050505050506114b06001606555565b611f85613ada565b611f8f6000613ce6565b565b60968054611f9e906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054611fca906152da565b80156120175780601f10611fec57610100808354040283529160200191612017565b820191906000526020600020905b815481529060010190602001808311611ffa57829003601f168201915b505050505081565b61202761342f565b336000908152609860209081526040808320848452909152808220815160e0810190925280548290829061205a906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054612086906152da565b80156120d35780601f106120a8576101008083540402835291602001916120d3565b820191906000526020600020905b8154815290600101906020018083116120b657829003601f168201915b5050509183525050600182015460209091019060ff1660028111156120fa576120fa614599565b600281111561210b5761210b614599565b81526001820154610100900460ff161515602080830191909152600283018054604080518285028101850182528281529401939260009084015b828210156121f1578382906000526020600020018054612164906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054612190906152da565b80156121dd5780601f106121b2576101008083540402835291602001916121dd565b820191906000526020600020905b8154815290600101906020018083116121c057829003601f168201915b505050505081526020019060010190612145565b505050508152602001600382018054612209906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054612235906152da565b80156122825780601f1061225757610100808354040283529160200191612282565b820191906000526020600020905b81548152906001019060200180831161226557829003601f168201915b50505050508152602001600482015481526020016005820180546122a5906152da565b80601f01602080910402602001604051908101604052809291908181526020018280546122d1906152da565b801561231e5780601f106122f35761010080835404028352916020019161231e565b820191906000526020600020905b81548152906001019060200180831161230157829003601f168201915b5050509190925250505060a081015190915061234d57604051631109bfb360e31b815260040160405180910390fd5b60008061237933631eb7dd5e60e01b8686608001518760a001516040516024016107a9939291906156a5565b33600090815260986020908152604080832089845290915281209294509092506123a38282614100565b60018201805461ffff191690556123be60028301600061413a565b6123cc600383016000614100565b60048201600090556005820160006123e49190614100565b5050811561241e57604051849033907f21372e37743553ba8e5f61239803174a827c7732d53ec8adcb76c6b3bb2c13f190600090a3612460565b336001600160a01b03167fb1be59c1bcd39c54c7132a8e0d321af5db427575ddb3265560d8862804f4381b82604051612457919061488f565b60405180910390a25b505050610c726001606555565b60008060006124b185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134cb92505050565b6001600160a01b03166344c9af28876040518263ffffffff1660e01b81526004016124de91815260200190565b606060405180830381865afa1580156124fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251f91906156ce565b92509250925093509350939050565b60008061257084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506134cb92505050565b6001600160a01b0316635922f420898989896040518563ffffffff1660e01b81526004016125a194939291906156fc565b60408051808303816000875af11580156125bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125e391906157c1565b91509150965096945050505050565b6125fa613ada565b600081900361261c5760405163e8cf362360e01b815260040160405180910390fd5b6096612629828483615837565b506097805463ffffffff191663ffffffff9290921691909117905550565b61264f61342f565b600061265e61171e8680615328565b905061266d61158f8680615328565b6001600160a01b031663cb535ab58373__$d825222459c46c14afb2efe0967c30e98d$__6311a7a373896040518263ffffffff1660e01b81526004016126b391906153aa565b600060405180830381865af41580156126d0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126f89190810190614c96565b6040516374e9704560e01b815273__$d825222459c46c14afb2efe0967c30e98d$__906374e9704590612731908b908b906004016158f7565b602060405180830381865af415801561274e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612772919061546c565b60405160200161278491815260200190565b6040516020818303038152906040526040518463ffffffff1660e01b81526004016127b193929190614e39565b600060405180830381600087803b1580156127cb57600080fd5b505af11580156127df573d6000803e3d6000fd5b505050506001600160a01b0381166000908152609c60205260408120816128068880615328565b602001358152602001908152602001600020600087604001602081019061282d9190615485565b6001600160401b0316815260208101919091526040016000205460ff1690508061286a5760405163ca89746b60e01b815260040160405180910390fd5b60008061290984637e1d42b560e01b8a73__$d825222459c46c14afb2efe0967c30e98d$__63360b8cd78c8c6040518363ffffffff1660e01b81526004016128b39291906158f7565b600060405180830381865af41580156128d0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526128f891908101906155cd565b6040516024016107a992919061590b565b915091508115612b2d5760026001600160a01b0385166000908152609860205260408120906129388b80615328565b60209081013582528101919091526040016000206001015460ff16600281111561296457612964614599565b03612a59576001600160a01b0384166000908152609b602052604081209061298c8a80615328565b60209081013582528101919091526040908101600020546001600160401b0316906129bd9060608b01908b01615485565b6001600160401b0316146129e45760405163362a414d60e01b815260040160405180910390fd5b6129f46060890160408a01615485565b6129ff9060016154d0565b6001600160a01b0385166000908152609b6020526040812090612a228b80615328565b60200135815260200190815260200160002060006101000a8154816001600160401b0302191690836001600160401b031602179055505b6001600160a01b0384166000908152609c6020526040812090612a7c8a80615328565b6020013581526020019081526020016000206000896040016020810190612aa39190615485565b6001600160401b031681526020810191909152604001600020805460ff19169055612ace8880615328565b602001356001600160a01b0385167fe46f6591236abe528fe47a3b281fb002524dadd3e62b1f317ed285d07273c3b1612b0d60608c0160408d01615485565b6040516001600160401b03909116815260200160405180910390a3612b6f565b836001600160a01b03167f625eea143c9dae6915c809da47016c22d9cd006c3ace7c345c5cbcf57d3aefbc82604051612b66919061488f565b60405180910390a25b50505050612b7d6001606555565b50505050565b612b8b613ada565b60a18282604051612b9d929190615930565b90815260405190819003602001902080546001600160a01b03191690555050565b336000908152609860209081526040808320878452909152902060040154612bf957604051631109bfb360e31b815260040160405180910390fd5b612b7d338585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250613d38915050565b612c44613ada565b6001600160a01b038116612ca95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bd5565b610c7281613ce6565b600054610100900460ff1615808015612cd25750600054600160ff909116105b80612cec5750303b158015612cec575060005460ff166001145b612d4f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bd5565b6000805460ff191660011790558015612d72576000805461ff0019166101001790555b612d7a61342f565b8151600003612d9c5760405163e8cf362360e01b815260040160405180910390fd5b612da4613e5d565b6096612db08382615940565b5081516097805463ffffffff191663ffffffff909216919091179055600160655580156114b0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b612e2261342f565b6001600160a01b038316612e495760405163cbdd34cf60e01b815260040160405180910390fd5b6001600160a01b0383166000908152609860209081526040808320858452909152808220815160e08101909252805482908290612e85906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054612eb1906152da565b8015612efe5780601f10612ed357610100808354040283529160200191612efe565b820191906000526020600020905b815481529060010190602001808311612ee157829003601f168201915b5050509183525050600182015460209091019060ff166002811115612f2557612f25614599565b6002811115612f3657612f36614599565b81526001820154610100900460ff161515602080830191909152600283018054604080518285028101850182528281529401939260009084015b8282101561301c578382906000526020600020018054612f8f906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054612fbb906152da565b80156130085780601f10612fdd57610100808354040283529160200191613008565b820191906000526020600020905b815481529060010190602001808311612feb57829003601f168201915b505050505081526020019060010190612f70565b505050508152602001600382018054613034906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054613060906152da565b80156130ad5780601f10613082576101008083540402835291602001916130ad565b820191906000526020600020905b81548152906001019060200180831161309057829003601f168201915b50505050508152602001600482015481526020016005820180546130d0906152da565b80601f01602080910402602001604051908101604052809291908181526020018280546130fc906152da565b80156131495780601f1061311e57610100808354040283529160200191613149565b820191906000526020600020905b81548152906001019060200180831161312c57829003601f168201915b5050509190925250505060a081015190915061317857604051634d93b09d60e11b815260040160405180910390fd5b61318183613bce565b6001600160a01b031663cb535ab58373__$d825222459c46c14afb2efe0967c30e98d$__636f6547268560c00151886040518363ffffffff1660e01b81526004016131cd9291906159ff565b600060405180830381865af41580156131ea573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526132129190810190614c96565b602085015185516060870151608088015160a0890151604051631f621e1560e31b815273__$d825222459c46c14afb2efe0967c30e98d$__9563fb10f0a895613268956009959294919390929190600401615a21565b600060405180830381865af4158015613285573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526132ad9190810190614c96565b6040518463ffffffff1660e01b81526004016132cb93929190614e39565b600060405180830381600087803b1580156132e557600080fd5b505af11580156132f9573d6000803e3d6000fd5b5050505060008061332986633f9fdbe460e01b8786608001518760a001516040516024016107a9939291906156a5565b6001600160a01b03881660009081526098602090815260408083208a8452909152812092945090925061335c8282614100565b60018201805461ffff1916905561337760028301600061413a565b613385600383016000614100565b600482016000905560058201600061339d9190614100565b505081156133e05760405185906001600160a01b038816907f5f010dbbd6bf46aec8131c5456301a75cd688d3cca9bc8380c9e26301be2072990600090a3613422565b856001600160a01b03167fc9d36d7a317cb116925d5cb66f0069fe825822fe23e9cf3f421c38cf444caa3082604051613419919061488f565b60405180910390a25b50505061157a6001606555565b6002606554036134815760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610bd5565b6002606555565b841580613493575081155b8061349c575083155b806134a5575080155b156134c357604051637d6ba8a560e01b815260040160405180910390fd5b505050505050565b600081516000036134f95760405163524e171160e01b81526020600482015260006024820152604401610bd5565b60a1826040516135099190615ac9565b908152604051908190036020019020546001600160a01b0316905080613544578160405163036c4d8760e11b8152600401610bd5919061488f565b919050565b60975460009073__$d825222459c46c14afb2efe0967c30e98d$__9063c91f5b3f9061357e90859063ffffffff168188615adb565b6040518363ffffffff1660e01b815260040161359b9291906158f7565b602060405180830381865af41580156135b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135dc9190615b05565b9392505050565b600060606001600160a01b0384163b61362b57505060408051808201909152601481527318d85b1b081d1bc81b9bdb8b58dbdb9d1c9858dd60621b60208201526000906136c8565b60005a9050846001600160a01b0316846040516136489190615ac9565b6000604051808303816000865af19150503d8060008114613685576040519150601f19603f3d011682016040523d82523d6000602084013e61368a565b606091505b509093509150821580156136a857506136a4604082615b22565b5a11155b156136c65760405163b08ede0960e01b815260040160405180910390fd5b505b9250929050565b6040518060e001604052808280604001906136ea9190614b9d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200184600281111561373657613736614599565b8152831515602082015260400161374d8688615b44565b815260200161375c8380614b9d565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250602083810135908201526040016137aa8880614b9d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250506001600160a01b038a1681526098602090815260408083208b83013584529091529020825190915081906138149082615940565b50602082015160018083018054909160ff199091169083600281111561383c5761383c614599565b021790555060408201516001820180549115156101000261ff00199092169190911790556060820151805161387b916002840191602090910190614158565b50608082015160038201906138909082615940565b5060a0820151600482015560c082015160058201906138af9082615940565b5050506001600160a01b03871660008181526099602090815260408083208a8301358085529083528184208054600167ffffffffffffffff199182168117909255868652609a855283862083875285528386208054821683179055958552609b845282852091855292528220805490931617909155859085908161393557613935614be3565b90506020028101906139479190614b9d565b602080890135600090815260a09091526040902091610dcb919083615837565b610c72613ada565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156139a25761157a83613e8c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156139fc575060408051601f3d908101601f191682019092526139f99181019061546c565b60015b613a5f5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610bd5565b600080516020615c468339815191528114613ace5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610bd5565b5061157a838383613f28565b6033546001600160a01b03163314611f8f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bd5565b6000829003613b605760405163524e171160e01b81526020600482015260006024820152604401610bd5565b6001600160a01b038116613b875760405163cbdd34cf60e01b815260040160405180910390fd5b8060a18484604051613b9a929190615930565b90815260405190819003602001902080546001600160a01b03929092166001600160a01b0319909216919091179055505050565b600081815260a0602052604081208054829190613bea906152da565b80601f0160208091040260200160405190810160405280929190818152602001828054613c16906152da565b8015613c635780601f10613c3857610100808354040283529160200191613c63565b820191906000526020600020905b815481529060010190602001808311613c4657829003601f168201915b505050505090508051600003613c8f576040516363b99a9d60e11b815260048101849052602401610bd5565b6135dc816134cb565b60006001600160401b03831615801590613cbb5750826001600160401b03164210155b806135dc57506001600160401b038216158015906135dc5750506001600160401b0316431015919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03841660009081526099602090815260408083208684529091528120546001600160401b031690819003613d8657604051631e510bfb60e21b815260040160405180910390fd5b6001600160a01b0385166000908152609c6020908152604080832087845282528083206001600160401b03851684529091529020805460ff19166001908117909155613dd39082906154d0565b6001600160a01b038616600081815260996020908152604080832089845290915290819020805467ffffffffffffffff19166001600160401b03949094169390931790925590518591907fb5bff96e18da044e4e34510d16df9053b9f1920f6a960732e5aaf22fe9b8013690613e4e90879086908890615bc7565b60405180910390a35050505050565b600054610100900460ff16613e845760405162461bcd60e51b8152600401610bd590615bfa565b611f8f613f4d565b6001600160a01b0381163b613ef95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610bd5565b600080516020615c4683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613f3183613f7d565b600082511180613f3e5750805b1561157a57612b7d8383613fbd565b600054610100900460ff16613f745760405162461bcd60e51b8152600401610bd590615bfa565b611f8f33613ce6565b613f8681613e8c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606135dc8383604051806060016040528060278152602001615c66602791396060600080856001600160a01b031685604051613ffa9190615ac9565b600060405180830381855af49150503d8060008114614035576040519150601f19603f3d011682016040523d82523d6000602084013e61403a565b606091505b509150915061404b86838387614055565b9695505050505050565b606083156140c45782516000036140bd576001600160a01b0385163b6140bd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bd5565b50816140ce565b6140ce83836140d6565b949350505050565b8151156140e65781518083602001fd5b8060405162461bcd60e51b8152600401610bd5919061488f565b50805461410c906152da565b6000825580601f1061411c575050565b601f016020900490600052602060002090810190610c7291906141ae565b5080546000825590600052602060002090810190610c7291906141c3565b82805482825590600052602060002090810192821561419e579160200282015b8281111561419e578251829061418e9082615940565b5091602001919060010190614178565b506141aa9291506141c3565b5090565b5b808211156141aa57600081556001016141af565b808211156141aa5760006141d78282614100565b506001016141c3565b6000606082840312156141f257600080fd5b50919050565b60008083601f84011261420a57600080fd5b5081356001600160401b0381111561422157600080fd5b6020830191508360208260051b85010111156136c857600080fd5b80356003811061354457600080fd5b8015158114610c7257600080fd5b80356135448161424b565b6000604082840312156141f257600080fd5b600080600080600080600060c0888a03121561429157600080fd5b87356001600160401b03808211156142a857600080fd5b6142b48b838c016141e0565b985060208a01359150808211156142ca57600080fd5b6142d68b838c016141f8565b90985096508691506142ea60408b0161423c565b95506142f860608b01614259565b945060808a013591508082111561430e57600080fd5b61431a8b838c016141e0565b935060a08a013591508082111561433057600080fd5b5061433d8a828b01614264565b91505092959891949750929550565b600080600080600080600060c0888a03121561436757600080fd5b87356001600160401b038082111561437e57600080fd5b61438a8b838c016141e0565b985061439860208b0161423c565b97506143a660408b01614259565b965060608a01359150808211156143bc57600080fd5b6143c88b838c016141f8565b909650945060808a013591508082111561430e57600080fd5b6001600160a01b0381168114610c7257600080fd5b60006020828403121561440857600080fd5b81356135dc816143e1565b60008083601f84011261442557600080fd5b5081356001600160401b0381111561443c57600080fd5b6020830191508360208285010111156136c857600080fd5b60008060008060008060008060a0898b03121561447057600080fd5b88356001600160401b038082111561448757600080fd5b6144938c838d01614413565b909a5098508891506144a760208c0161423c565b975060408b013591506144b98261424b565b90955060608a013590808211156144cf57600080fd5b6144db8c838d016141f8565b909650945060808b01359150808211156144f457600080fd5b506145018b828c01614413565b999c989b5096995094979396929594505050565b6000806040838503121561452857600080fd5b8235614533816143e1565b946020939093013593505050565b60005b8381101561455c578181015183820152602001614544565b83811115612b7d5750506000910152565b60008151808452614585816020860160208601614541565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b600381106145bf576145bf614599565b9052565b600081518084526020808501808196508360051b8101915082860160005b8581101561460b5782840389526145f984835161456d565b988501989350908401906001016145e1565b5091979650505050505050565b602081526000825160e0602084015261463561010084018261456d565b9050602084015161464960408501826145af565b506040840151151560608401526060840151601f198085840301608086015261467283836145c3565b925060808601519150808584030160a086015261468f838361456d565b925060a086015160c086015260c08601519150808584030160e0860152506146b7828261456d565b95945050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156146fe576146fe6146c0565b604052919050565b60006001600160401b0382111561471f5761471f6146c0565b50601f01601f191660200190565b600061474061473b84614706565b6146d6565b905082815283838301111561475457600080fd5b828260208301376000602084830101529392505050565b6000806040838503121561477e57600080fd5b8235614789816143e1565b915060208301356001600160401b038111156147a457600080fd5b8301601f810185136147b557600080fd5b6147c48582356020840161472d565b9150509250929050565b6000806000604084860312156147e357600080fd5b83356001600160401b038111156147f957600080fd5b61480586828701614413565b9094509250506020840135614819816143e1565b809150509250925092565b600060e082840312156141f257600080fd5b6000806040838503121561484957600080fd5b82356001600160401b038082111561486057600080fd5b61486c86838701614824565b9350602085013591508082111561488257600080fd5b506147c485828601614264565b6020815260006135dc602083018461456d565b6000602082840312156148b457600080fd5b5035919050565b6000806000604084860312156148d057600080fd5b8335925060208401356001600160401b038111156148ed57600080fd5b6148f986828701614413565b9497909650939450505050565b60008060008060008060a0878903121561491f57600080fd5b86356001600160401b038082111561493657600080fd5b6149428a838b016141e0565b9750602089013591508082111561495857600080fd5b908801906080828b03121561496c57600080fd5b90955060408801359450606088013593506080880135908082111561499057600080fd5b5061499d89828a01614413565b979a9699509497509295939492505050565b600080602083850312156149c257600080fd5b82356001600160401b038111156149d857600080fd5b6149e485828601614413565b90969095509350505050565b60008060008060608587031215614a0657600080fd5b84356001600160401b0380821115614a1d57600080fd5b614a2988838901614824565b95506020870135915080821115614a3f57600080fd5b614a4b88838901614413565b90955093506040870135915080821115614a6457600080fd5b50614a7187828801614264565b91505092959194509250565b80356001600160401b038116811461354457600080fd5b60008060008060608587031215614aaa57600080fd5b8435935060208501356001600160401b03811115614ac757600080fd5b614ad387828801614413565b9094509250614ae6905060408601614a7d565b905092959194509250565b600082601f830112614b0257600080fd5b6135dc8383356020850161472d565b600060208284031215614b2357600080fd5b81356001600160401b03811115614b3957600080fd5b6140ce84828501614af1565b600080600060608486031215614b5a57600080fd5b8335614b65816143e1565b92506020840135915060408401356001600160401b03811115614b8757600080fd5b614b9386828701614264565b9150509250925092565b6000808335601e19843603018112614bb457600080fd5b8301803591506001600160401b03821115614bce57600080fd5b6020019150368190038213156136c857600080fd5b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000614c36604083018587614bf9565b9050826020830152949350505050565b6000614c5461473b84614706565b9050828152838383011115614c6857600080fd5b6135dc836020830184614541565b600082601f830112614c8757600080fd5b6135dc83835160208501614c46565b600060208284031215614ca857600080fd5b81516001600160401b03811115614cbe57600080fd5b6140ce84828501614c76565b600a81106145bf576145bf614599565b6000808335601e19843603018112614cf157600080fd5b83016020810192503590506001600160401b03811115614d1057600080fd5b8036038213156136c857600080fd5b614d29818b614cca565b60006020614d398184018c6145af565b60c06040840152614d4e60c084018a8c614bf9565b8381036060850152878152818101600589901b820183018a60005b8b811015614da357848303601f19018452614d84828e614cda565b614d8f858284614bf9565b958801959450505090850190600101614d69565b50508581036080870152614db881898b614bf9565b9450505050508260a08301529a9950505050505050505050565b6000808335601e19843603018112614de957600080fd5b83016020810192503590506001600160401b03811115614e0857600080fd5b8060051b36038213156136c857600080fd5b60008235603e19833603018112614e3057600080fd5b90910192915050565b6000606080835260a0808401614e4f8889614dd2565b60408786018190529281905260059260c08089019083861b8a01018460005b85811015614faf578b830360bf19018452813536889003607e19018112614e9457600080fd5b87016080848101614ea58380614dd2565b928752908290528b860191808c1b87018d0191908160005b82811015614f2d57898503609f19018652614ed88285614e1a565b614ee28182614cda565b8e8852614ef28f89018284614bf9565b9150506020614f0381840184614cda565b9350888303828a0152614f17838583614bf9565b9982019998505093909301925050600101614ebd565b5050505060209150614f4182840184614cda565b87830384890152614f53838284614bf9565b92505050614f6388840184614cda565b8783038a890152614f75838284614bf9565b92505050614f858d840184614cda565b93508682038e880152614f99828583614bf9565b9783019796505050929092019150600101614e6e565b505060208d013560808b015289810360208b0152614fcd818d61456d565b9750505087860381890152505050505061404b818561456d565b84815283602082015260606040820152600061404b606083018486614bf9565b81835260006020808501808196508560051b810191508460005b8781101561460b5782840389526150388288614cda565b615043868284614bf9565b9a87019a9550505090840190600101615021565b615061818b6145af565b60c06020820152600061507860c083018a8c615007565b886040840152828103606084015261509181888a614bf9565b905085608084015282810360a08401526150ac818587614bf9565b9c9b505050505050505050505050565b6000602082840312156150ce57600080fd5b81516001600160401b038111156150e457600080fd5b8201601f810184136150f557600080fd5b6140ce84825160208401614c46565b60c08152600061511760c083018b61456d565b615124602084018b6145af565b8815156040840152828103606084015261513f81888a615007565b90508281036080840152615154818688614bf9565b9150508260a08301529998505050505050505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b61520c81896145af565b60806020820152600061522360808301888a615007565b8281036040840152615236818789614bf9565b9050828103606084015261524b818587614bf9565b9a9950505050505050505050565b6001600160e01b031983168152815160009061527c816004850160208701614541565b919091016004019392505050565b60a08152600061529d60a083018a61456d565b6152aa602084018a6145af565b871515604084015282810360608401526152c5818789615007565b9050828103608084015261524b818587614bf9565b600181811c908216806152ee57607f821691505b6020821081036141f257634e487b7160e01b600052602260045260246000fd5b8381526040602082015260006146b7604083018486614bf9565b60008235603e1983360301811261533e57600080fd5b9190910192915050565b60006153548283614cda565b60408552615366604086018284614bf9565b915050602083013560208501528091505092915050565b6001600160401b038061538f83614a7d565b1683528061539f60208401614a7d565b166020840152505050565b6020815260006153ba8384614e1a565b60e060208401526153cf610100840182615348565b90506153de6020850185614e1a565b601f19808584030160408601526153f58383615348565b925061540360408701614a7d565b91506001600160401b0380831660608701526154226060880188614cda565b935082878603016080880152615439858583614bf9565b94505061544c60a087016080890161537d565b8061545960c08901614a7d565b1660e08701525050508091505092915050565b60006020828403121561547e57600080fd5b5051919050565b60006020828403121561549757600080fd5b6135dc82614a7d565b6001600160401b03848116825260808201906154bf602084018661537d565b808416606084015250949350505050565b60006001600160401b0380831681851680830382111561550057634e487b7160e01b600052601160045260246000fd5b01949350505050565b60006155158283614e1a565b60e0845261552660e0850182615348565b90506155356020840184614e1a565b84820360208601526155478282615348565b91505061555660408401614a7d565b6001600160401b0380821660408701526155736060860186614cda565b92508684036060880152615588848483614bf9565b93505061559b608087016080870161537d565b806155a860c08701614a7d565b1660c087015250508091505092915050565b6020815260006135dc6020830184615509565b6000602082840312156155df57600080fd5b81516001600160401b03808211156155f657600080fd5b908301906040828603121561560a57600080fd5b604051604081018181108382111715615625576156256146c0565b60405282516156338161424b565b815260208301518281111561564757600080fd5b61565387828601614c76565b60208301525095945050505050565b80511515825260006020820151604060208501526140ce604085018261456d565b6001600160401b03831681526040602082015260006140ce6040830184615662565b8381526060602082015260006156be606083018561456d565b9050826040830152949350505050565b6000806000606084860312156156e357600080fd5b835192506020840151915060408401516148198161424b565b60808152600061570c8687614dd2565b6060608085015261572160e085018284615007565b915050602087013560a08401526001600160401b0361574260408901614a7d565b1660c0840152828103602084015261575a8687614dd2565b6080835261576c608084018284615007565b91505061577c6020880188614dd2565b838303602085015261578f838284615007565b925050506040870135604083015260608701356060830152809250505083604083015282606083015295945050505050565b600080604083850312156157d457600080fd5b8251915060208301516157e68161424b565b809150509250929050565b601f82111561157a57600081815260208120601f850160051c810160208610156158185750805b601f850160051c820191505b818110156134c357828155600101615824565b6001600160401b0383111561584e5761584e6146c0565b6158628361585c83546152da565b836157f1565b6000601f841160018114615896576000851561587e5750838201355b600019600387901b1c1916600186901b1783556158f0565b600083815260209020601f19861690835b828110156158c757868501358255602094850194600190920191016158a7565b50868210156158e45760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6020815260006140ce602083018486614bf9565b60408152600061591e6040830185615509565b82810360208401526146b78185615662565b8183823760009101908152919050565b81516001600160401b03811115615959576159596146c0565b61596d8161596784546152da565b846157f1565b602080601f8311600181146159a2576000841561598a5750858301515b600019600386901b1c1916600185901b1785556134c3565b600085815260208120601f198616915b828110156159d1578886015182559484019460019091019084016159b2565b50858210156159ef5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000615a12604083018561456d565b90508260208301529392505050565b615a2b8188614cca565b60006020615a3b818401896145af565b60c06040840152615a4f60c084018861456d565b8381036060850152865180825282820190600581901b83018401848a0160005b83811015615a9d57601f19868403018552615a8b83835161456d565b94870194925090860190600101615a6f565b50508681036080880152615ab1818a61456d565b955050505050508260a0830152979650505050505050565b6000825161533e818460208701614541565b60008085851115615aeb57600080fd5b83861115615af857600080fd5b5050820193919092039150565b600060208284031215615b1757600080fd5b81516135dc816143e1565b600082615b3f57634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160401b0380841115615b5e57615b5e6146c0565b8360051b6020615b6f8183016146d6565b868152918501918181019036841115615b8757600080fd5b865b84811015615bbb57803586811115615ba15760008081fd5b615bad36828b01614af1565b845250918301918301615b89565b50979650505050505050565b606081526000615bda606083018661456d565b6001600160401b0394851660208401529290931660409091015292915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204a024e6c57411e87de5d78cc24836e3aff6e0b212e481674f85209ea9990a1ed64736f6c634300080f0033"; + +type DispatcherConstructorParams = + | [linkLibraryAddresses: DispatcherLibraryAddresses, signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: DispatcherConstructorParams +): xs is ConstructorParameters => { + return ( + typeof xs[0] === "string" || + (Array.isArray as (arg: any) => arg is readonly any[])(xs[0]) || + "_isInterface" in xs[0] + ); +}; + +export class Dispatcher__factory extends ContractFactory { + constructor(...args: DispatcherConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + const [linkLibraryAddresses, signer] = args; + super( + _abi, + Dispatcher__factory.linkBytecode(linkLibraryAddresses), + signer + ); + } + } + + static linkBytecode( + linkLibraryAddresses: DispatcherLibraryAddresses + ): string { + let linkedBytecode = _bytecode; + + linkedBytecode = linkedBytecode.replace( + new RegExp("__\\$d825222459c46c14afb2efe0967c30e98d\\$__", "g"), + linkLibraryAddresses["contracts/libs/Ibc.sol:Ibc"] + .replace(/^0x/, "") + .toLowerCase() + ); + + return linkedBytecode; + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + Dispatcher & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): Dispatcher__factory { + return super.connect(runner) as Dispatcher__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): DispatcherInterface { + return new Interface(_abi) as DispatcherInterface; + } + static connect(address: string, runner?: ContractRunner | null): Dispatcher { + return new Contract(address, _abi, runner) as unknown as Dispatcher; + } +} + +export interface DispatcherLibraryAddresses { + ["contracts/libs/Ibc.sol:Ibc"]: string; +} diff --git a/src/evm/contracts/factories/DummyLightClient__factory.ts b/src/evm/contracts/factories/DummyLightClient__factory.ts new file mode 100644 index 00000000..578636ca --- /dev/null +++ b/src/evm/contracts/factories/DummyLightClient__factory.ts @@ -0,0 +1,341 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + DummyLightClient, + DummyLightClientInterface, +} from "../DummyLightClient"; + +const _abi = [ + { + type: "constructor", + inputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "addOpConsensusState", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "", + type: "uint256", + internalType: "uint256", + }, + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "endTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "getFraudProofEndtime", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "endTime", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "getState", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndtime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "error", + name: "InvalidDummyMembershipProof", + inputs: [], + }, + { + type: "error", + name: "InvalidDummyNonMembershipProof", + inputs: [], + }, +] as const; + +const _bytecode = + "0x608060405234801561001057600080fd5b506103d8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806344c9af281461005c5780635922f42014610096578063cb535ab5146100c5578063d56ff842146100da578063fdaab4e5146100fc575b600080fd5b61007461006a366004610162565b5060009081908190565b6040805193845260208401929092521515908201526060015b60405180910390f35b6100b06100a436600461017b565b60008094509492505050565b6040805192835290151560208301520161008d565b6100d86100d33660046102b6565b61010f565b005b6100ee6100e8366004610162565b50600090565b60405190815260200161008d565b6100d861010a36600461033e565b610139565b826020013560000361013457604051636cb681eb60e01b815260040160405180910390fd5b505050565b816020013560000361015e57604051631e76ddb960e21b815260040160405180910390fd5b5050565b60006020828403121561017457600080fd5b5035919050565b6000806000806080858703121561019157600080fd5b843567ffffffffffffffff808211156101a957600080fd5b90860190606082890312156101bd57600080fd5b909450602086013590808211156101d357600080fd5b508501608081880312156101e657600080fd5b93969395505050506040820135916060013590565b60006040828403121561020d57600080fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261023a57600080fd5b813567ffffffffffffffff8082111561025557610255610213565b604051601f8301601f19908116603f0116810190828211818310171561027d5761027d610213565b8160405283815286602085880101111561029657600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156102cb57600080fd5b833567ffffffffffffffff808211156102e357600080fd5b6102ef878388016101fb565b9450602086013591508082111561030557600080fd5b61031187838801610229565b9350604086013591508082111561032757600080fd5b5061033486828701610229565b9150509250925092565b6000806040838503121561035157600080fd5b823567ffffffffffffffff8082111561036957600080fd5b610375868387016101fb565b9350602085013591508082111561038b57600080fd5b5061039885828601610229565b915050925092905056fea26469706673582212207befcacce43d382e609d84ddbf6d951e607548e6d657d90ebabbf78b5a72f52e64736f6c634300080f0033"; + +type DummyLightClientConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: DummyLightClientConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class DummyLightClient__factory extends ContractFactory { + constructor(...args: DummyLightClientConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + DummyLightClient & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): DummyLightClient__factory { + return super.connect(runner) as DummyLightClient__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): DummyLightClientInterface { + return new Interface(_abi) as DummyLightClientInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): DummyLightClient { + return new Contract(address, _abi, runner) as unknown as DummyLightClient; + } +} diff --git a/src/evm/contracts/factories/DummyProofVerifier__factory.ts b/src/evm/contracts/factories/DummyProofVerifier__factory.ts new file mode 100644 index 00000000..db595d27 --- /dev/null +++ b/src/evm/contracts/factories/DummyProofVerifier__factory.ts @@ -0,0 +1,332 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + DummyProofVerifier, + DummyProofVerifierInterface, +} from "../DummyProofVerifier"; + +const _abi = [ + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyStateUpdate", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "error", + name: "InvalidAppHash", + inputs: [], + }, + { + type: "error", + name: "InvalidIbcStateProof", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockHash", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidPacketProof", + inputs: [], + }, + { + type: "error", + name: "InvalidProofKey", + inputs: [], + }, + { + type: "error", + name: "InvalidProofValue", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1StateRoot", + inputs: [], + }, + { + type: "error", + name: "MethodNotImplemented", + inputs: [], + }, +] as const; + +const _bytecode = + "0x608060405234801561001057600080fd5b506102cf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630a1bb8b5146100465780632a6ded741461005d578063c2f0329f14610071575b600080fd5b61005b610054366004610087565b5050505050565b005b61005b61006b36600461018a565b50505050565b61005b61007f3660046101fd565b505050505050565b600080600080600060a0868803121561009f57600080fd5b853567ffffffffffffffff808211156100b757600080fd5b908701906060828a0312156100cb57600080fd5b909550602087013590808211156100e157600080fd5b908701906080828a0312156100f557600080fd5b9094506040870135935060608701359250608087013590808216821461011a57600080fd5b50809150509295509295909350565b60008083601f84011261013b57600080fd5b50813567ffffffffffffffff81111561015357600080fd5b60208301915083602082850101111561016b57600080fd5b9250929050565b60006040828403121561018457600080fd5b50919050565b600080600080606085870312156101a057600080fd5b84359350602085013567ffffffffffffffff808211156101bf57600080fd5b6101cb88838901610129565b909550935060408701359150808211156101e457600080fd5b506101f187828801610172565b91505092959194509250565b6000806000806000806080878903121561021657600080fd5b86359550602087013567ffffffffffffffff8082111561023557600080fd5b6102418a838b01610129565b9097509550604089013591508082111561025a57600080fd5b6102668a838b01610129565b9095509350606089013591508082111561027f57600080fd5b5061028c89828a01610172565b915050929550929550929556fea2646970667358221220d603bd2a2a3dcd871942da86de6e1f367f5c11b25842f2becb53941776c99e9364736f6c634300080f0033"; + +type DummyProofVerifierConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: DummyProofVerifierConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class DummyProofVerifier__factory extends ContractFactory { + constructor(...args: DummyProofVerifierConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + DummyProofVerifier & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): DummyProofVerifier__factory { + return super.connect(runner) as DummyProofVerifier__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): DummyProofVerifierInterface { + return new Interface(_abi) as DummyProofVerifierInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): DummyProofVerifier { + return new Contract(address, _abi, runner) as unknown as DummyProofVerifier; + } +} diff --git a/src/evm/contracts/factories/ERC1967Proxy__factory.ts b/src/evm/contracts/factories/ERC1967Proxy__factory.ts new file mode 100644 index 00000000..a6192e42 --- /dev/null +++ b/src/evm/contracts/factories/ERC1967Proxy__factory.ts @@ -0,0 +1,145 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + BytesLike, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { PayableOverrides } from "../common"; +import type { ERC1967Proxy, ERC1967ProxyInterface } from "../ERC1967Proxy"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_logic", + type: "address", + internalType: "address", + }, + { + name: "_data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "payable", + }, + { + type: "fallback", + stateMutability: "payable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "event", + name: "AdminChanged", + inputs: [ + { + name: "previousAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + { + name: "newAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "BeaconUpgraded", + inputs: [ + { + name: "beacon", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Upgraded", + inputs: [ + { + name: "implementation", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, +] as const; + +const _bytecode = + "0x608060405260405161073b38038061073b83398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d08383604051806060016040528060278152602001610714602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b6102c78061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e838360405180606001604052806027815260200161026b602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e0919061021b565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101af5782516000036101a8576001600160a01b0385163b6101a85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b9565b6101b983836101c1565b949350505050565b8151156101d15781518083602001fd5b8060405162461bcd60e51b815260040161019f9190610237565b60005b838110156102065781810151838201526020016101ee565b83811115610215576000848401525b50505050565b6000825161022d8184602087016101eb565b9190910192915050565b60208152600082518060208401526102568160408501602087016101eb565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122004fff0a0fbcac555b3339e2ed106c9314c88cea46e493b3f8c0eed46c362d76264736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564"; + +type ERC1967ProxyConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: ERC1967ProxyConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class ERC1967Proxy__factory extends ContractFactory { + constructor(...args: ERC1967ProxyConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _logic: AddressLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_logic, _data, overrides || {}); + } + override deploy( + _logic: AddressLike, + _data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ) { + return super.deploy(_logic, _data, overrides || {}) as Promise< + ERC1967Proxy & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): ERC1967Proxy__factory { + return super.connect(runner) as ERC1967Proxy__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): ERC1967ProxyInterface { + return new Interface(_abi) as ERC1967ProxyInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): ERC1967Proxy { + return new Contract(address, _abi, runner) as unknown as ERC1967Proxy; + } +} diff --git a/src/evm/contracts/factories/Earth__factory.ts b/src/evm/contracts/factories/Earth__factory.ts new file mode 100644 index 00000000..84e49b72 --- /dev/null +++ b/src/evm/contracts/factories/Earth__factory.ts @@ -0,0 +1,589 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { Earth, EarthInterface } from "../Earth"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_middleware", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "authorizeMiddleware", + inputs: [ + { + name: "middleware", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "authorizedMws", + inputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "generateAckPacket", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "srcPortAddr", + type: "address", + internalType: "address", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [ + { + name: "ackPacket", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "destPortAddr", + type: "address", + internalType: "address", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "message", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "mw", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onRecvUniversalPacket", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [ + { + name: "ackPacket", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onTimeoutUniversalPacket", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onUniversalAcknowledgement", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "setDefaultMw", + inputs: [ + { + name: "_middleware", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "packet", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "UnauthorizedIbcMiddleware", + inputs: [], + }, + { + type: "error", + name: "ackAddressMismatch", + inputs: [], + }, + { + type: "error", + name: "ackDataTooShort", + inputs: [], + }, +] as const; + +const _bytecode = + "0x608060405234801561001057600080fd5b506040516115a63803806115a683398101604081905261002f916100d3565b8061003933610083565b600180546001600160a01b0319166001600160a01b03831617905561007c816001600160a01b03166000908152600260205260409020805460ff19166001179055565b5050610103565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100e557600080fd5b81516001600160a01b03811681146100fc57600080fd5b9392505050565b611494806101126000396000f3fe6080604052600436106100eb5760003560e01c80635b7615851161008a578063a742d78c11610059578063a742d78c146102af578063d24ba024146102cf578063f12b758a146102ef578063f2fde38b1461030f57600080fd5b80635b7615851461021b578063715018a614610248578063866f3f971461025d5780638da5cb5b1461027d57600080fd5b8063400d9f5d116100c6578063400d9f5d1461017e5780634252ae9b1461019e5780634eeb7391146101cd578063588152ca146101fb57600080fd5b8062e82cef146100f75780633a7fbcbd146101195780633b90b0421461015e57600080fd5b366100f257005b600080fd5b34801561010357600080fd5b50610117610112366004610bcf565b61032f565b005b34801561012557600080fd5b50610149610134366004610bcf565b60026020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561016a57600080fd5b50610117610179366004610bcf565b610362565b34801561018a57600080fd5b50610117610199366004610bea565b610376565b3480156101aa57600080fd5b506101be6101b9366004610c37565b610424565b60405161015593929190610d08565b3480156101d957600080fd5b506101ed6101e8366004610c37565b6105c8565b604051610155929190610d3d565b34801561020757600080fd5b50610117610216366004610ec3565b6106b6565b34801561022757600080fd5b5061023b610236366004610bea565b610835565b6040516101559190610f36565b34801561025457600080fd5b50610117610978565b34801561026957600080fd5b5061023b610278366004610f91565b61098c565b34801561028957600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610155565b3480156102bb57600080fd5b50600154610297906001600160a01b031681565b3480156102db57600080fd5b506101176102ea366004610fea565b6109e7565b3480156102fb57600080fd5b506101ed61030a366004610c37565b610a5a565b34801561031b57600080fd5b5061011761032a366004610bcf565b610a6a565b610337610ae5565b61034081610b3f565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61036a610ae5565b61037381610b3f565b50565b3360009081526002602052604090205460ff166103a657604051630ddfd93d60e11b815260040160405180910390fd5b60056040518060400160405280848152602001836103c390611063565b90528154600181810184556000938452602093849020835160059093020191825583830151805191830191825593840151600283015560408401516003830155606084015192939192600484019061041b90826110fe565b50505050505050565b6004818154811061043457600080fd5b90600052602060002090600702016000915090508060000154908060010160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201805461048b90611075565b80601f01602080910402602001604051908101604052809291908181526020018280546104b790611075565b80156105045780601f106104d957610100808354040283529160200191610504565b820191906000526020600020905b8154815290600101906020018083116104e757829003601f168201915b5050509190925250506040805180820190915260058401805460ff1615158252600685018054949594929350909160208401919061054190611075565b80601f016020809104026020016040519081016040528092919081815260200182805461056d90611075565b80156105ba5780601f1061058f576101008083540402835291602001916105ba565b820191906000526020600020905b81548152906001019060200180831161059d57829003601f168201915b505050505081525050905083565b600581815481106105d857600080fd5b90600052602060002090600502016000915090508060000154908060010160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201805461062f90611075565b80601f016020809104026020016040519081016040528092919081815260200182805461065b90611075565b80156106a85780601f1061067d576101008083540402835291602001916106a8565b820191906000526020600020905b81548152906001019060200180831161068b57829003601f168201915b505050505081525050905082565b3360009081526002602052604090205460ff166106e657604051630ddfd93d60e11b815260040160405180910390fd5b60146106f560208301836111bd565b905010156107165760405163503b43db60e01b815260040160405180910390fd5b600061072560208301836111bd565b61073491601491600091611203565b61073d9161122d565b60601c9050806001600160a01b0316610757846040015190565b6001600160a01b03161461077e57604051631863a42d60e31b815260040160405180910390fd5b60046040518060600160405280868152602001858152602001846107a190611270565b9052815460018181018455600093845260209384902083516007909302019182558383015180519183019182559384015160028301556040840151600383015560608401519293919260048401906107f990826110fe565b5050506040820151805160058301805460ff19169115159190911781556020820151600684019061082a90826110fe565b505050505050505050565b6040805180820190915260008152606060208201523360009081526002602052604090205460ff1661087a57604051630ddfd93d60e11b815260040160405180910390fd5b600360405180604001604052808581526020018461089790611063565b9052815460018181018455600093845260209384902083516005909302019182558383015180519183019182559384015160028301556040840151600383015560608401519293919260048401906108ef90826110fe565b5030935063866f3f97925086915050843561090d60608701876111bd565b6040518563ffffffff1660e01b815260040161092c94939291906112f1565b600060405180830381865afa158015610949573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610971919081019061131c565b9392505050565b610980610ae5565b61098a6000610b63565b565b6040805180820190915260008152606060208201526040518060400160405280600115158152602001308686866040516020016109cc94939291906113d9565b60408051601f19818403018152919052905295945050505050565b6001546001600160a01b0316631f3a583085610a09886001600160a01b031690565b8686866040518663ffffffff1660e01b8152600401610a2c959493929190611423565b600060405180830381600087803b158015610a4657600080fd5b505af115801561082a573d6000803e3d6000fd5b600381815481106105d857600080fd5b610a72610ae5565b6001600160a01b038116610adc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61037381610b63565b6000546001600160a01b0316331461098a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ad3565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610bca57600080fd5b919050565b600060208284031215610be157600080fd5b61097182610bb3565b60008060408385031215610bfd57600080fd5b8235915060208301356001600160401b03811115610c1a57600080fd5b830160808186031215610c2c57600080fd5b809150509250929050565b600060208284031215610c4957600080fd5b5035919050565b60005b83811015610c6b578181015183820152602001610c53565b83811115610c7a576000848401525b50505050565b60008151808452610c98816020860160208601610c50565b601f01601f19169290920160200192915050565b8051825260208101516020830152604081015160408301526000606082015160806060850152610cdf6080850182610c80565b949350505050565b8051151582526000602082015160406020850152610cdf6040850182610c80565b838152606060208201526000610d216060830185610cac565b8281036040840152610d338185610ce7565b9695505050505050565b828152604060208201526000610cdf6040830184610cac565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715610d8e57610d8e610d56565b60405290565b604051601f8201601f191681016001600160401b0381118282101715610dbc57610dbc610d56565b604052919050565b60006001600160401b03821115610ddd57610ddd610d56565b50601f01601f191660200190565b600082601f830112610dfc57600080fd5b8135610e0f610e0a82610dc4565b610d94565b818152846020838601011115610e2457600080fd5b816020850160208301376000918101602001919091529392505050565b600060808284031215610e5357600080fd5b604051608081016001600160401b038282108183111715610e7657610e76610d56565b816040528293508435835260208501356020840152604085013560408401526060850135915080821115610ea957600080fd5b50610eb685828601610deb565b6060830152505092915050565b600080600060608486031215610ed857600080fd5b8335925060208401356001600160401b0380821115610ef657600080fd5b610f0287838801610e41565b93506040860135915080821115610f1857600080fd5b50840160408187031215610f2b57600080fd5b809150509250925092565b6020815260006109716020830184610ce7565b60008083601f840112610f5b57600080fd5b5081356001600160401b03811115610f7257600080fd5b602083019150836020828501011115610f8a57600080fd5b9250929050565b60008060008060608587031215610fa757600080fd5b84359350610fb760208601610bb3565b925060408501356001600160401b03811115610fd257600080fd5b610fde87828801610f49565b95989497509550505050565b60008060008060006080868803121561100257600080fd5b61100b86610bb3565b94506020860135935060408601356001600160401b038082111561102e57600080fd5b61103a89838a01610f49565b909550935060608801359150808216821461105457600080fd5b50809150509295509295909350565b600061106f3683610e41565b92915050565b600181811c9082168061108957607f821691505b6020821081036110a957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156110f957600081815260208120601f850160051c810160208610156110d65750805b601f850160051c820191505b818110156110f5578281556001016110e2565b5050505b505050565b81516001600160401b0381111561111757611117610d56565b61112b816111258454611075565b846110af565b602080601f83116001811461116057600084156111485750858301515b600019600386901b1c1916600185901b1785556110f5565b600085815260208120601f198616915b8281101561118f57888601518255948401946001909101908401611170565b50858210156111ad5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000808335601e198436030181126111d457600080fd5b8301803591506001600160401b038211156111ee57600080fd5b602001915036819003821315610f8a57600080fd5b6000808585111561121357600080fd5b8386111561122057600080fd5b5050820193919092039150565b6bffffffffffffffffffffffff19813581811691601485101561125a5780818660140360031b1b83161692505b505092915050565b801515811461037357600080fd5b60006040823603121561128257600080fd5b61128a610d6c565b823561129581611262565b815260208301356001600160401b038111156112b057600080fd5b6112bc36828601610deb565b60208301525092915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526001600160a01b0384166020820152606060408201819052600090610d3390830184866112c8565b6000602080838503121561132f57600080fd5b82516001600160401b038082111561134657600080fd5b908401906040828703121561135a57600080fd5b611362610d6c565b825161136d81611262565b8152828401518281111561138057600080fd5b80840193505086601f84011261139557600080fd5b825191506113a5610e0a83610dc4565b82815287858486010111156113b957600080fd5b6113c883868301878701610c50565b938101939093525090949350505050565b60006bffffffffffffffffffffffff19808760601b168352808660601b166014840152506361636b2d60e01b60288301528284602c8401375060009101602c019081529392505050565b8581528460208201526080604082015260006114436080830185876112c8565b90506001600160401b0383166060830152969550505050505056fea2646970667358221220e5ead40d8f0b298119ae73319771a5ec2bb3efc979d8f47ca856eb4190de224d64736f6c634300080f0033"; + +type EarthConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: EarthConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class Earth__factory extends ContractFactory { + constructor(...args: EarthConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _middleware: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_middleware, overrides || {}); + } + override deploy( + _middleware: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_middleware, overrides || {}) as Promise< + Earth & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): Earth__factory { + return super.connect(runner) as Earth__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): EarthInterface { + return new Interface(_abi) as EarthInterface; + } + static connect(address: string, runner?: ContractRunner | null): Earth { + return new Contract(address, _abi, runner) as unknown as Earth; + } +} diff --git a/src/evm/contracts/factories/IbcUtils__factory.ts b/src/evm/contracts/factories/IbcUtils__factory.ts new file mode 100644 index 00000000..492c69bf --- /dev/null +++ b/src/evm/contracts/factories/IbcUtils__factory.ts @@ -0,0 +1,136 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { IbcUtils, IbcUtilsInterface } from "../IbcUtils"; + +const _abi = [ + { + type: "function", + name: "fromUniversalPacketBytes", + inputs: [ + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [ + { + name: "universalPacketData", + type: "tuple", + internalType: "struct UniversalPacket", + components: [ + { + name: "srcPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "mwBitmap", + type: "uint256", + internalType: "uint256", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "hexStrToAddress", + inputs: [ + { + name: "hexStr", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "addr", + type: "address", + internalType: "address", + }, + ], + stateMutability: "pure", + }, + { + type: "error", + name: "StringTooLong", + inputs: [], + }, + { + type: "error", + name: "invalidCharacter", + inputs: [], + }, + { + type: "error", + name: "invalidHexStringLength", + inputs: [], + }, +] as const; + +const _bytecode = + "0x6105c261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063a1ef9a9814610045578063d5c39a9d14610075575b600080fd5b610058610053366004610327565b610095565b6040516001600160a01b0390911681526020015b60405180910390f35b6100886100833660046103d8565b610257565b60405161006c919061044a565b805160009082906028146100bc576040516305229b2360e41b815260040160405180910390fd5b6000600160285b801561024d57806100d3816104db565b915050600060308583815181106100ec576100ec6104f2565b016020015160f81c1080159061011c57506039858381518110610111576101116104f2565b016020015160f81c11155b15610151576030858381518110610135576101356104f2565b0160200151610147919060f81c610508565b60ff169050610224565b6041858381518110610165576101656104f2565b016020015160f81c108015906101955750604685838151811061018a5761018a6104f2565b016020015160f81c11155b156101ae576037858381518110610135576101356104f2565b60618583815181106101c2576101c26104f2565b016020015160f81c108015906101f2575060668583815181106101e7576101e76104f2565b016020015160f81c11155b1561020b576057858381518110610135576101356104f2565b60405163f379095160e01b815260040160405180910390fd5b61022e838261052b565b610238908561054a565b935061024560108461052b565b9250506100c3565b5090949350505050565b604080516080810182526000808252602082018190529181019190915260608082015260008060006020866000376000519250602080870160003760005191506020604087016000375060005160408051608081018252848152602081018490529081018290526060808201906102d1908890818b610562565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152509695505050505050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561033957600080fd5b813567ffffffffffffffff8082111561035157600080fd5b818401915084601f83011261036557600080fd5b81358181111561037757610377610311565b604051601f8201601f19908116603f0116810190838211818310171561039f5761039f610311565b816040528281528760208487010111156103b857600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080602083850312156103eb57600080fd5b823567ffffffffffffffff8082111561040357600080fd5b818501915085601f83011261041757600080fd5b81358181111561042657600080fd5b86602082850101111561043857600080fd5b60209290920196919550909350505050565b6000602080835283518184015280840151604084015260408401516060840152606084015160808085015280518060a086015260005b8181101561049c5782810184015186820160c001528301610480565b818111156104ae57600060c083880101525b50601f01601f19169390930160c001949350505050565b634e487b7160e01b600052601160045260246000fd5b6000816104ea576104ea6104c5565b506000190190565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff841680821015610522576105226104c5565b90039392505050565b6000816000190483118215151615610545576105456104c5565b500290565b6000821982111561055d5761055d6104c5565b500190565b6000808585111561057257600080fd5b8386111561057f57600080fd5b505082019391909203915056fea2646970667358221220920cf9b2dba6cf22ef2d78571c1e71926572dd4bfba9bffdc98f5961817354c164736f6c634300080f0033"; + +type IbcUtilsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: IbcUtilsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class IbcUtils__factory extends ContractFactory { + constructor(...args: IbcUtilsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + IbcUtils & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): IbcUtils__factory { + return super.connect(runner) as IbcUtils__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): IbcUtilsInterface { + return new Interface(_abi) as IbcUtilsInterface; + } + static connect(address: string, runner?: ContractRunner | null): IbcUtils { + return new Contract(address, _abi, runner) as unknown as IbcUtils; + } +} diff --git a/src/evm/contracts/factories/Ibc__factory.ts b/src/evm/contracts/factories/Ibc__factory.ts new file mode 100644 index 00000000..eabc5f5b --- /dev/null +++ b/src/evm/contracts/factories/Ibc__factory.ts @@ -0,0 +1,570 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { Ibc, IbcInterface } from "../Ibc"; + +const _abi = [ + { + type: "function", + name: "_hexStrToAddress", + inputs: [ + { + name: "hexStr", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "addr", + type: "address", + internalType: "address", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "ackProofKey", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "proofKey", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "ackProofValue", + inputs: [ + { + name: "ack", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [ + { + name: "proofValue", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "channelProofKey", + inputs: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "proofKey", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "channelProofKeyMemory", + inputs: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "proofKey", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "channelProofValue", + inputs: [ + { + name: "state", + type: "ChannelState", + internalType: "enum ChannelState", + }, + { + name: "ordering", + type: "ChannelOrder", + internalType: "enum ChannelOrder", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + { + name: "counterpartyChannelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "proofValue", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "channelProofValueMemory", + inputs: [ + { + name: "state", + type: "ChannelState", + internalType: "enum ChannelState", + }, + { + name: "ordering", + type: "ChannelOrder", + internalType: "enum ChannelOrder", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + { + name: "counterpartyChannelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "proofValue", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "packetCommitmentProofKey", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "proofKey", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "packetCommitmentProofValue", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "proofValue", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "parseAckData", + inputs: [ + { + name: "ack", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [ + { + name: "ackData", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "toStr", + inputs: [ + { + name: "b", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [ + { + name: "outStr", + type: "string", + internalType: "string", + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "toStr", + inputs: [ + { + name: "_number", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "outStr", + type: "string", + internalType: "string", + }, + ], + stateMutability: "pure", + }, + { + type: "error", + name: "invalidHexStringLength", + inputs: [], + }, +] as const; + +const _bytecode = + "0x611e3961003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100be5760003560e01c80636f6547261161007b5780636f6547261461015857806374e970451461016b57806391d6df7d1461018c578063c91f5b3f1461019f578063fb10f0a8146101ca578063fc8f29da146101dd57600080fd5b806311a7a373146100c35780631dcd0305146100ec57806325e0dd0e146100ff578063360b8cd7146101125780634b5728d1146101325780634f9b0fb314610145575b600080fd5b6100d66100d1366004611309565b6101f0565b6040516100e3919061139f565b60405180910390f35b6100d66100fa3660046113b2565b61026c565b6100d661010d366004611431565b610376565b610125610120366004611524565b61046b565b6040516100e39190611565565b6100d6610140366004611309565b6105a8565b6100d661015336600461158c565b6105f1565b6100d661016636600461168c565b610628565b61017e610179366004611524565b61065c565b6040519081526020016100e3565b6100d661019a3660046113b2565b6106b0565b6101b26101ad3660046116d0565b6107c4565b6040516001600160a01b0390911681526020016100e3565b6100d66101d8366004611788565b610971565b61017e6101eb366004611309565b6109f0565b60606101ff6020830183611850565b6102099080611870565b6102226102196020860186611850565b6020013561026c565b61024361023560608701604088016118b6565b6001600160401b03166106b0565b60405160200161025694939291906118df565b6040516020818303038152906040529050919050565b606060005b60208160ff161080156102a55750828160ff16602081106102945761029461195d565b1a60f81b6001600160f81b03191615155b156102bc57806102b481611989565b915050610271565b60008160ff166001600160401b038111156102d9576102d96115d7565b6040519080825280601f01601f191660200182016040528015610303576020820181803683370190505b50905060005b8260ff168160ff16101561036e57848160ff166020811061032c5761032c61195d565b1a60f81b828260ff16815181106103455761034561195d565b60200101906001600160f81b031916908160001a9053508061036681611989565b915050610309565b509392505050565b606061045d6040518060a001604052808c6009811115610398576103986119a8565b60030b81526020018b60028111156103b2576103b26119a8565b60030b8152602001604051806040016040528088888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200161040a8761026c565b9052815260200161041b888a6119be565b81526020018a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250610b1a565b9a9950505050505050505050565b6040805180820190915260008152606060208201527fcf118b5b37063214cf5ee4e00a21cbc1f63c9adff4e41aef620d6c96005c7a256104af6009600185876119cb565b6040516104bd9291906119f5565b6040518091039020146105335760408051808201909152600081526020810184600a856104eb600282611a05565b926104f8939291906119cb565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509152506105a1565b60408051808201909152600181526020810161059e85600b86610557600282611a05565b92610564939291906119cb565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b8292505050565b90525b9392505050565b60606105b48280611850565b6105be9080611870565b6105cb6102198580611850565b6105de61023560608701604088016118b6565b6040516020016102569493929190611a1c565b606083836105fe8461026c565b60405160200161061093929190611aa0565b60405160208183030381529060405290509392505050565b6060826106348361026c565b604051602001610645929190611af7565b604051602081830303815290604052905092915050565b6000600283836040516106709291906119f5565b602060405180830381855afa15801561068d573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906105a19190611b5a565b6060816000036106d75750506040805180820190915260018152600360fc1b602082015290565b6000825b801561070157816106eb81611b73565b92506106fa9050600a82611ba2565b90506106db565b6000826001600160401b0381111561071b5761071b6115d7565b6040519080825280601f01601f191660200182016040528015610745576020820181803683370190505b509050825b80156107bb5761075b600a87611bb6565b610766906030611bca565b60f81b82610775600184611a05565b815181106107855761078561195d565b60200101906001600160f81b031916908160001a9053506107a7600a87611ba2565b9550806107b381611be2565b91505061074a565b50949350505050565b600081516028146107e8576040516305229b2360e41b815260040160405180910390fd5b60408051601480825281830190925283916000919060208201818036833701905050905060005b601481101561096557600083610826836002611bf9565b815181106108365761083661195d565b016020015160f81c905060008461084e846002611bf9565b610859906001611bca565b815181106108695761086961195d565b016020015160f81c9050604160ff83161080159061088b5750605a8260ff1611155b1561089e5761089b602083611c18565b91505b60418160ff16101580156108b65750605a8160ff1611155b156108c9576108c6602082611c18565b90505b600060618260ff1610156108de5760306108e1565b60575b6108eb9083611c3d565b60618460ff1610156108fe576030610901565b60575b61090b9085611c3d565b610916906010611c60565b6109209190611c18565b90508060f81b8585815181106109385761093861195d565b60200101906001600160f81b031916908160001a905350505050808061095d90611b73565b91505061080f565b50601401519392505050565b60606109e56040518060a00160405280896009811115610993576109936119a8565b60030b81526020018860028111156109ad576109ad6119a8565b60030b815260200160405180604001604052808781526020016109cf8761026c565b9052815260208101879052604001879052610b1a565b979650505050505050565b60006002610a0460e0840160c085016118b6565b610a1460a08501608086016118b6565b610a2460c0860160a087016118b6565b6002610a336060880188611870565b604051610a419291906119f5565b602060405180830381855afa158015610a5e573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a819190611b5a565b6040516001600160c01b031960c095861b8116602083015293851b841660288201529190931b9091166030820152603881019190915260580160408051601f1981840301815290829052610ad491611c89565b602060405180830381855afa158015610af1573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610b149190611b5a565b92915050565b60606000610b2783610d37565b6001600160401b03811115610b3e57610b3e6115d7565b6040519080825280601f01601f191660200182016040528015610b68576020820181803683370190505b5090506000610b7984602084610e3d565b82525092915050565b80516060908290600003610ba657604080516000808252602082019092529061036e565b60048151610bb49190611bb6565b15610c055760405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420626173653634206465636f64657220696e70757400000000604482015260640160405180910390fd5b60006040518060a0016040528060808152602001611d84608091399050600060048351610c329190611ba2565b610c3d906003611bf9565b90506000610c4c826020611bca565b6001600160401b03811115610c6357610c636115d7565b6040519080825280601f01601f191660200182016040528015610c8d576020820181803683370190505b5090508351840151603d60ff821603610cba57600183039250613d3d61ffff821603610cba576001830392505b50818152600183018485518101602084015b81831015610d2957600483019250825160ff8082168601511660ff808360081c168701511660061b0160ff808360101c1687015116600c1b60ff808460181c168801511660121b010190508060e81b825250600381019050610ccc565b509298975050505050505050565b6000806000610d498460000151610fc7565b610d54906001611bca565b610d5e9083611bca565b9150610d6d8460200151610fc7565b610d78906001611bca565b610d829083611bca565b9150610d99610d948560400151610ff0565b61103b565b610da4906001611bca565b610dae9083611bca565b9150600090505b836060015151811015610e1257610de984606001518281518110610ddb57610ddb61195d565b60200260200101515161103b565b610df4906001611bca565b610dfe9083611bca565b915080610e0a81611b73565b915050610db5565b610e2084608001515161103b565b610e2b906001611bca565b610e359083611bca565b949350505050565b825160009083908190839060030b15610e8657610e5e600160008488611050565b610e689083611bca565b9150610e7987600001518387611070565b610e839083611bca565b91505b602087015160030b15610ec957610ea1600260008488611050565b610eab9083611bca565b9150610ebc87602001518387611070565b610ec69083611bca565b91505b610ed7600360028488611050565b610ee19083611bca565b9150610ef287604001518387611090565b610efc9083611bca565b9150866060015151600014610f7c575060005b866060015151811015610f7c57610f2a600460028488611050565b610f349083611bca565b9150610f5e87606001518281518110610f4f57610f4f61195d565b60200260200101518387611143565b610f689083611bca565b915080610f7481611b73565b915050610f0f565b60808701515115610fbd57610f95600560028488611050565b610f9f9083611bca565b9150610fb087608001518387611143565b610fba9083611bca565b91505b6109e58383611a05565b6000808260030b1215610fdc5750600a919050565b610b148263ffffffff16611150565b919050565b60008061100183600001515161103b565b61100c906001611bca565b6110169082611bca565b905061102683602001515161103b565b611031906001611bca565b6105a19082611bca565b600061104682611150565b610b149083611bca565b600060088502600785161761106681858561116d565b9695505050505050565b6000836110876001600160401b038216858561116d565b95945050505050565b600082808261109e87610ff0565b6001600160401b038111156110b5576110b56115d7565b6040519080825280601f01601f1916602001820160405280156110df576020820181803683370190505b509050808560006110f28a6020856111b0565b90506110ff81868a61116d565b6111099086611bca565b9450611129611119846020611bca565b6111238785611bca565b8361123f565b6111338186611bca565b94506060935061045d8686611a05565b6000610e358484846112be565b60071c600060015b8215610b145760079290921c91600101611158565b600080828401607f86165b600787901c156111a0578060801782535060079590951c9460019182019101607f8616611178565b8082535050600101949350505050565b82515160009083908190156111f5576111cd600160028387611050565b6111d79082611bca565b90506111e886600001518286611143565b6111f29082611bca565b90505b602086015151156112355761120d6002808387611050565b6112179082611bca565b905061122886602001518286611143565b6112329082611bca565b90505b6110668282611a05565b8060000361124c57505050565b60208111156112855782518252611264602083611bca565b9150611271602084611bca565b925061127e602082611a05565b905061124c565b60006001611294836020611a05565b6112a090610100611d77565b6112aa9190611a05565b935183518516941916939093179091525050565b8251600090816112cf82868661116d565b905060008186018501602088015b848310156112fc57805160001a825360019283019291820191016112dd565b506109e590508183611bca565b60006020828403121561131b57600080fd5b81356001600160401b0381111561133157600080fd5b820160e081850312156105a157600080fd5b60005b8381101561135e578181015183820152602001611346565b8381111561136d576000848401525b50505050565b6000815180845261138b816020860160208601611343565b601f01601f19169290920160200192915050565b6020815260006105a16020830184611373565b6000602082840312156113c457600080fd5b5035919050565b8035600a8110610feb57600080fd5b803560038110610feb57600080fd5b60008083601f8401126113fb57600080fd5b5081356001600160401b0381111561141257600080fd5b60208301915083602082850101111561142a57600080fd5b9250929050565b600080600080600080600080600060c08a8c03121561144f57600080fd5b6114588a6113cb565b985061146660208b016113da565b975060408a01356001600160401b038082111561148257600080fd5b61148e8d838e016113e9565b909950975060608c01359150808211156114a757600080fd5b818c0191508c601f8301126114bb57600080fd5b8135818111156114ca57600080fd5b8d60208260051b85010111156114df57600080fd5b6020830197508096505060808c01359150808211156114fd57600080fd5b5061150a8c828d016113e9565b9a9d999c50979a9699959894979660a00135949350505050565b6000806020838503121561153757600080fd5b82356001600160401b0381111561154d57600080fd5b611559858286016113e9565b90969095509350505050565b6020815281511515602082015260006020830151604080840152610e356060840182611373565b6000806000604084860312156115a157600080fd5b83356001600160401b038111156115b757600080fd5b6115c3868287016113e9565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611615576116156115d7565b604052919050565b600082601f83011261162e57600080fd5b81356001600160401b03811115611647576116476115d7565b61165a601f8201601f19166020016115ed565b81815284602083860101111561166f57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561169f57600080fd5b82356001600160401b038111156116b557600080fd5b6116c18582860161161d565b95602094909401359450505050565b6000602082840312156116e257600080fd5b81356001600160401b038111156116f857600080fd5b610e358482850161161d565b60006001600160401b038084111561171e5761171e6115d7565b8360051b602061172f8183016115ed565b8681529350908401908084018783111561174857600080fd5b855b8381101561177c578035858111156117625760008081fd5b61176e8a828a0161161d565b83525090820190820161174a565b50505050509392505050565b60008060008060008060c087890312156117a157600080fd5b6117aa876113cb565b95506117b8602088016113da565b945060408701356001600160401b03808211156117d457600080fd5b6117e08a838b0161161d565b955060608901359150808211156117f657600080fd5b818901915089601f83011261180a57600080fd5b6118198a833560208501611704565b9450608089013591508082111561182f57600080fd5b5061183c89828a0161161d565b92505060a087013590509295509295509295565b60008235603e1983360301811261186657600080fd5b9190910192915050565b6000808335601e1984360301811261188757600080fd5b8301803591506001600160401b038211156118a157600080fd5b60200191503681900382131561142a57600080fd5b6000602082840312156118c857600080fd5b81356001600160401b03811681146105a157600080fd5b6a61636b732f706f7274732f60a81b81528385600b8301376000848201692f6368616e6e656c732f60b01b600b8201528451611922816015840160208901611343565b8082019150506a2f73657175656e6365732f60a81b6015820152835161194f816020840160208801611343565b016020019695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff810361199f5761199f611973565b60010192915050565b634e487b7160e01b600052602160045260246000fd5b60006105a1368484611704565b600080858511156119db57600080fd5b838611156119e857600080fd5b5050820193919092039150565b8183823760009101908152919050565b600082821015611a1757611a17611973565b500390565b71636f6d6d69746d656e74732f706f7274732f60701b8152838560128301376000848201692f6368616e6e656c732f60b01b60128201528451611a6681601c840160208901611343565b6a2f73657175656e6365732f60a81b601c92909101918201528351611a92816027840160208801611343565b016027019695505050505050565b716368616e6e656c456e64732f706f7274732f60701b8152828460128301376000838201692f6368616e6e656c732f60b01b60128201528351611aea81601c840160208801611343565b01601c0195945050505050565b716368616e6e656c456e64732f706f7274732f60701b815260008351611b24816012850160208801611343565b692f6368616e6e656c732f60b01b6012918401918201528351611b4e81601c840160208801611343565b01601c01949350505050565b600060208284031215611b6c57600080fd5b5051919050565b600060018201611b8557611b85611973565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082611bb157611bb1611b8c565b500490565b600082611bc557611bc5611b8c565b500690565b60008219821115611bdd57611bdd611973565b500190565b600081611bf157611bf1611973565b506000190190565b6000816000190483118215151615611c1357611c13611973565b500290565b600060ff821660ff84168060ff03821115611c3557611c35611973565b019392505050565b600060ff821660ff841680821015611c5757611c57611973565b90039392505050565b600060ff821660ff84168160ff0481118215151615611c8157611c81611973565b029392505050565b60008251611866818460208701611343565b600181815b80851115611cd6578160001904821115611cbc57611cbc611973565b80851615611cc957918102915b93841c9390800290611ca0565b509250929050565b600082611ced57506001610b14565b81611cfa57506000610b14565b8160018114611d105760028114611d1a57611d36565b6001915050610b14565b60ff841115611d2b57611d2b611973565b50506001821b610b14565b5060208310610133831016604e8410600b8410161715611d59575081810a610b14565b611d638383611c9b565b8060001904821115611c8157611c81611973565b60006105a18383611cde56fe000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e0000003f3435363738393a3b3c3d00000000000000000102030405060708090a0b0c0d0e0f101112131415161718190000000000001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000a2646970667358221220df3a75109b7df12c01c1f5b94c1ed3890be2ecfb6eb1ea1e5aba352712ced74e64736f6c634300080f0033"; + +type IbcConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: IbcConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class Ibc__factory extends ContractFactory { + constructor(...args: IbcConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + Ibc & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): Ibc__factory { + return super.connect(runner) as Ibc__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): IbcInterface { + return new Interface(_abi) as IbcInterface; + } + static connect(address: string, runner?: ContractRunner | null): Ibc { + return new Contract(address, _abi, runner) as unknown as Ibc; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/Mars__factory.ts b/src/evm/contracts/factories/Mars.sol/Mars__factory.ts new file mode 100644 index 00000000..47f6ecdb --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/Mars__factory.ts @@ -0,0 +1,894 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { Mars, MarsInterface } from "../../Mars.sol/Mars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ackPacket", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f6565b503480156200005057600080fd5b506040516200261b3803806200261b8339810160408190526200007391620001cd565b806200007f33620000a6565b600180546001600160a01b0319166001600160a01b03929092169190911790555062000370565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000141579160200282015b82811115620001415782518290620001309082620002a4565b509160200191906001019062000117565b506200014f92915062000153565b5090565b808211156200014f5760006200016a828262000174565b5060010162000153565b508054620001829062000215565b6000825580601f1062000193575050565b601f016020900490600052602060002090810190620001b39190620001b6565b50565b5b808211156200014f5760008155600101620001b7565b600060208284031215620001e057600080fd5b81516001600160a01b0381168114620001f857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022a57607f821691505b6020821081036200024b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200029f57600081815260208120601f850160051c810160208610156200027a5750805b601f850160051c820191505b818110156200029b5782815560010162000286565b5050505b505050565b81516001600160401b03811115620002c057620002c0620001ff565b620002d881620002d1845462000215565b8462000251565b602080601f831160018114620003105760008415620002f75750858301515b600019600386901b1c1916600185901b1785556200029b565b600085815260208120601f198616915b82811015620003415788860151825594840194600190910190840162000320565b5085821015620003605787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61229b80620003806000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610366578063cb7e905714610394578063e847e280146103b4578063f12b758a146103d4578063f2fde38b146103f4578063fad28a241461041457600080fd5b80637a805598146102b45780637a9ccc4b146102d45780637d622184146102f45780637e1d42b5146103145780638da5cb5b1461033457600080fd5b80634eeb7391116100f25780634eeb73911461020d578063558850ac1461023f5780635bfd12b81461025f578063602f98341461027f578063715018a61461029f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461015c5780634252ae9b1461017c5780634bdb5597146101b35780634dcc0aa6146101e057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461117c565b610434565b005b34801561016857600080fd5b5061015a61017736600461117c565b610465565b34801561018857600080fd5b5061019c6101973660046111ce565b610521565b6040516101aa929190611234565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611365565b6105dd565b6040516101aa919061149e565b3480156101ec57600080fd5b506102006101fb366004611564565b610622565b6040516101aa919061164c565b34801561021957600080fd5b5061022d6102283660046111ce565b6107fd565b6040516101aa9695949392919061169c565b34801561024b57600080fd5b5061015a61025a3660046111ce565b610a55565b34801561026b57600080fd5b5061015a61027a366004611711565b610ab7565b34801561028b57600080fd5b5061015a61029a366004611787565b610b25565b3480156102ab57600080fd5b5061015a610b96565b3480156102c057600080fd5b5061015a6102cf36600461180d565b610baa565b3480156102e057600080fd5b506101d36102ef3660046118ce565b610c2c565b34801561030057600080fd5b506101d361030f3660046111ce565b610c64565b34801561032057600080fd5b5061015a61032f366004611958565b610d10565b34801561034057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101aa565b34801561037257600080fd5b506103866103813660046111ce565b610d7c565b6040519081526020016101aa565b3480156103a057600080fd5b5060015461034e906001600160a01b031681565b3480156103c057600080fd5b5061015a6103cf3660046119c2565b610d9d565b3480156103e057600080fd5b5061022d6103ef3660046111ce565b610dd3565b34801561040057600080fd5b5061015a61040f366004611a14565b610de3565b34801561042057600080fd5b5061015a61042f3660046111ce565b610e61565b6001546001600160a01b0316331461045f576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b6001546001600160a01b03163314610490576040516321bf7f4960e01b815260040160405180910390fd5b6000805b6005548110156104fb5785600582815481106104b2576104b2611a3d565b9060005260206000200154036104e957600581815481106104d5576104d5611a3d565b6000918252602082200155600191506104fb565b806104f381611a53565b915050610494565b508061051a57604051630781f76560e21b815260040160405180910390fd5b5050505050565b6003818154811061053157600080fd5b60009182526020909120600290910201805460018201805460ff90921693509061055a90611a7a565b80601f016020809104026020016040519081016040528092919081815260200182805461058690611a7a565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461060b576040516321bf7f4960e01b815260040160405180910390fd5b610616868484610e8c565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b03163314610662576040516321bf7f4960e01b815260040160405180910390fd5b600280546001810182556000919091528251805184926008027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace019190829081906106ad9082611b11565b506020918201516001909101558201518051600283019081906106d09082611b11565b5060209190910151600190910155604082015160048201805467ffffffffffffffff19166001600160401b03909216919091179055606082015160058201906107199082611b11565b50608082015180516006830180546020938401516001600160401b03908116600160401b026fffffffffffffffffffffffffffffffff199092169381169390931717905560a090930151600790920180549290931667ffffffffffffffff1992909216919091179091556040805180820182526001815290519091828101916107e391017f7b20226163636f756e74223a20226163636f756e74222c20227265706c79223a8152732022676f7420746865206d65737361676522207d60601b602082015260340190565b60405160208183030381529060405281525090505b919050565b6004818154811061080d57600080fd5b90600052602060002090600802016000915090508060000160405180604001604052908160008201805461084090611a7a565b80601f016020809104026020016040519081016040528092919081815260200182805461086c90611a7a565b80156108b95780601f1061088e576101008083540402835291602001916108b9565b820191906000526020600020905b81548152906001019060200180831161089c57829003601f168201915b5050505050815260200160018201548152505090806002016040518060400160405290816000820180546108ec90611a7a565b80601f016020809104026020016040519081016040528092919081815260200182805461091890611a7a565b80156109655780601f1061093a57610100808354040283529160200191610965565b820191906000526020600020905b81548152906001019060200180831161094857829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b039092169261099c90611a7a565b80601f01602080910402602001604051908101604052809291908181526020018280546109c890611a7a565b8015610a155780601f106109ea57610100808354040283529160200191610a15565b820191906000526020600020905b8154815290600101906020018083116109f857829003601f168201915b50506040805180820190915260068601546001600160401b038082168352600160401b909104811660208301526007909601549495909416925088915050565b610a5d610fb2565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b158015610aa357600080fd5b505af115801561051a573d6000803e3d6000fd5b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c90610aed908590889088908790600401611bf3565b600060405180830381600087803b158015610b0757600080fd5b505af1158015610b1b573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b03163314610b50576040516321bf7f4960e01b815260040160405180910390fd5b6004805460018101825560009190915281906008027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01610b918282611e89565b505050565b610b9e610fb2565b610ba8600061100c565b565b610bb2610fb2565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610bf0908b908b908b908b908b908b908b908b90600401612009565b600060405180830381600087803b158015610c0a57600080fd5b505af1158015610c1e573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610c5a576040516321bf7f4960e01b815260040160405180910390fd5b610616838361105c565b60068181548110610c7457600080fd5b906000526020600020016000915090508054610c8f90611a7a565b80601f0160208091040260200160405190810160405280929190818152602001828054610cbb90611a7a565b8015610d085780601f10610cdd57610100808354040283529160200191610d08565b820191906000526020600020905b815481529060010190602001808311610ceb57829003601f168201915b505050505081565b6001546001600160a01b03163314610d3b576040516321bf7f4960e01b815260040160405180910390fd5b6003805460018101825560009190915281906002027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0161045f82826120fc565b60058181548110610d8c57600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610dc8576040516321bf7f4960e01b815260040160405180910390fd5b61051a848383610e8c565b6002818154811061080d57600080fd5b610deb610fb2565b6001600160a01b038116610e555760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610e5e8161100c565b50565b6001546001600160a01b03163314610e5e576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610f915760068181548110610eae57610eae611a3d565b90600052602060002001604051602001610ec891906121df565b604051602081830303815290604052805190602001208484604051602001610ef1929190612255565b6040516020818303038152906040528051906020012003610f7f57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610fab9350505050565b80610f8981611a53565b915050610e91565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610ba85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e4c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060005b600654811015610f91576006818154811061107e5761107e611a3d565b9060005260206000200160405160200161109891906121df565b6040516020818303038152906040528051906020012084846040516020016110c1929190612255565b604051602081830303815290604052805190602001200361111c5783838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092945061112e9350505050565b8061112681611a53565b915050611061565b92915050565b60008083601f84011261114657600080fd5b5081356001600160401b0381111561115d57600080fd5b60208301915083602082850101111561117557600080fd5b9250929050565b6000806000806060858703121561119257600080fd5b8435935060208501356001600160401b038111156111af57600080fd5b6111bb87828801611134565b9598909750949560400135949350505050565b6000602082840312156111e057600080fd5b5035919050565b6000815180845260005b8181101561120d576020818501810151868301820152016111f1565b8181111561121f576000602083870101525b50601f01601f19169290920160200192915050565b821515815260406020820152600061124f60408301846111e7565b949350505050565b8035600381106107f857600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561129e5761129e611266565b60405290565b60405160c081016001600160401b038111828210171561129e5761129e611266565b604051601f8201601f191681016001600160401b03811182821017156112ee576112ee611266565b604052919050565b600082601f83011261130757600080fd5b81356001600160401b0381111561132057611320611266565b611333601f8201601f19166020016112c6565b81815284602083860101111561134857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a03121561138057600080fd5b61138988611257565b965060208801356001600160401b03808211156113a557600080fd5b818a0191508a601f8301126113b957600080fd5b8135818111156113cb576113cb611266565b8060051b6113db602082016112c6565b9182526020818501810192908101908e8411156113f757600080fd5b6020860192505b8383101561143557848335111561141457600080fd5b6114248f602085358901016112f6565b8252602092830192909101906113fe565b9a5050505060408a0135965060608a013591508082111561145557600080fd5b6114618b838c016112f6565b955060808a0135945060a08a013591508082111561147e57600080fd5b5061148b8a828b01611134565b989b979a50959850939692959293505050565b602081526000610fab60208301846111e7565b6000604082840312156114c357600080fd5b6114cb61127c565b905081356001600160401b038111156114e357600080fd5b6114ef848285016112f6565b8252506020820135602082015292915050565b6001600160401b0381168114610e5e57600080fd5b80356107f881611502565b60006040828403121561153457600080fd5b61153c61127c565b9050813561154981611502565b8152602082013561155981611502565b602082015292915050565b60006020828403121561157657600080fd5b81356001600160401b038082111561158d57600080fd5b9083019060e082860312156115a157600080fd5b6115a96112a4565b8235828111156115b857600080fd5b6115c4878286016114b1565b8252506020830135828111156115d957600080fd5b6115e5878286016114b1565b6020830152506115f760408401611517565b604082015260608301358281111561160e57600080fd5b61161a878286016112f6565b60608301525061162d8660808501611522565b608082015261163e60c08401611517565b60a082015295945050505050565b602081528151151560208201526000602083015160408084015261124f60608401826111e7565b600081516040845261168860408501826111e7565b602093840151949093019390935250919050565b60e0815260006116af60e0830189611673565b82810360208401526116c18189611673565b90506001600160401b03808816604085015283820360608501526116e582886111e7565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b6000806000806060858703121561172757600080fd5b84356001600160401b0381111561173d57600080fd5b61174987828801611134565b90955093505060208501359150604085013561176481611502565b939692955090935050565b600060e0828403121561178157600080fd5b50919050565b60006020828403121561179957600080fd5b81356001600160401b038111156117af57600080fd5b61124f8482850161176f565b8015158114610e5e57600080fd5b60008083601f8401126117db57600080fd5b5081356001600160401b038111156117f257600080fd5b6020830191508360208260051b850101111561117557600080fd5b60008060008060008060008060a0898b03121561182957600080fd5b88356001600160401b038082111561184057600080fd5b61184c8c838d01611134565b909a50985088915061186060208c01611257565b975060408b01359150611872826117bb565b90955060608a0135908082111561188857600080fd5b6118948c838d016117c9565b909650945060808b01359150808211156118ad57600080fd5b506118ba8b828c01611134565b999c989b5096995094979396929594505050565b60008060008060008060006080888a0312156118e957600080fd5b6118f288611257565b965060208801356001600160401b038082111561190e57600080fd5b61191a8b838c016117c9565b909850965060408a013591508082111561193357600080fd5b61193f8b838c01611134565b909650945060608a013591508082111561147e57600080fd5b6000806040838503121561196b57600080fd5b82356001600160401b038082111561198257600080fd5b61198e8683870161176f565b935060208501359150808211156119a457600080fd5b508301604081860312156119b757600080fd5b809150509250929050565b600080600080606085870312156119d857600080fd5b843593506020850135925060408501356001600160401b038111156119fc57600080fd5b611a0887828801611134565b95989497509550505050565b600060208284031215611a2657600080fd5b81356001600160a01b0381168114610fab57600080fd5b634e487b7160e01b600052603260045260246000fd5b600060018201611a7357634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c90821680611a8e57607f821691505b60208210810361178157634e487b7160e01b600052602260045260246000fd5b601f821115610b9157600081815260208120601f850160051c81016020861015611ad55750805b601f850160051c820191505b81811015611af457828155600101611ae1565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115611b2a57611b2a611266565b611b3e81611b388454611a7a565b84611aae565b602080601f831160018114611b6d5760008415611b5b5750858301515b611b658582611afc565b865550611af4565b600085815260208120601f198616915b82811015611b9c57888601518255948401946001909101908401611b7d565b5085821015611bba5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b848152606060208201526000611c0d606083018587611bca565b90506001600160401b038316604083015295945050505050565b60008235603e19833603018112611c3d57600080fd5b9190910192915050565b6000808335601e19843603018112611c5e57600080fd5b8301803591506001600160401b03821115611c7857600080fd5b60200191503681900382131561117557600080fd5b611c978283611c47565b6001600160401b03811115611cae57611cae611266565b611cc281611cbc8554611a7a565b85611aae565b6000601f821160018114611cf05760008315611cde5750838201355b611ce88482611afc565b865550611d4a565b600085815260209020601f19841690835b82811015611d215786850135825560209485019460019092019101611d01565b5084821015611d3e5760001960f88660031b161c19848701351681555b505060018360011b0185555b50505050602082013560018201555050565b6000813561112e81611502565b6001600160401b03831115611d8057611d80611266565b611d9483611d8e8354611a7a565b83611aae565b6000601f841160018114611dc25760008515611db05750838201355b611dba8682611afc565b84555061051a565b600083815260209020601f19861690835b82811015611df35786850135825560209485019460019092019101611dd3565b5086821015611e105760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135611e2d81611502565b815467ffffffffffffffff19166001600160401b038216178255506020820135611e5681611502565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617905550565b611e938283611c27565b611e9d8182611c47565b6001600160401b03811115611eb457611eb4611266565b611ec881611ec28654611a7a565b86611aae565b6000601f821160018114611ef65760008315611ee45750838201355b611eee8482611afc565b875550611f50565b600086815260209020601f19841690835b82811015611f275786850135825560209485019460019092019101611f07565b5084821015611f445760001960f88660031b161c19848701351681555b505060018360011b0186555b505050506020810135600183015550611f78611f6f6020840184611c27565b60028301611c8d565b611fa8611f8760408401611d5c565b600483016001600160401b0382166001600160401b03198254161781555050565b611fb56060830183611c47565b611fc3818360058601611d69565b5050611fd56080830160068301611e22565b612005611fe460c08401611d5c565b600783016001600160401b0382166001600160401b03198254161781555050565b5050565b60a08152600061201d60a083018a8c611bca565b602060038a1061203d57634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a8110156120d557858303601f190184528135368d9003601e1901811261208c57600080fd5b8c0185810190356001600160401b038111156120a757600080fd5b8036038213156120b657600080fd5b6120c1858284611bca565b958701959450505090840190600101612066565b505085810360808701526120ea81888a611bca565b9e9d5050505050505050505050505050565b8135612107816117bb565b815490151560ff1660ff19919091161781556001808201602061212c85820186611c47565b6001600160401b0381111561214357612143611266565b61215181611ec28654611a7a565b6000601f82116001811461217f576000831561216d5750838201355b6121778482611afc565b8755506121d4565b600086815260209020601f19841690835b828110156121ad5786850135825593870193908901908701612190565b50848210156121ca5760001960f88660031b161c19848701351681555b50508683881b0186555b505050505050505050565b60008083546121ed81611a7a565b60018281168015612205576001811461221a57612249565b60ff1984168752821515830287019450612249565b8760005260208060002060005b858110156122405781548a820152908401908201612227565b50505082870194505b50929695505050505050565b818382376000910190815291905056fea26469706673582212200f4423e36d0e28f5b21e80e35aad0e5f7477d0b34d78f390406aa0234f9491ac64736f6c634300080f0033"; + +type MarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: MarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class Mars__factory extends ContractFactory { + constructor(...args: MarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + Mars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): Mars__factory { + return super.connect(runner) as Mars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): MarsInterface { + return new Interface(_abi) as MarsInterface; + } + static connect(address: string, runner?: ContractRunner | null): Mars { + return new Contract(address, _abi, runner) as unknown as Mars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/PanickingMars__factory.ts b/src/evm/contracts/factories/Mars.sol/PanickingMars__factory.ts new file mode 100644 index 00000000..2ca9dd7a --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/PanickingMars__factory.ts @@ -0,0 +1,900 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + PanickingMars, + PanickingMarsInterface, +} from "../../Mars.sol/PanickingMars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f9565b503480156200005057600080fd5b5060405162002419380380620024198339810160408190526200007391620001d0565b80806200008033620000a9565b600180546001600160a01b0319166001600160a01b039290921691909117905550620003739050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000144579160200282015b82811115620001445782518290620001339082620002a7565b50916020019190600101906200011a565b506200015292915062000156565b5090565b80821115620001525760006200016d828262000177565b5060010162000156565b508054620001859062000218565b6000825580601f1062000196575050565b601f016020900490600052602060002090810190620001b69190620001b9565b50565b5b80821115620001525760008155600101620001ba565b600060208284031215620001e357600080fd5b81516001600160a01b0381168114620001fb57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022d57607f821691505b6020821081036200024e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a257600081815260208120601f850160051c810160208610156200027d5750805b601f850160051c820191505b818110156200029e5782815560010162000289565b5050505b505050565b81516001600160401b03811115620002c357620002c362000202565b620002db81620002d4845462000218565b8462000254565b602080601f831160018114620003135760008415620002fa5750858301515b600019600386901b1c1916600185901b1785556200029e565b600085815260208120601f198616915b82811015620003445788860151825594840194600190910190840162000323565b5085821015620003635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61209680620003836000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610366578063cb7e905714610394578063e847e280146103b4578063f12b758a146103d4578063f2fde38b146103f4578063fad28a241461041457600080fd5b80637a805598146102b45780637a9ccc4b146102d45780637d622184146102f45780637e1d42b5146103145780638da5cb5b1461033457600080fd5b80634eeb7391116100f25780634eeb73911461020d578063558850ac1461023f5780635bfd12b81461025f578063602f98341461027f578063715018a61461029f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461015c5780634252ae9b1461017c5780634bdb5597146101b35780634dcc0aa6146101e057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611015565b610434565b005b34801561016857600080fd5b5061015a610177366004611015565b610465565b34801561018857600080fd5b5061019c610197366004611067565b610521565b6040516101aa9291906110cd565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611203565b6105dd565b6040516101aa919061133c565b3480156101ec57600080fd5b506102006101fb366004611402565b610622565b6040516101aa91906114ea565b34801561021957600080fd5b5061022d610228366004611067565b610691565b6040516101aa9695949392919061153a565b34801561024b57600080fd5b5061015a61025a366004611067565b6108ee565b34801561026b57600080fd5b5061015a61027a3660046115af565b610950565b34801561028b57600080fd5b5061015a61029a366004611625565b6109be565b3480156102ab57600080fd5b5061015a610a2f565b3480156102c057600080fd5b5061015a6102cf3660046116ab565b610a43565b3480156102e057600080fd5b506101d36102ef36600461176c565b610ac5565b34801561030057600080fd5b506101d361030f366004611067565b610afd565b34801561032057600080fd5b5061015a61032f3660046117f6565b610ba9565b34801561034057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101aa565b34801561037257600080fd5b50610386610381366004611067565b610c15565b6040519081526020016101aa565b3480156103a057600080fd5b5060015461034e906001600160a01b031681565b3480156103c057600080fd5b5061015a6103cf366004611860565b610c36565b3480156103e057600080fd5b5061022d6103ef366004611067565b610c6c565b34801561040057600080fd5b5061015a61040f3660046118b2565b610c7c565b34801561042057600080fd5b5061015a61042f366004611067565b610cfa565b6001546001600160a01b0316331461045f576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b6001546001600160a01b03163314610490576040516321bf7f4960e01b815260040160405180910390fd5b6000805b6005548110156104fb5785600582815481106104b2576104b26118db565b9060005260206000200154036104e957600581815481106104d5576104d56118db565b6000918252602082200155600191506104fb565b806104f3816118f1565b915050610494565b508061051a57604051630781f76560e21b815260040160405180910390fd5b5050505050565b6003818154811061053157600080fd5b60009182526020909120600290910201805460018201805460ff90921693509061055a90611918565b80601f016020809104026020016040519081016040528092919081815260200182805461058690611918565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461060b576040516321bf7f4960e01b815260040160405180910390fd5b610616868484610d25565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b03163314610662576040516321bf7f4960e01b815260040160405180910390fd5b61066a61194c565b50506040805180820182526000808252825160208181019094529081529181019190915290565b600481815481106106a157600080fd5b9060005260206000209060080201600091509050806000016040518060400160405290816000820180546106d490611918565b80601f016020809104026020016040519081016040528092919081815260200182805461070090611918565b801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b50505050508152602001600182015481525050908060020160405180604001604052908160008201805461078090611918565b80601f01602080910402602001604051908101604052809291908181526020018280546107ac90611918565b80156107f95780601f106107ce576101008083540402835291602001916107f9565b820191906000526020600020905b8154815290600101906020018083116107dc57829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b039092169261083090611918565b80601f016020809104026020016040519081016040528092919081815260200182805461085c90611918565b80156108a95780601f1061087e576101008083540402835291602001916108a9565b820191906000526020600020905b81548152906001019060200180831161088c57829003601f168201915b50506040805180820190915260068601546001600160401b03808216835268010000000000000000909104811660208301526007909601549495909416925088915050565b6108f6610e4b565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b15801561093c57600080fd5b505af115801561051a573d6000803e3d6000fd5b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c9061098690859088908890879060040161198b565b600060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b031633146109e9576040516321bf7f4960e01b815260040160405180910390fd5b6004805460018101825560009190915281906008027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01610a2a8282611c84565b505050565b610a37610e4b565b610a416000610ea5565b565b610a4b610e4b565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610a89908b908b908b908b908b908b908b908b90600401611e04565b600060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610af3576040516321bf7f4960e01b815260040160405180910390fd5b6106168383610ef5565b60068181548110610b0d57600080fd5b906000526020600020016000915090508054610b2890611918565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5490611918565b8015610ba15780601f10610b7657610100808354040283529160200191610ba1565b820191906000526020600020905b815481529060010190602001808311610b8457829003601f168201915b505050505081565b6001546001600160a01b03163314610bd4576040516321bf7f4960e01b815260040160405180910390fd5b6003805460018101825560009190915281906002027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0161045f8282611ef7565b60058181548110610c2557600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610c61576040516321bf7f4960e01b815260040160405180910390fd5b61051a848383610d25565b600281815481106106a157600080fd5b610c84610e4b565b6001600160a01b038116610cee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610cf781610ea5565b50565b6001546001600160a01b03163314610cf7576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610e2a5760068181548110610d4757610d476118db565b90600052602060002001604051602001610d619190611fda565b604051602081830303815290604052805190602001208484604051602001610d8a929190612050565b6040516020818303038152906040528051906020012003610e1857600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610e449350505050565b80610e22816118f1565b915050610d2a565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610a415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ce5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060005b600654811015610e2a5760068181548110610f1757610f176118db565b90600052602060002001604051602001610f319190611fda565b604051602081830303815290604052805190602001208484604051602001610f5a929190612050565b6040516020818303038152906040528051906020012003610fb55783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450610fc79350505050565b80610fbf816118f1565b915050610efa565b92915050565b60008083601f840112610fdf57600080fd5b5081356001600160401b03811115610ff657600080fd5b60208301915083602082850101111561100e57600080fd5b9250929050565b6000806000806060858703121561102b57600080fd5b8435935060208501356001600160401b0381111561104857600080fd5b61105487828801610fcd565b9598909750949560400135949350505050565b60006020828403121561107957600080fd5b5035919050565b6000815180845260005b818110156110a65760208185018101518683018201520161108a565b818111156110b8576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006110e86040830184611080565b949350505050565b8035600381106110ff57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561113c5761113c611104565b60405290565b60405160c081016001600160401b038111828210171561113c5761113c611104565b604051601f8201601f191681016001600160401b038111828210171561118c5761118c611104565b604052919050565b600082601f8301126111a557600080fd5b81356001600160401b038111156111be576111be611104565b6111d1601f8201601f1916602001611164565b8181528460208386010111156111e657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a03121561121e57600080fd5b611227886110f0565b965060208801356001600160401b038082111561124357600080fd5b818a0191508a601f83011261125757600080fd5b81358181111561126957611269611104565b8060051b61127960208201611164565b9182526020818501810192908101908e84111561129557600080fd5b6020860192505b838310156112d35784833511156112b257600080fd5b6112c28f60208535890101611194565b82526020928301929091019061129c565b9a5050505060408a0135965060608a01359150808211156112f357600080fd5b6112ff8b838c01611194565b955060808a0135945060a08a013591508082111561131c57600080fd5b506113298a828b01610fcd565b989b979a50959850939692959293505050565b602081526000610e446020830184611080565b60006040828403121561136157600080fd5b61136961111a565b905081356001600160401b0381111561138157600080fd5b61138d84828501611194565b8252506020820135602082015292915050565b6001600160401b0381168114610cf757600080fd5b80356110ff816113a0565b6000604082840312156113d257600080fd5b6113da61111a565b905081356113e7816113a0565b815260208201356113f7816113a0565b602082015292915050565b60006020828403121561141457600080fd5b81356001600160401b038082111561142b57600080fd5b9083019060e0828603121561143f57600080fd5b611447611142565b82358281111561145657600080fd5b6114628782860161134f565b82525060208301358281111561147757600080fd5b6114838782860161134f565b602083015250611495604084016113b5565b60408201526060830135828111156114ac57600080fd5b6114b887828601611194565b6060830152506114cb86608085016113c0565b60808201526114dc60c084016113b5565b60a082015295945050505050565b60208152815115156020820152600060208301516040808401526110e86060840182611080565b60008151604084526115266040850182611080565b602093840151949093019390935250919050565b60e08152600061154d60e0830189611511565b828103602084015261155f8189611511565b90506001600160401b03808816604085015283820360608501526115838288611080565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b600080600080606085870312156115c557600080fd5b84356001600160401b038111156115db57600080fd5b6115e787828801610fcd565b909550935050602085013591506040850135611602816113a0565b939692955090935050565b600060e0828403121561161f57600080fd5b50919050565b60006020828403121561163757600080fd5b81356001600160401b0381111561164d57600080fd5b6110e88482850161160d565b8015158114610cf757600080fd5b60008083601f84011261167957600080fd5b5081356001600160401b0381111561169057600080fd5b6020830191508360208260051b850101111561100e57600080fd5b60008060008060008060008060a0898b0312156116c757600080fd5b88356001600160401b03808211156116de57600080fd5b6116ea8c838d01610fcd565b909a5098508891506116fe60208c016110f0565b975060408b0135915061171082611659565b90955060608a0135908082111561172657600080fd5b6117328c838d01611667565b909650945060808b013591508082111561174b57600080fd5b506117588b828c01610fcd565b999c989b5096995094979396929594505050565b60008060008060008060006080888a03121561178757600080fd5b611790886110f0565b965060208801356001600160401b03808211156117ac57600080fd5b6117b88b838c01611667565b909850965060408a01359150808211156117d157600080fd5b6117dd8b838c01610fcd565b909650945060608a013591508082111561131c57600080fd5b6000806040838503121561180957600080fd5b82356001600160401b038082111561182057600080fd5b61182c8683870161160d565b9350602085013591508082111561184257600080fd5b5083016040818603121561185557600080fd5b809150509250929050565b6000806000806060858703121561187657600080fd5b843593506020850135925060408501356001600160401b0381111561189a57600080fd5b6118a687828801610fcd565b95989497509550505050565b6000602082840312156118c457600080fd5b81356001600160a01b0381168114610e4457600080fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161191157634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c9082168061192c57607f821691505b60208210810361161f57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052600160045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8481526060602082015260006119a5606083018587611962565b90506001600160401b038316604083015295945050505050565b60008235603e198336030181126119d557600080fd5b9190910192915050565b6000808335601e198436030181126119f657600080fd5b8301803591506001600160401b03821115611a1057600080fd5b60200191503681900382131561100e57600080fd5b601f821115610a2a57600081815260208120601f850160051c81016020861015611a4c5750805b601f850160051c820191505b81811015611a6b57828155600101611a58565b505050505050565b600019600383901b1c191660019190911b1790565b611a9282836119df565b6001600160401b03811115611aa957611aa9611104565b611abd81611ab78554611918565b85611a25565b6000601f821160018114611aeb5760008315611ad95750838201355b611ae38482611a73565b865550611b45565b600085815260209020601f19841690835b82811015611b1c5786850135825560209485019460019092019101611afc565b5084821015611b395760001960f88660031b161c19848701351681555b505060018360011b0185555b50505050602082013560018201555050565b60008135610fc7816113a0565b6001600160401b03831115611b7b57611b7b611104565b611b8f83611b898354611918565b83611a25565b6000601f841160018114611bbd5760008515611bab5750838201355b611bb58682611a73565b84555061051a565b600083815260209020601f19861690835b82811015611bee5786850135825560209485019460019092019101611bce565b5086821015611c0b5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135611c28816113a0565b815467ffffffffffffffff19166001600160401b038216178255506020820135611c51816113a0565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617905550565b611c8e82836119bf565b611c9881826119df565b6001600160401b03811115611caf57611caf611104565b611cc381611cbd8654611918565b86611a25565b6000601f821160018114611cf15760008315611cdf5750838201355b611ce98482611a73565b875550611d4b565b600086815260209020601f19841690835b82811015611d225786850135825560209485019460019092019101611d02565b5084821015611d3f5760001960f88660031b161c19848701351681555b505060018360011b0186555b505050506020810135600183015550611d73611d6a60208401846119bf565b60028301611a88565b611da3611d8260408401611b57565b600483016001600160401b0382166001600160401b03198254161781555050565b611db060608301836119df565b611dbe818360058601611b64565b5050611dd06080830160068301611c1d565b611e00611ddf60c08401611b57565b600783016001600160401b0382166001600160401b03198254161781555050565b5050565b60a081526000611e1860a083018a8c611962565b602060038a10611e3857634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a811015611ed057858303601f190184528135368d9003601e19018112611e8757600080fd5b8c0185810190356001600160401b03811115611ea257600080fd5b803603821315611eb157600080fd5b611ebc858284611962565b958701959450505090840190600101611e61565b50508581036080870152611ee581888a611962565b9e9d5050505050505050505050505050565b8135611f0281611659565b815490151560ff1660ff199190911617815560018082016020611f27858201866119df565b6001600160401b03811115611f3e57611f3e611104565b611f4c81611cbd8654611918565b6000601f821160018114611f7a5760008315611f685750838201355b611f728482611a73565b875550611fcf565b600086815260209020601f19841690835b82811015611fa85786850135825593870193908901908701611f8b565b5084821015611fc55760001960f88660031b161c19848701351681555b50508683881b0186555b505050505050505050565b6000808354611fe881611918565b60018281168015612000576001811461201557612044565b60ff1984168752821515830287019450612044565b8760005260208060002060005b8581101561203b5781548a820152908401908201612022565b50505082870194505b50929695505050505050565b818382376000910190815291905056fea264697066735822122012872f204f248c406e52f51eb4feaa218f2abad432c1f61b2aa9b2f213674edf64736f6c634300080f0033"; + +type PanickingMarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: PanickingMarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class PanickingMars__factory extends ContractFactory { + constructor(...args: PanickingMarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + PanickingMars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): PanickingMars__factory { + return super.connect(runner) as PanickingMars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): PanickingMarsInterface { + return new Interface(_abi) as PanickingMarsInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): PanickingMars { + return new Contract(address, _abi, runner) as unknown as PanickingMars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/RevertingBytesMars__factory.ts b/src/evm/contracts/factories/Mars.sol/RevertingBytesMars__factory.ts new file mode 100644 index 00000000..a6a04651 --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/RevertingBytesMars__factory.ts @@ -0,0 +1,910 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + RevertingBytesMars, + RevertingBytesMarsInterface, +} from "../../Mars.sol/RevertingBytesMars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "OnRecvPacketRevert", + inputs: [], + }, + { + type: "error", + name: "OnTimeoutPacket", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f9565b503480156200005057600080fd5b5060405162002009380380620020098339810160408190526200007391620001d0565b80806200008033620000a9565b600180546001600160a01b0319166001600160a01b039290921691909117905550620003739050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000144579160200282015b82811115620001445782518290620001339082620002a7565b50916020019190600101906200011a565b506200015292915062000156565b5090565b80821115620001525760006200016d828262000177565b5060010162000156565b508054620001859062000218565b6000825580601f1062000196575050565b601f016020900490600052602060002090810190620001b69190620001b9565b50565b5b80821115620001525760008155600101620001ba565b600060208284031215620001e357600080fd5b81516001600160a01b0381168114620001fb57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022d57607f821691505b6020821081036200024e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a257600081815260208120601f850160051c810160208610156200027d5750805b601f850160051c820191505b818110156200029e5782815560010162000289565b5050505b505050565b81516001600160401b03811115620002c357620002c362000202565b620002db81620002d4845462000218565b8462000254565b602080601f831160018114620003135760008415620002fa5750858301515b600019600386901b1c1916600185901b1785556200029e565b600085815260208120601f198616915b82811015620003445788860151825594840194600190910190840162000323565b5085821015620003635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b611c8680620003836000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610366578063cb7e905714610394578063e847e280146103b4578063f12b758a146103d4578063f2fde38b146103f4578063fad28a241461041457600080fd5b80637a805598146102b45780637a9ccc4b146102d45780637d622184146102f45780637e1d42b5146103145780638da5cb5b1461033457600080fd5b80634eeb7391116100f25780634eeb73911461020d578063558850ac1461023f5780635bfd12b81461025f578063602f98341461027f578063715018a61461029f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461015c5780634252ae9b1461017c5780634bdb5597146101b35780634dcc0aa6146101e057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004610ff1565b610434565b005b34801561016857600080fd5b5061015a610177366004610ff1565b610465565b34801561018857600080fd5b5061019c610197366004611043565b610521565b6040516101aa9291906110a9565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046111df565b6105dd565b6040516101aa9190611318565b3480156101ec57600080fd5b506102006101fb3660046113d1565b610622565b6040516101aa91906114b9565b34801561021957600080fd5b5061022d610228366004611043565b61069a565b6040516101aa96959493929190611509565b34801561024b57600080fd5b5061015a61025a366004611043565b6108f7565b34801561026b57600080fd5b5061015a61027a36600461157e565b610959565b34801561028b57600080fd5b5061015a61029a3660046115f2565b6109c7565b3480156102ab57600080fd5b5061015a610a0b565b3480156102c057600080fd5b5061015a6102cf366004611678565b610a1f565b3480156102e057600080fd5b506101d36102ef366004611739565b610aa1565b34801561030057600080fd5b506101d361030f366004611043565b610ad9565b34801561032057600080fd5b5061015a61032f3660046117c3565b610b85565b34801561034057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101aa565b34801561037257600080fd5b50610386610381366004611043565b610bf1565b6040519081526020016101aa565b3480156103a057600080fd5b5060015461034e906001600160a01b031681565b3480156103c057600080fd5b5061015a6103cf36600461182d565b610c12565b3480156103e057600080fd5b5061022d6103ef366004611043565b610c48565b34801561040057600080fd5b5061015a61040f36600461187f565b610c58565b34801561042057600080fd5b5061015a61042f366004611043565b610cd6565b6001546001600160a01b0316331461045f576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b6001546001600160a01b03163314610490576040516321bf7f4960e01b815260040160405180910390fd5b6000805b6005548110156104fb5785600582815481106104b2576104b26118a8565b9060005260206000200154036104e957600581815481106104d5576104d56118a8565b6000918252602082200155600191506104fb565b806104f3816118be565b915050610494565b508061051a57604051630781f76560e21b815260040160405180910390fd5b5050505050565b6003818154811061053157600080fd5b60009182526020909120600290910201805460018201805460ff90921693509061055a906118e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610586906118e5565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461060b576040516321bf7f4960e01b815260040160405180910390fd5b610616868484610d01565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b03163314610662576040516321bf7f4960e01b815260040160405180910390fd5b506040805180820182526000808252825160208181018552918152908201528151639889d82160e01b81529151909181900360040190fd5b600481815481106106aa57600080fd5b9060005260206000209060080201600091509050806000016040518060400160405290816000820180546106dd906118e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610709906118e5565b80156107565780601f1061072b57610100808354040283529160200191610756565b820191906000526020600020905b81548152906001019060200180831161073957829003601f168201915b505050505081526020016001820154815250509080600201604051806040016040529081600082018054610789906118e5565b80601f01602080910402602001604051908101604052809291908181526020018280546107b5906118e5565b80156108025780601f106107d757610100808354040283529160200191610802565b820191906000526020600020905b8154815290600101906020018083116107e557829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b0390921692610839906118e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610865906118e5565b80156108b25780601f10610887576101008083540402835291602001916108b2565b820191906000526020600020905b81548152906001019060200180831161089557829003601f168201915b50506040805180820190915260068601546001600160401b03808216835268010000000000000000909104811660208301526007909601549495909416925088915050565b6108ff610e27565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b15801561094557600080fd5b505af115801561051a573d6000803e3d6000fd5b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c9061098f908590889088908790600401611942565b600060405180830381600087803b1580156109a957600080fd5b505af11580156109bd573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b031633146109f2576040516321bf7f4960e01b815260040160405180910390fd5b604051631021bb3b60e31b815260040160405180910390fd5b610a13610e27565b610a1d6000610e81565b565b610a27610e27565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610a65908b908b908b908b908b908b908b908b90600401611976565b600060405180830381600087803b158015610a7f57600080fd5b505af1158015610a93573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610acf576040516321bf7f4960e01b815260040160405180910390fd5b6106168383610ed1565b60068181548110610ae957600080fd5b906000526020600020016000915090508054610b04906118e5565b80601f0160208091040260200160405190810160405280929190818152602001828054610b30906118e5565b8015610b7d5780601f10610b5257610100808354040283529160200191610b7d565b820191906000526020600020905b815481529060010190602001808311610b6057829003601f168201915b505050505081565b6001546001600160a01b03163314610bb0576040516321bf7f4960e01b815260040160405180910390fd5b6003805460018101825560009190915281906002027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0161045f8282611ab8565b60058181548110610c0157600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610c3d576040516321bf7f4960e01b815260040160405180910390fd5b61051a848383610d01565b600281815481106106aa57600080fd5b610c60610e27565b6001600160a01b038116610cca5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610cd381610e81565b50565b6001546001600160a01b03163314610cd3576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610e065760068181548110610d2357610d236118a8565b90600052602060002001604051602001610d3d9190611bca565b604051602081830303815290604052805190602001208484604051602001610d66929190611c40565b6040516020818303038152906040528051906020012003610df457600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610e209350505050565b80610dfe816118be565b915050610d06565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610a1d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cc1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060005b600654811015610e065760068181548110610ef357610ef36118a8565b90600052602060002001604051602001610f0d9190611bca565b604051602081830303815290604052805190602001208484604051602001610f36929190611c40565b6040516020818303038152906040528051906020012003610f915783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450610fa39350505050565b80610f9b816118be565b915050610ed6565b92915050565b60008083601f840112610fbb57600080fd5b5081356001600160401b03811115610fd257600080fd5b602083019150836020828501011115610fea57600080fd5b9250929050565b6000806000806060858703121561100757600080fd5b8435935060208501356001600160401b0381111561102457600080fd5b61103087828801610fa9565b9598909750949560400135949350505050565b60006020828403121561105557600080fd5b5035919050565b6000815180845260005b8181101561108257602081850181015186830182015201611066565b81811115611094576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006110c4604083018461105c565b949350505050565b8035600381106110db57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611118576111186110e0565b60405290565b60405160c081016001600160401b0381118282101715611118576111186110e0565b604051601f8201601f191681016001600160401b0381118282101715611168576111686110e0565b604052919050565b600082601f83011261118157600080fd5b81356001600160401b0381111561119a5761119a6110e0565b6111ad601f8201601f1916602001611140565b8181528460208386010111156111c257600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156111fa57600080fd5b611203886110cc565b965060208801356001600160401b038082111561121f57600080fd5b818a0191508a601f83011261123357600080fd5b813581811115611245576112456110e0565b8060051b61125560208201611140565b9182526020818501810192908101908e84111561127157600080fd5b6020860192505b838310156112af57848335111561128e57600080fd5b61129e8f60208535890101611170565b825260209283019290910190611278565b9a5050505060408a0135965060608a01359150808211156112cf57600080fd5b6112db8b838c01611170565b955060808a0135945060a08a01359150808211156112f857600080fd5b506113058a828b01610fa9565b989b979a50959850939692959293505050565b602081526000610e20602083018461105c565b60006040828403121561133d57600080fd5b6113456110f6565b905081356001600160401b0381111561135d57600080fd5b61136984828501611170565b8252506020820135602082015292915050565b80356001600160401b03811681146110db57600080fd5b6000604082840312156113a557600080fd5b6113ad6110f6565b90506113b88261137c565b81526113c66020830161137c565b602082015292915050565b6000602082840312156113e357600080fd5b81356001600160401b03808211156113fa57600080fd5b9083019060e0828603121561140e57600080fd5b61141661111e565b82358281111561142557600080fd5b6114318782860161132b565b82525060208301358281111561144657600080fd5b6114528782860161132b565b6020830152506114646040840161137c565b604082015260608301358281111561147b57600080fd5b61148787828601611170565b60608301525061149a8660808501611393565b60808201526114ab60c0840161137c565b60a082015295945050505050565b60208152815115156020820152600060208301516040808401526110c4606084018261105c565b60008151604084526114f5604085018261105c565b602093840151949093019390935250919050565b60e08152600061151c60e08301896114e0565b828103602084015261152e81896114e0565b90506001600160401b0380881660408501528382036060850152611552828861105c565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b6000806000806060858703121561159457600080fd5b84356001600160401b038111156115aa57600080fd5b6115b687828801610fa9565b909550935050602085013591506115cf6040860161137c565b905092959194509250565b600060e082840312156115ec57600080fd5b50919050565b60006020828403121561160457600080fd5b81356001600160401b0381111561161a57600080fd5b6110c4848285016115da565b8015158114610cd357600080fd5b60008083601f84011261164657600080fd5b5081356001600160401b0381111561165d57600080fd5b6020830191508360208260051b8501011115610fea57600080fd5b60008060008060008060008060a0898b03121561169457600080fd5b88356001600160401b03808211156116ab57600080fd5b6116b78c838d01610fa9565b909a5098508891506116cb60208c016110cc565b975060408b013591506116dd82611626565b90955060608a013590808211156116f357600080fd5b6116ff8c838d01611634565b909650945060808b013591508082111561171857600080fd5b506117258b828c01610fa9565b999c989b5096995094979396929594505050565b60008060008060008060006080888a03121561175457600080fd5b61175d886110cc565b965060208801356001600160401b038082111561177957600080fd5b6117858b838c01611634565b909850965060408a013591508082111561179e57600080fd5b6117aa8b838c01610fa9565b909650945060608a01359150808211156112f857600080fd5b600080604083850312156117d657600080fd5b82356001600160401b03808211156117ed57600080fd5b6117f9868387016115da565b9350602085013591508082111561180f57600080fd5b5083016040818603121561182257600080fd5b809150509250929050565b6000806000806060858703121561184357600080fd5b843593506020850135925060408501356001600160401b0381111561186757600080fd5b61187387828801610fa9565b95989497509550505050565b60006020828403121561189157600080fd5b81356001600160a01b0381168114610e2057600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016118de57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806118f957607f821691505b6020821081036115ec57634e487b7160e01b600052602260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b84815260606020820152600061195c606083018587611919565b90506001600160401b038316604083015295945050505050565b60a08152600061198a60a083018a8c611919565b602060038a106119aa57634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a811015611a4257858303601f190184528135368d9003601e190181126119f957600080fd5b8c0185810190356001600160401b03811115611a1457600080fd5b803603821315611a2357600080fd5b611a2e858284611919565b9587019594505050908401906001016119d3565b50508581036080870152611a5781888a611919565b9e9d5050505050505050505050505050565b601f821115611ab357600081815260208120601f850160051c81016020861015611a905750805b601f850160051c820191505b81811015611aaf57828155600101611a9c565b5050505b505050565b8135611ac381611626565b815490151560ff1660ff1991909116178155600180820160208481013536869003601e19018112611af357600080fd5b850180356001600160401b03811115611b0b57600080fd5b8036038383011315611b1c57600080fd5b611b3081611b2a86546118e5565b86611a69565b6000601f821160018114611b665760008315611b4e57508382018501355b600019600385901b1c1916600184901b178655611bbf565b600086815260209020601f19841690835b82811015611b9657868501880135825593870193908901908701611b77565b5084821015611bb55760001960f88660031b161c198785880101351681555b50508683881b0186555b505050505050505050565b6000808354611bd8816118e5565b60018281168015611bf05760018114611c0557611c34565b60ff1984168752821515830287019450611c34565b8760005260208060002060005b85811015611c2b5781548a820152908401908201611c12565b50505082870194505b50929695505050505050565b818382376000910190815291905056fea2646970667358221220564db57011e74598751ce62178066618710d74ba52266f46e1e7bfd3e2093e8164736f6c634300080f0033"; + +type RevertingBytesMarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: RevertingBytesMarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class RevertingBytesMars__factory extends ContractFactory { + constructor(...args: RevertingBytesMarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + RevertingBytesMars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): RevertingBytesMars__factory { + return super.connect(runner) as RevertingBytesMars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): RevertingBytesMarsInterface { + return new Interface(_abi) as RevertingBytesMarsInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): RevertingBytesMars { + return new Contract(address, _abi, runner) as unknown as RevertingBytesMars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/RevertingEmptyMars__factory.ts b/src/evm/contracts/factories/Mars.sol/RevertingEmptyMars__factory.ts new file mode 100644 index 00000000..081896ed --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/RevertingEmptyMars__factory.ts @@ -0,0 +1,900 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + RevertingEmptyMars, + RevertingEmptyMarsInterface, +} from "../../Mars.sol/RevertingEmptyMars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f9565b503480156200005057600080fd5b50604051620023d4380380620023d48339810160408190526200007391620001d0565b80806200008033620000a9565b600180546001600160a01b0319166001600160a01b039290921691909117905550620003739050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000144579160200282015b82811115620001445782518290620001339082620002a7565b50916020019190600101906200011a565b506200015292915062000156565b5090565b80821115620001525760006200016d828262000177565b5060010162000156565b508054620001859062000218565b6000825580601f1062000196575050565b601f016020900490600052602060002090810190620001b69190620001b9565b50565b5b80821115620001525760008155600101620001ba565b600060208284031215620001e357600080fd5b81516001600160a01b0381168114620001fb57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022d57607f821691505b6020821081036200024e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a257600081815260208120601f850160051c810160208610156200027d5750805b601f850160051c820191505b818110156200029e5782815560010162000289565b5050505b505050565b81516001600160401b03811115620002c357620002c362000202565b620002db81620002d4845462000218565b8462000254565b602080601f831160018114620003135760008415620002fa5750858301515b600019600386901b1c1916600185901b1785556200029e565b600085815260208120601f198616915b82811015620003445788860151825594840194600190910190840162000323565b5085821015620003635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61205180620003836000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610366578063cb7e905714610394578063e847e280146103b4578063f12b758a146103d4578063f2fde38b146103f4578063fad28a241461041457600080fd5b80637a805598146102b45780637a9ccc4b146102d45780637d622184146102f45780637e1d42b5146103145780638da5cb5b1461033457600080fd5b80634eeb7391116100f25780634eeb73911461020d578063558850ac1461023f5780635bfd12b81461025f578063602f98341461027f578063715018a61461029f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461015c5780634252ae9b1461017c5780634bdb5597146101b35780634dcc0aa6146101e057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004610fe6565b610434565b005b34801561016857600080fd5b5061015a610177366004610fe6565b610465565b34801561018857600080fd5b5061019c610197366004611038565b610521565b6040516101aa92919061109e565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046111d4565b6105dd565b6040516101aa919061130d565b3480156101ec57600080fd5b506102006101fb3660046113d3565b610622565b6040516101aa91906114bb565b34801561021957600080fd5b5061022d610228366004611038565b610662565b6040516101aa9695949392919061150b565b34801561024b57600080fd5b5061015a61025a366004611038565b6108bf565b34801561026b57600080fd5b5061015a61027a366004611580565b610921565b34801561028b57600080fd5b5061015a61029a3660046115f6565b61098f565b3480156102ab57600080fd5b5061015a610a00565b3480156102c057600080fd5b5061015a6102cf36600461167c565b610a14565b3480156102e057600080fd5b506101d36102ef36600461173d565b610a96565b34801561030057600080fd5b506101d361030f366004611038565b610ace565b34801561032057600080fd5b5061015a61032f3660046117c7565b610b7a565b34801561034057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101aa565b34801561037257600080fd5b50610386610381366004611038565b610be6565b6040519081526020016101aa565b3480156103a057600080fd5b5060015461034e906001600160a01b031681565b3480156103c057600080fd5b5061015a6103cf366004611831565b610c07565b3480156103e057600080fd5b5061022d6103ef366004611038565b610c3d565b34801561040057600080fd5b5061015a61040f366004611883565b610c4d565b34801561042057600080fd5b5061015a61042f366004611038565b610ccb565b6001546001600160a01b0316331461045f576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b6001546001600160a01b03163314610490576040516321bf7f4960e01b815260040160405180910390fd5b6000805b6005548110156104fb5785600582815481106104b2576104b26118ac565b9060005260206000200154036104e957600581815481106104d5576104d56118ac565b6000918252602082200155600191506104fb565b806104f3816118c2565b915050610494565b508061051a57604051630781f76560e21b815260040160405180910390fd5b5050505050565b6003818154811061053157600080fd5b60009182526020909120600290910201805460018201805460ff90921693509061055a906118e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610586906118e9565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461060b576040516321bf7f4960e01b815260040160405180910390fd5b610616868484610cf6565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b03163314610135576040516321bf7f4960e01b815260040160405180910390fd5b6004818154811061067257600080fd5b9060005260206000209060080201600091509050806000016040518060400160405290816000820180546106a5906118e9565b80601f01602080910402602001604051908101604052809291908181526020018280546106d1906118e9565b801561071e5780601f106106f35761010080835404028352916020019161071e565b820191906000526020600020905b81548152906001019060200180831161070157829003601f168201915b505050505081526020016001820154815250509080600201604051806040016040529081600082018054610751906118e9565b80601f016020809104026020016040519081016040528092919081815260200182805461077d906118e9565b80156107ca5780601f1061079f576101008083540402835291602001916107ca565b820191906000526020600020905b8154815290600101906020018083116107ad57829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b0390921692610801906118e9565b80601f016020809104026020016040519081016040528092919081815260200182805461082d906118e9565b801561087a5780601f1061084f5761010080835404028352916020019161087a565b820191906000526020600020905b81548152906001019060200180831161085d57829003601f168201915b50506040805180820190915260068601546001600160401b03808216835268010000000000000000909104811660208301526007909601549495909416925088915050565b6108c7610e1c565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b15801561090d57600080fd5b505af115801561051a573d6000803e3d6000fd5b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c90610957908590889088908790600401611946565b600060405180830381600087803b15801561097157600080fd5b505af1158015610985573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b031633146109ba576040516321bf7f4960e01b815260040160405180910390fd5b6004805460018101825560009190915281906008027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b016109fb8282611c3f565b505050565b610a08610e1c565b610a126000610e76565b565b610a1c610e1c565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610a5a908b908b908b908b908b908b908b908b90600401611dbf565b600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610ac4576040516321bf7f4960e01b815260040160405180910390fd5b6106168383610ec6565b60068181548110610ade57600080fd5b906000526020600020016000915090508054610af9906118e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b25906118e9565b8015610b725780601f10610b4757610100808354040283529160200191610b72565b820191906000526020600020905b815481529060010190602001808311610b5557829003601f168201915b505050505081565b6001546001600160a01b03163314610ba5576040516321bf7f4960e01b815260040160405180910390fd5b6003805460018101825560009190915281906002027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0161045f8282611eb2565b60058181548110610bf657600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610c32576040516321bf7f4960e01b815260040160405180910390fd5b61051a848383610cf6565b6002818154811061067257600080fd5b610c55610e1c565b6001600160a01b038116610cbf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610cc881610e76565b50565b6001546001600160a01b03163314610cc8576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610dfb5760068181548110610d1857610d186118ac565b90600052602060002001604051602001610d329190611f95565b604051602081830303815290604052805190602001208484604051602001610d5b92919061200b565b6040516020818303038152906040528051906020012003610de957600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610e159350505050565b80610df3816118c2565b915050610cfb565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610a125760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cb6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060005b600654811015610dfb5760068181548110610ee857610ee86118ac565b90600052602060002001604051602001610f029190611f95565b604051602081830303815290604052805190602001208484604051602001610f2b92919061200b565b6040516020818303038152906040528051906020012003610f865783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450610f989350505050565b80610f90816118c2565b915050610ecb565b92915050565b60008083601f840112610fb057600080fd5b5081356001600160401b03811115610fc757600080fd5b602083019150836020828501011115610fdf57600080fd5b9250929050565b60008060008060608587031215610ffc57600080fd5b8435935060208501356001600160401b0381111561101957600080fd5b61102587828801610f9e565b9598909750949560400135949350505050565b60006020828403121561104a57600080fd5b5035919050565b6000815180845260005b818110156110775760208185018101518683018201520161105b565b81811115611089576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006110b96040830184611051565b949350505050565b8035600381106110d057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561110d5761110d6110d5565b60405290565b60405160c081016001600160401b038111828210171561110d5761110d6110d5565b604051601f8201601f191681016001600160401b038111828210171561115d5761115d6110d5565b604052919050565b600082601f83011261117657600080fd5b81356001600160401b0381111561118f5761118f6110d5565b6111a2601f8201601f1916602001611135565b8181528460208386010111156111b757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156111ef57600080fd5b6111f8886110c1565b965060208801356001600160401b038082111561121457600080fd5b818a0191508a601f83011261122857600080fd5b81358181111561123a5761123a6110d5565b8060051b61124a60208201611135565b9182526020818501810192908101908e84111561126657600080fd5b6020860192505b838310156112a457848335111561128357600080fd5b6112938f60208535890101611165565b82526020928301929091019061126d565b9a5050505060408a0135965060608a01359150808211156112c457600080fd5b6112d08b838c01611165565b955060808a0135945060a08a01359150808211156112ed57600080fd5b506112fa8a828b01610f9e565b989b979a50959850939692959293505050565b602081526000610e156020830184611051565b60006040828403121561133257600080fd5b61133a6110eb565b905081356001600160401b0381111561135257600080fd5b61135e84828501611165565b8252506020820135602082015292915050565b6001600160401b0381168114610cc857600080fd5b80356110d081611371565b6000604082840312156113a357600080fd5b6113ab6110eb565b905081356113b881611371565b815260208201356113c881611371565b602082015292915050565b6000602082840312156113e557600080fd5b81356001600160401b03808211156113fc57600080fd5b9083019060e0828603121561141057600080fd5b611418611113565b82358281111561142757600080fd5b61143387828601611320565b82525060208301358281111561144857600080fd5b61145487828601611320565b60208301525061146660408401611386565b604082015260608301358281111561147d57600080fd5b61148987828601611165565b60608301525061149c8660808501611391565b60808201526114ad60c08401611386565b60a082015295945050505050565b60208152815115156020820152600060208301516040808401526110b96060840182611051565b60008151604084526114f76040850182611051565b602093840151949093019390935250919050565b60e08152600061151e60e08301896114e2565b828103602084015261153081896114e2565b90506001600160401b03808816604085015283820360608501526115548288611051565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b6000806000806060858703121561159657600080fd5b84356001600160401b038111156115ac57600080fd5b6115b887828801610f9e565b9095509350506020850135915060408501356115d381611371565b939692955090935050565b600060e082840312156115f057600080fd5b50919050565b60006020828403121561160857600080fd5b81356001600160401b0381111561161e57600080fd5b6110b9848285016115de565b8015158114610cc857600080fd5b60008083601f84011261164a57600080fd5b5081356001600160401b0381111561166157600080fd5b6020830191508360208260051b8501011115610fdf57600080fd5b60008060008060008060008060a0898b03121561169857600080fd5b88356001600160401b03808211156116af57600080fd5b6116bb8c838d01610f9e565b909a5098508891506116cf60208c016110c1565b975060408b013591506116e18261162a565b90955060608a013590808211156116f757600080fd5b6117038c838d01611638565b909650945060808b013591508082111561171c57600080fd5b506117298b828c01610f9e565b999c989b5096995094979396929594505050565b60008060008060008060006080888a03121561175857600080fd5b611761886110c1565b965060208801356001600160401b038082111561177d57600080fd5b6117898b838c01611638565b909850965060408a01359150808211156117a257600080fd5b6117ae8b838c01610f9e565b909650945060608a01359150808211156112ed57600080fd5b600080604083850312156117da57600080fd5b82356001600160401b03808211156117f157600080fd5b6117fd868387016115de565b9350602085013591508082111561181357600080fd5b5083016040818603121561182657600080fd5b809150509250929050565b6000806000806060858703121561184757600080fd5b843593506020850135925060408501356001600160401b0381111561186b57600080fd5b61187787828801610f9e565b95989497509550505050565b60006020828403121561189557600080fd5b81356001600160a01b0381168114610e1557600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016118e257634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806118fd57607f821691505b6020821081036115f057634e487b7160e01b600052602260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b84815260606020820152600061196060608301858761191d565b90506001600160401b038316604083015295945050505050565b60008235603e1983360301811261199057600080fd5b9190910192915050565b6000808335601e198436030181126119b157600080fd5b8301803591506001600160401b038211156119cb57600080fd5b602001915036819003821315610fdf57600080fd5b601f8211156109fb57600081815260208120601f850160051c81016020861015611a075750805b601f850160051c820191505b81811015611a2657828155600101611a13565b505050505050565b600019600383901b1c191660019190911b1790565b611a4d828361199a565b6001600160401b03811115611a6457611a646110d5565b611a7881611a7285546118e9565b856119e0565b6000601f821160018114611aa65760008315611a945750838201355b611a9e8482611a2e565b865550611b00565b600085815260209020601f19841690835b82811015611ad75786850135825560209485019460019092019101611ab7565b5084821015611af45760001960f88660031b161c19848701351681555b505060018360011b0185555b50505050602082013560018201555050565b60008135610f9881611371565b6001600160401b03831115611b3657611b366110d5565b611b4a83611b4483546118e9565b836119e0565b6000601f841160018114611b785760008515611b665750838201355b611b708682611a2e565b84555061051a565b600083815260209020601f19861690835b82811015611ba95786850135825560209485019460019092019101611b89565b5086821015611bc65760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135611be381611371565b815467ffffffffffffffff19166001600160401b038216178255506020820135611c0c81611371565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617905550565b611c49828361197a565b611c53818261199a565b6001600160401b03811115611c6a57611c6a6110d5565b611c7e81611c7886546118e9565b866119e0565b6000601f821160018114611cac5760008315611c9a5750838201355b611ca48482611a2e565b875550611d06565b600086815260209020601f19841690835b82811015611cdd5786850135825560209485019460019092019101611cbd565b5084821015611cfa5760001960f88660031b161c19848701351681555b505060018360011b0186555b505050506020810135600183015550611d2e611d25602084018461197a565b60028301611a43565b611d5e611d3d60408401611b12565b600483016001600160401b0382166001600160401b03198254161781555050565b611d6b606083018361199a565b611d79818360058601611b1f565b5050611d8b6080830160068301611bd8565b611dbb611d9a60c08401611b12565b600783016001600160401b0382166001600160401b03198254161781555050565b5050565b60a081526000611dd360a083018a8c61191d565b602060038a10611df357634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a811015611e8b57858303601f190184528135368d9003601e19018112611e4257600080fd5b8c0185810190356001600160401b03811115611e5d57600080fd5b803603821315611e6c57600080fd5b611e7785828461191d565b958701959450505090840190600101611e1c565b50508581036080870152611ea081888a61191d565b9e9d5050505050505050505050505050565b8135611ebd8161162a565b815490151560ff1660ff199190911617815560018082016020611ee28582018661199a565b6001600160401b03811115611ef957611ef96110d5565b611f0781611c7886546118e9565b6000601f821160018114611f355760008315611f235750838201355b611f2d8482611a2e565b875550611f8a565b600086815260209020601f19841690835b82811015611f635786850135825593870193908901908701611f46565b5084821015611f805760001960f88660031b161c19848701351681555b50508683881b0186555b505050505050505050565b6000808354611fa3816118e9565b60018281168015611fbb5760018114611fd057611fff565b60ff1984168752821515830287019450611fff565b8760005260208060002060005b85811015611ff65781548a820152908401908201611fdd565b50505082870194505b50929695505050505050565b818382376000910190815291905056fea26469706673582212206cb6f3d115812ff51af78728cfb56129b929e239ecd07e1e772ffdafb199e0d264736f6c634300080f0033"; + +type RevertingEmptyMarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: RevertingEmptyMarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class RevertingEmptyMars__factory extends ContractFactory { + constructor(...args: RevertingEmptyMarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + RevertingEmptyMars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): RevertingEmptyMars__factory { + return super.connect(runner) as RevertingEmptyMars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): RevertingEmptyMarsInterface { + return new Interface(_abi) as RevertingEmptyMarsInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): RevertingEmptyMars { + return new Contract(address, _abi, runner) as unknown as RevertingEmptyMars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/RevertingStringCloseChannelMars__factory.ts b/src/evm/contracts/factories/Mars.sol/RevertingStringCloseChannelMars__factory.ts new file mode 100644 index 00000000..4ebd93d6 --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/RevertingStringCloseChannelMars__factory.ts @@ -0,0 +1,906 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + RevertingStringCloseChannelMars, + RevertingStringCloseChannelMarsInterface, +} from "../../Mars.sol/RevertingStringCloseChannelMars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ackPacket", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f9565b503480156200005057600080fd5b5060405162002591380380620025918339810160408190526200007391620001d0565b80806200008033620000a9565b600180546001600160a01b0319166001600160a01b039290921691909117905550620003739050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000144579160200282015b82811115620001445782518290620001339082620002a7565b50916020019190600101906200011a565b506200015292915062000156565b5090565b80821115620001525760006200016d828262000177565b5060010162000156565b508054620001859062000218565b6000825580601f1062000196575050565b601f016020900490600052602060002090810190620001b69190620001b9565b50565b5b80821115620001525760008155600101620001ba565b600060208284031215620001e357600080fd5b81516001600160a01b0381168114620001fb57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022d57607f821691505b6020821081036200024e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a257600081815260208120601f850160051c810160208610156200027d5750805b601f850160051c820191505b818110156200029e5782815560010162000289565b5050505b505050565b81516001600160401b03811115620002c357620002c362000202565b620002db81620002d4845462000218565b8462000254565b602080601f831160018114620003135760008415620002fa5750858301515b600019600386901b1c1916600185901b1785556200029e565b600085815260208120601f198616915b82811015620003445788860151825594840194600190910190840162000323565b5085821015620003635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61220e80620003836000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610346578063cb7e905714610374578063e847e28014610394578063f12b758a146103b4578063f2fde38b146103d4578063fad28a24146103f457600080fd5b80637a805598146102945780637a9ccc4b146102b45780637d622184146102d45780637e1d42b5146102f45780638da5cb5b1461031457600080fd5b80634eeb7391116100f25780634eeb7391146101ed578063558850ac1461021f5780635bfd12b81461023f578063602f98341461025f578063715018a61461027f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461013a5780634252ae9b1461015c5780634bdb5597146101935780634dcc0aa6146101c057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a6101553660046110ef565b610414565b005b34801561016857600080fd5b5061017c610177366004611141565b610492565b60405161018a9291906111a7565b60405180910390f35b34801561019f57600080fd5b506101b36101ae3660046112d8565b61054e565b60405161018a9190611411565b3480156101cc57600080fd5b506101e06101db3660046114d7565b610593565b60405161018a91906115bf565b3480156101f957600080fd5b5061020d610208366004611141565b61076e565b60405161018a9695949392919061160f565b34801561022b57600080fd5b5061015a61023a366004611141565b6109c6565b34801561024b57600080fd5b5061015a61025a366004611684565b610a2f565b34801561026b57600080fd5b5061015a61027a3660046116fa565b610a9d565b34801561028b57600080fd5b5061015a610b0e565b3480156102a057600080fd5b5061015a6102af366004611780565b610b22565b3480156102c057600080fd5b506101b36102cf366004611841565b610ba4565b3480156102e057600080fd5b506101b36102ef366004611141565b610bdc565b34801561030057600080fd5b5061015a61030f3660046118cb565b610c88565b34801561032057600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161018a565b34801561035257600080fd5b50610366610361366004611141565b610cf4565b60405190815260200161018a565b34801561038057600080fd5b5060015461032e906001600160a01b031681565b3480156103a057600080fd5b5061015a6103af366004611935565b610d15565b3480156103c057600080fd5b5061020d6103cf366004611141565b610d4b565b3480156103e057600080fd5b5061015a6103ef366004611987565b610d5b565b34801561040057600080fd5b5061015a61040f366004611141565b610dd4565b6001546001600160a01b0316331461043f576040516321bf7f4960e01b815260040160405180910390fd5b60405162461bcd60e51b815260206004820152601e60248201527f636c6f736520696263206368616e6e656c20697320726576657274696e67000060448201526064015b60405180910390fd5b50505050565b600381815481106104a257600080fd5b60009182526020909120600290910201805460018201805460ff9092169350906104cb906119b0565b80601f01602080910402602001604051908101604052809291908181526020018280546104f7906119b0565b80156105445780601f1061051957610100808354040283529160200191610544565b820191906000526020600020905b81548152906001019060200180831161052757829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461057c576040516321bf7f4960e01b815260040160405180910390fd5b610587868484610dff565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b031633146105d3576040516321bf7f4960e01b815260040160405180910390fd5b600280546001810182556000919091528251805184926008027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0191908290819061061e9082611a47565b506020918201516001909101558201518051600283019081906106419082611a47565b5060209190910151600190910155604082015160048201805467ffffffffffffffff19166001600160401b039092169190911790556060820151600582019061068a9082611a47565b50608082015180516006830180546020938401516001600160401b03908116600160401b026fffffffffffffffffffffffffffffffff199092169381169390931717905560a090930151600790920180549290931667ffffffffffffffff19929092169190911790915560408051808201825260018152905190918281019161075491017f7b20226163636f756e74223a20226163636f756e74222c20227265706c79223a8152732022676f7420746865206d65737361676522207d60601b602082015260340190565b60405160208183030381529060405281525090505b919050565b6004818154811061077e57600080fd5b9060005260206000209060080201600091509050806000016040518060400160405290816000820180546107b1906119b0565b80601f01602080910402602001604051908101604052809291908181526020018280546107dd906119b0565b801561082a5780601f106107ff5761010080835404028352916020019161082a565b820191906000526020600020905b81548152906001019060200180831161080d57829003601f168201915b50505050508152602001600182015481525050908060020160405180604001604052908160008201805461085d906119b0565b80601f0160208091040260200160405190810160405280929190818152602001828054610889906119b0565b80156108d65780601f106108ab576101008083540402835291602001916108d6565b820191906000526020600020905b8154815290600101906020018083116108b957829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b039092169261090d906119b0565b80601f0160208091040260200160405190810160405280929190818152602001828054610939906119b0565b80156109865780601f1061095b57610100808354040283529160200191610986565b820191906000526020600020905b81548152906001019060200180831161096957829003601f168201915b50506040805180820190915260068601546001600160401b038082168352600160401b909104811660208301526007909601549495909416925088915050565b6109ce610f25565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b158015610a1457600080fd5b505af1158015610a28573d6000803e3d6000fd5b5050505050565b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c90610a65908590889088908790600401611b29565b600060405180830381600087803b158015610a7f57600080fd5b505af1158015610a93573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b03163314610ac8576040516321bf7f4960e01b815260040160405180910390fd5b6004805460018101825560009190915281906008027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01610b098282611dbf565b505050565b610b16610f25565b610b206000610f7f565b565b610b2a610f25565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610b68908b908b908b908b908b908b908b908b90600401611f3f565b600060405180830381600087803b158015610b8257600080fd5b505af1158015610b96573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610bd2576040516321bf7f4960e01b815260040160405180910390fd5b6105878383610fcf565b60068181548110610bec57600080fd5b906000526020600020016000915090508054610c07906119b0565b80601f0160208091040260200160405190810160405280929190818152602001828054610c33906119b0565b8015610c805780601f10610c5557610100808354040283529160200191610c80565b820191906000526020600020905b815481529060010190602001808311610c6357829003601f168201915b505050505081565b6001546001600160a01b03163314610cb3576040516321bf7f4960e01b815260040160405180910390fd5b6003805460018101825560009190915281906002027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0161048c8282612032565b60058181548110610d0457600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610d40576040516321bf7f4960e01b815260040160405180910390fd5b610a28848383610dff565b6002818154811061077e57600080fd5b610d63610f25565b6001600160a01b038116610dc85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610483565b610dd181610f7f565b50565b6001546001600160a01b03163314610dd1576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610f045760068181548110610e2157610e21612115565b90600052602060002001604051602001610e3b919061212b565b604051602081830303815290604052805190602001208484604051602001610e649291906121a1565b6040516020818303038152906040528051906020012003610ef257600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610f1e9350505050565b80610efc816121b1565b915050610e04565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610b205760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610483565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060005b600654811015610f045760068181548110610ff157610ff1612115565b9060005260206000200160405160200161100b919061212b565b6040516020818303038152906040528051906020012084846040516020016110349291906121a1565b604051602081830303815290604052805190602001200361108f5783838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294506110a19350505050565b80611099816121b1565b915050610fd4565b92915050565b60008083601f8401126110b957600080fd5b5081356001600160401b038111156110d057600080fd5b6020830191508360208285010111156110e857600080fd5b9250929050565b6000806000806060858703121561110557600080fd5b8435935060208501356001600160401b0381111561112257600080fd5b61112e878288016110a7565b9598909750949560400135949350505050565b60006020828403121561115357600080fd5b5035919050565b6000815180845260005b8181101561118057602081850181015186830182015201611164565b81811115611192576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006111c2604083018461115a565b949350505050565b80356003811061076957600080fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611211576112116111d9565b60405290565b60405160c081016001600160401b0381118282101715611211576112116111d9565b604051601f8201601f191681016001600160401b0381118282101715611261576112616111d9565b604052919050565b600082601f83011261127a57600080fd5b81356001600160401b03811115611293576112936111d9565b6112a6601f8201601f1916602001611239565b8181528460208386010111156112bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156112f357600080fd5b6112fc886111ca565b965060208801356001600160401b038082111561131857600080fd5b818a0191508a601f83011261132c57600080fd5b81358181111561133e5761133e6111d9565b8060051b61134e60208201611239565b9182526020818501810192908101908e84111561136a57600080fd5b6020860192505b838310156113a857848335111561138757600080fd5b6113978f60208535890101611269565b825260209283019290910190611371565b9a5050505060408a0135965060608a01359150808211156113c857600080fd5b6113d48b838c01611269565b955060808a0135945060a08a01359150808211156113f157600080fd5b506113fe8a828b016110a7565b989b979a50959850939692959293505050565b602081526000610f1e602083018461115a565b60006040828403121561143657600080fd5b61143e6111ef565b905081356001600160401b0381111561145657600080fd5b61146284828501611269565b8252506020820135602082015292915050565b6001600160401b0381168114610dd157600080fd5b803561076981611475565b6000604082840312156114a757600080fd5b6114af6111ef565b905081356114bc81611475565b815260208201356114cc81611475565b602082015292915050565b6000602082840312156114e957600080fd5b81356001600160401b038082111561150057600080fd5b9083019060e0828603121561151457600080fd5b61151c611217565b82358281111561152b57600080fd5b61153787828601611424565b82525060208301358281111561154c57600080fd5b61155887828601611424565b60208301525061156a6040840161148a565b604082015260608301358281111561158157600080fd5b61158d87828601611269565b6060830152506115a08660808501611495565b60808201526115b160c0840161148a565b60a082015295945050505050565b60208152815115156020820152600060208301516040808401526111c2606084018261115a565b60008151604084526115fb604085018261115a565b602093840151949093019390935250919050565b60e08152600061162260e08301896115e6565b828103602084015261163481896115e6565b90506001600160401b0380881660408501528382036060850152611658828861115a565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b6000806000806060858703121561169a57600080fd5b84356001600160401b038111156116b057600080fd5b6116bc878288016110a7565b9095509350506020850135915060408501356116d781611475565b939692955090935050565b600060e082840312156116f457600080fd5b50919050565b60006020828403121561170c57600080fd5b81356001600160401b0381111561172257600080fd5b6111c2848285016116e2565b8015158114610dd157600080fd5b60008083601f84011261174e57600080fd5b5081356001600160401b0381111561176557600080fd5b6020830191508360208260051b85010111156110e857600080fd5b60008060008060008060008060a0898b03121561179c57600080fd5b88356001600160401b03808211156117b357600080fd5b6117bf8c838d016110a7565b909a5098508891506117d360208c016111ca565b975060408b013591506117e58261172e565b90955060608a013590808211156117fb57600080fd5b6118078c838d0161173c565b909650945060808b013591508082111561182057600080fd5b5061182d8b828c016110a7565b999c989b5096995094979396929594505050565b60008060008060008060006080888a03121561185c57600080fd5b611865886111ca565b965060208801356001600160401b038082111561188157600080fd5b61188d8b838c0161173c565b909850965060408a01359150808211156118a657600080fd5b6118b28b838c016110a7565b909650945060608a01359150808211156113f157600080fd5b600080604083850312156118de57600080fd5b82356001600160401b03808211156118f557600080fd5b611901868387016116e2565b9350602085013591508082111561191757600080fd5b5083016040818603121561192a57600080fd5b809150509250929050565b6000806000806060858703121561194b57600080fd5b843593506020850135925060408501356001600160401b0381111561196f57600080fd5b61197b878288016110a7565b95989497509550505050565b60006020828403121561199957600080fd5b81356001600160a01b0381168114610f1e57600080fd5b600181811c908216806119c457607f821691505b6020821081036116f457634e487b7160e01b600052602260045260246000fd5b601f821115610b0957600081815260208120601f850160051c81016020861015611a0b5750805b601f850160051c820191505b81811015611a2a57828155600101611a17565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115611a6057611a606111d9565b611a7481611a6e84546119b0565b846119e4565b602080601f831160018114611aa35760008415611a915750858301515b611a9b8582611a32565b865550611a2a565b600085815260208120601f198616915b82811015611ad257888601518255948401946001909101908401611ab3565b5085821015611af05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b848152606060208201526000611b43606083018587611b00565b90506001600160401b038316604083015295945050505050565b60008235603e19833603018112611b7357600080fd5b9190910192915050565b6000808335601e19843603018112611b9457600080fd5b8301803591506001600160401b03821115611bae57600080fd5b6020019150368190038213156110e857600080fd5b611bcd8283611b7d565b6001600160401b03811115611be457611be46111d9565b611bf881611bf285546119b0565b856119e4565b6000601f821160018114611c265760008315611c145750838201355b611c1e8482611a32565b865550611c80565b600085815260209020601f19841690835b82811015611c575786850135825560209485019460019092019101611c37565b5084821015611c745760001960f88660031b161c19848701351681555b505060018360011b0185555b50505050602082013560018201555050565b600081356110a181611475565b6001600160401b03831115611cb657611cb66111d9565b611cca83611cc483546119b0565b836119e4565b6000601f841160018114611cf85760008515611ce65750838201355b611cf08682611a32565b845550610a28565b600083815260209020601f19861690835b82811015611d295786850135825560209485019460019092019101611d09565b5086821015611d465760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135611d6381611475565b815467ffffffffffffffff19166001600160401b038216178255506020820135611d8c81611475565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617905550565b611dc98283611b5d565b611dd38182611b7d565b6001600160401b03811115611dea57611dea6111d9565b611dfe81611df886546119b0565b866119e4565b6000601f821160018114611e2c5760008315611e1a5750838201355b611e248482611a32565b875550611e86565b600086815260209020601f19841690835b82811015611e5d5786850135825560209485019460019092019101611e3d565b5084821015611e7a5760001960f88660031b161c19848701351681555b505060018360011b0186555b505050506020810135600183015550611eae611ea56020840184611b5d565b60028301611bc3565b611ede611ebd60408401611c92565b600483016001600160401b0382166001600160401b03198254161781555050565b611eeb6060830183611b7d565b611ef9818360058601611c9f565b5050611f0b6080830160068301611d58565b611f3b611f1a60c08401611c92565b600783016001600160401b0382166001600160401b03198254161781555050565b5050565b60a081526000611f5360a083018a8c611b00565b602060038a10611f7357634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a81101561200b57858303601f190184528135368d9003601e19018112611fc257600080fd5b8c0185810190356001600160401b03811115611fdd57600080fd5b803603821315611fec57600080fd5b611ff7858284611b00565b958701959450505090840190600101611f9c565b5050858103608087015261202081888a611b00565b9e9d5050505050505050505050505050565b813561203d8161172e565b815490151560ff1660ff19919091161781556001808201602061206285820186611b7d565b6001600160401b03811115612079576120796111d9565b61208781611df886546119b0565b6000601f8211600181146120b557600083156120a35750838201355b6120ad8482611a32565b87555061210a565b600086815260209020601f19841690835b828110156120e357868501358255938701939089019087016120c6565b50848210156121005760001960f88660031b161c19848701351681555b50508683881b0186555b505050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808354612139816119b0565b60018281168015612151576001811461216657612195565b60ff1984168752821515830287019450612195565b8760005260208060002060005b8581101561218c5781548a820152908401908201612173565b50505082870194505b50929695505050505050565b8183823760009101908152919050565b6000600182016121d157634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212201867f9b1df13340e48cedf7635c1f70f9de185b9d3d15ccb67a11f8f93bd610a64736f6c634300080f0033"; + +type RevertingStringCloseChannelMarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: RevertingStringCloseChannelMarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class RevertingStringCloseChannelMars__factory extends ContractFactory { + constructor(...args: RevertingStringCloseChannelMarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + RevertingStringCloseChannelMars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): RevertingStringCloseChannelMars__factory { + return super.connect(runner) as RevertingStringCloseChannelMars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): RevertingStringCloseChannelMarsInterface { + return new Interface(_abi) as RevertingStringCloseChannelMarsInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): RevertingStringCloseChannelMars { + return new Contract( + address, + _abi, + runner + ) as unknown as RevertingStringCloseChannelMars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/RevertingStringMars__factory.ts b/src/evm/contracts/factories/Mars.sol/RevertingStringMars__factory.ts new file mode 100644 index 00000000..b80333c9 --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/RevertingStringMars__factory.ts @@ -0,0 +1,906 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + RevertingStringMars, + RevertingStringMarsInterface, +} from "../../Mars.sol/RevertingStringMars"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "ackPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "connectedChannels", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "greet", + inputs: [ + { + name: "message", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "recvedPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "supportedVersions", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "timeoutPackets", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelClose", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "triggerChannelInit", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortId", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x600360c0818152620312e360ec1b60e0526080908152610140604052610100918252620322e360ec1b6101205260a09190915262000042906006906002620000f9565b503480156200005057600080fd5b50604051620022ec380380620022ec8339810160408190526200007391620001d0565b80806200008033620000a9565b600180546001600160a01b0319166001600160a01b039290921691909117905550620003739050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000144579160200282015b82811115620001445782518290620001339082620002a7565b50916020019190600101906200011a565b506200015292915062000156565b5090565b80821115620001525760006200016d828262000177565b5060010162000156565b508054620001859062000218565b6000825580601f1062000196575050565b601f016020900490600052602060002090810190620001b69190620001b9565b50565b5b80821115620001525760008155600101620001ba565b600060208284031215620001e357600080fd5b81516001600160a01b0381168114620001fb57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200022d57607f821691505b6020821081036200024e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002a257600081815260208120601f850160051c810160208610156200027d5750805b601f850160051c820191505b818110156200029e5782815560010162000289565b5050505b505050565b81516001600160401b03811115620002c357620002c362000202565b620002db81620002d4845462000218565b8462000254565b602080601f831160018114620003135760008415620002fa5750858301515b600019600386901b1c1916600185901b1785556200029e565b600085815260208120601f198616915b82811015620003445788860151825594840194600190910190840162000323565b5085821015620003635787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b611f6980620003836000396000f3fe60806040526004361061012e5760003560e01c80637a805598116100ab578063bb3f9f8d1161006f578063bb3f9f8d14610366578063cb7e905714610394578063e847e280146103b4578063f12b758a146103d4578063f2fde38b146103f4578063fad28a241461041457600080fd5b80637a805598146102b45780637a9ccc4b146102d45780637d622184146102f45780637e1d42b5146103145780638da5cb5b1461033457600080fd5b80634eeb7391116100f25780634eeb73911461020d578063558850ac1461023f5780635bfd12b81461025f578063602f98341461027f578063715018a61461029f57600080fd5b80631eb7dd5e1461013a5780633f9fdbe41461015c5780634252ae9b1461017c5780634bdb5597146101b35780634dcc0aa6146101e057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004610fe8565b610434565b005b34801561016857600080fd5b5061015a610177366004610fe8565b610465565b34801561018857600080fd5b5061019c61019736600461103a565b610521565b6040516101aa9291906110a0565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046111d6565b6105dd565b6040516101aa919061130f565b3480156101ec57600080fd5b506102006101fb3660046113d5565b610622565b6040516101aa91906114bd565b34801561021957600080fd5b5061022d61022836600461103a565b6106af565b6040516101aa9695949392919061150d565b34801561024b57600080fd5b5061015a61025a36600461103a565b61090c565b34801561026b57600080fd5b5061015a61027a366004611582565b61096e565b34801561028b57600080fd5b5061015a61029a3660046115f8565b6109dc565b3480156102ab57600080fd5b5061015a610a4d565b3480156102c057600080fd5b5061015a6102cf366004611670565b610a61565b3480156102e057600080fd5b506101d36102ef366004611736565b610ae3565b34801561030057600080fd5b506101d361030f36600461103a565b610b59565b34801561032057600080fd5b5061015a61032f3660046117c0565b610c05565b34801561034057600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101aa565b34801561037257600080fd5b5061038661038136600461103a565b610c88565b6040519081526020016101aa565b3480156103a057600080fd5b5060015461034e906001600160a01b031681565b3480156103c057600080fd5b5061015a6103cf36600461182a565b610ca9565b3480156103e057600080fd5b5061022d6103ef36600461103a565b610d1c565b34801561040057600080fd5b5061015a61040f36600461187c565b610d2c565b34801561042057600080fd5b5061015a61042f36600461103a565b610da5565b6001546001600160a01b0316331461045f576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b6001546001600160a01b03163314610490576040516321bf7f4960e01b815260040160405180910390fd5b6000805b6005548110156104fb5785600582815481106104b2576104b26118a5565b9060005260206000200154036104e957600581815481106104d5576104d56118a5565b6000918252602082200155600191506104fb565b806104f3816118bb565b915050610494565b508061051a57604051630781f76560e21b815260040160405180910390fd5b5050505050565b6003818154811061053157600080fd5b60009182526020909120600290910201805460018201805460ff90921693509061055a906118e2565b80601f0160208091040260200160405190810160405280929190818152602001828054610586906118e2565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b5050505050905082565b6001546060906001600160a01b0316331461060b576040516321bf7f4960e01b815260040160405180910390fd5b610616868484610dd0565b98975050505050505050565b6040805180820190915260008152606060208201526001546001600160a01b03163314610662576040516321bf7f4960e01b815260040160405180910390fd5b60405162461bcd60e51b815260206004820152601b60248201527f6f6e2072656376207061636b657420697320726576657274696e67000000000060448201526064015b60405180910390fd5b600481815481106106bf57600080fd5b9060005260206000209060080201600091509050806000016040518060400160405290816000820180546106f2906118e2565b80601f016020809104026020016040519081016040528092919081815260200182805461071e906118e2565b801561076b5780601f106107405761010080835404028352916020019161076b565b820191906000526020600020905b81548152906001019060200180831161074e57829003601f168201915b50505050508152602001600182015481525050908060020160405180604001604052908160008201805461079e906118e2565b80601f01602080910402602001604051908101604052809291908181526020018280546107ca906118e2565b80156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b505050918352505060019190910154602090910152600482015460058301805492936001600160401b039092169261084e906118e2565b80601f016020809104026020016040519081016040528092919081815260200182805461087a906118e2565b80156108c75780601f1061089c576101008083540402835291602001916108c7565b820191906000526020600020905b8154815290600101906020018083116108aa57829003601f168201915b50506040805180820190915260068601546001600160401b03808216835268010000000000000000909104811660208301526007909601549495909416925088915050565b610914610ef6565b6001546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b15801561095a57600080fd5b505af115801561051a573d6000803e3d6000fd5b6001546040516330f8455760e21b81526001600160a01b039091169063c3e1155c906109a490859088908890879060040161193f565b600060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b5050505050505050565b6001546001600160a01b03163314610a07576040516321bf7f4960e01b815260040160405180910390fd5b6004805460018101825560009190915281906008027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01610a488282611c3e565b505050565b610a55610ef6565b610a5f6000610f50565b565b610a69610ef6565b60015460405163418925b760e01b81526001600160a01b039091169063418925b790610aa7908b908b908b908b908b908b908b908b90600401611dba565b600060405180830381600087803b158015610ac157600080fd5b505af1158015610ad5573d6000803e3d6000fd5b505050505050505050505050565b6001546060906001600160a01b03163314610b11576040516321bf7f4960e01b815260040160405180910390fd5b60405162461bcd60e51b815260206004820152601d60248201527f6f70656e20696263206368616e6e656c20697320726576657274696e6700000060448201526064016106a6565b60068181548110610b6957600080fd5b906000526020600020016000915090508054610b84906118e2565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb0906118e2565b8015610bfd5780601f10610bd257610100808354040283529160200191610bfd565b820191906000526020600020905b815481529060010190602001808311610be057829003601f168201915b505050505081565b6001546001600160a01b03163314610c30576040516321bf7f4960e01b815260040160405180910390fd5b60405162461bcd60e51b815260206004820152602360248201527f61636b6e6f776c656467656d656e74207061636b657420697320726576657274604482015262696e6760e81b60648201526084016106a6565b5050565b60058181548110610c9857600080fd5b600091825260209091200154905081565b6001546001600160a01b03163314610cd4576040516321bf7f4960e01b815260040160405180910390fd5b60405162461bcd60e51b815260206004820181905260248201527f636f6e6e65637420696263206368616e6e656c20697320726576657274696e6760448201526064016106a6565b600281815481106106bf57600080fd5b610d34610ef6565b6001600160a01b038116610d995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106a6565b610da281610f50565b50565b6001546001600160a01b03163314610da2576040516321bf7f4960e01b815260040160405180910390fd5b606060005b600654811015610ed55760068181548110610df257610df26118a5565b90600052602060002001604051602001610e0c9190611ead565b604051602081830303815290604052805190602001208484604051602001610e35929190611f23565b6040516020818303038152906040528051906020012003610ec357600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001859055604080516020601f8601819004810282018101909252848152908590859081908401838280828437600092019190915250929450610eef9350505050565b80610ecd816118bb565b915050610dd5565b5060405163b01318a560e01b815260040160405180910390fd5b9392505050565b6000546001600160a01b03163314610a5f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f840112610fb257600080fd5b5081356001600160401b03811115610fc957600080fd5b602083019150836020828501011115610fe157600080fd5b9250929050565b60008060008060608587031215610ffe57600080fd5b8435935060208501356001600160401b0381111561101b57600080fd5b61102787828801610fa0565b9598909750949560400135949350505050565b60006020828403121561104c57600080fd5b5035919050565b6000815180845260005b818110156110795760208185018101518683018201520161105d565b8181111561108b576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006110bb6040830184611053565b949350505050565b8035600381106110d257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561110f5761110f6110d7565b60405290565b60405160c081016001600160401b038111828210171561110f5761110f6110d7565b604051601f8201601f191681016001600160401b038111828210171561115f5761115f6110d7565b604052919050565b600082601f83011261117857600080fd5b81356001600160401b03811115611191576111916110d7565b6111a4601f8201601f1916602001611137565b8181528460208386010111156111b957600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600080600060c0888a0312156111f157600080fd5b6111fa886110c3565b965060208801356001600160401b038082111561121657600080fd5b818a0191508a601f83011261122a57600080fd5b81358181111561123c5761123c6110d7565b8060051b61124c60208201611137565b9182526020818501810192908101908e84111561126857600080fd5b6020860192505b838310156112a657848335111561128557600080fd5b6112958f60208535890101611167565b82526020928301929091019061126f565b9a5050505060408a0135965060608a01359150808211156112c657600080fd5b6112d28b838c01611167565b955060808a0135945060a08a01359150808211156112ef57600080fd5b506112fc8a828b01610fa0565b989b979a50959850939692959293505050565b602081526000610eef6020830184611053565b60006040828403121561133457600080fd5b61133c6110ed565b905081356001600160401b0381111561135457600080fd5b61136084828501611167565b8252506020820135602082015292915050565b6001600160401b0381168114610da257600080fd5b80356110d281611373565b6000604082840312156113a557600080fd5b6113ad6110ed565b905081356113ba81611373565b815260208201356113ca81611373565b602082015292915050565b6000602082840312156113e757600080fd5b81356001600160401b03808211156113fe57600080fd5b9083019060e0828603121561141257600080fd5b61141a611115565b82358281111561142957600080fd5b61143587828601611322565b82525060208301358281111561144a57600080fd5b61145687828601611322565b60208301525061146860408401611388565b604082015260608301358281111561147f57600080fd5b61148b87828601611167565b60608301525061149e8660808501611393565b60808201526114af60c08401611388565b60a082015295945050505050565b60208152815115156020820152600060208301516040808401526110bb6060840182611053565b60008151604084526114f96040850182611053565b602093840151949093019390935250919050565b60e08152600061152060e08301896114e4565b828103602084015261153281896114e4565b90506001600160401b03808816604085015283820360608501526115568288611053565b92508086511660808501528060208701511660a085015280851660c08501525050979650505050505050565b6000806000806060858703121561159857600080fd5b84356001600160401b038111156115ae57600080fd5b6115ba87828801610fa0565b9095509350506020850135915060408501356115d581611373565b939692955090935050565b600060e082840312156115f257600080fd5b50919050565b60006020828403121561160a57600080fd5b81356001600160401b0381111561162057600080fd5b6110bb848285016115e0565b60008083601f84011261163e57600080fd5b5081356001600160401b0381111561165557600080fd5b6020830191508360208260051b8501011115610fe157600080fd5b60008060008060008060008060a0898b03121561168c57600080fd5b88356001600160401b03808211156116a357600080fd5b6116af8c838d01610fa0565b909a5098508891506116c360208c016110c3565b975060408b0135915081151582146116da57600080fd5b90955060608a013590808211156116f057600080fd5b6116fc8c838d0161162c565b909650945060808b013591508082111561171557600080fd5b506117228b828c01610fa0565b999c989b5096995094979396929594505050565b60008060008060008060006080888a03121561175157600080fd5b61175a886110c3565b965060208801356001600160401b038082111561177657600080fd5b6117828b838c0161162c565b909850965060408a013591508082111561179b57600080fd5b6117a78b838c01610fa0565b909650945060608a01359150808211156112ef57600080fd5b600080604083850312156117d357600080fd5b82356001600160401b03808211156117ea57600080fd5b6117f6868387016115e0565b9350602085013591508082111561180c57600080fd5b5083016040818603121561181f57600080fd5b809150509250929050565b6000806000806060858703121561184057600080fd5b843593506020850135925060408501356001600160401b0381111561186457600080fd5b61187087828801610fa0565b95989497509550505050565b60006020828403121561188e57600080fd5b81356001600160a01b0381168114610eef57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016118db57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806118f657607f821691505b6020821081036115f257634e487b7160e01b600052602260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b848152606060208201526000611959606083018587611916565b90506001600160401b038316604083015295945050505050565b60008235603e1983360301811261198957600080fd5b9190910192915050565b6000808335601e198436030181126119aa57600080fd5b8301803591506001600160401b038211156119c457600080fd5b602001915036819003821315610fe157600080fd5b601f821115610a4857600081815260208120601f850160051c81016020861015611a005750805b601f850160051c820191505b81811015611a1f57828155600101611a0c565b505050505050565b600019600383901b1c191660019190911b1790565b611a468283611993565b6001600160401b03811115611a5d57611a5d6110d7565b611a7181611a6b85546118e2565b856119d9565b6000601f821160018114611a9f5760008315611a8d5750838201355b611a978482611a27565b865550611af9565b600085815260209020601f19841690835b82811015611ad05786850135825560209485019460019092019101611ab0565b5084821015611aed5760001960f88660031b161c19848701351681555b505060018360011b0185555b50505050602082013560018201555050565b60008135611b1881611373565b92915050565b6001600160401b03831115611b3557611b356110d7565b611b4983611b4383546118e2565b836119d9565b6000601f841160018114611b775760008515611b655750838201355b611b6f8682611a27565b84555061051a565b600083815260209020601f19861690835b82811015611ba85786850135825560209485019460019092019101611b88565b5086821015611bc55760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135611be281611373565b815467ffffffffffffffff19166001600160401b038216178255506020820135611c0b81611373565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617905550565b611c488283611973565b611c528182611993565b6001600160401b03811115611c6957611c696110d7565b611c7d81611c7786546118e2565b866119d9565b6000601f821160018114611cab5760008315611c995750838201355b611ca38482611a27565b875550611d05565b600086815260209020601f19841690835b82811015611cdc5786850135825560209485019460019092019101611cbc565b5084821015611cf95760001960f88660031b161c19848701351681555b505060018360011b0186555b505050506020810135600183015550611d2d611d246020840184611973565b60028301611a3c565b611d5d611d3c60408401611b0b565b600483016001600160401b0382166001600160401b03198254161781555050565b611d6a6060830183611993565b611d78818360058601611b1e565b5050611d8a6080830160068301611bd7565b610c84611d9960c08401611b0b565b600783016001600160401b0382166001600160401b03198254161781555050565b60a081526000611dce60a083018a8c611916565b602060038a10611dee57634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a811015611e8657858303601f190184528135368d9003601e19018112611e3d57600080fd5b8c0185810190356001600160401b03811115611e5857600080fd5b803603821315611e6757600080fd5b611e72858284611916565b958701959450505090840190600101611e17565b50508581036080870152611e9b81888a611916565b9e9d5050505050505050505050505050565b6000808354611ebb816118e2565b60018281168015611ed35760018114611ee857611f17565b60ff1984168752821515830287019450611f17565b8760005260208060002060005b85811015611f0e5781548a820152908401908201611ef5565b50505082870194505b50929695505050505050565b818382376000910190815291905056fea264697066735822122084101430f7807abb08856564b325404e426f0e252a4f905eb4fa183e3a3c34a964736f6c634300080f0033"; + +type RevertingStringMarsConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: RevertingStringMarsConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class RevertingStringMars__factory extends ContractFactory { + constructor(...args: RevertingStringMarsConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_dispatcher, overrides || {}); + } + override deploy( + _dispatcher: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_dispatcher, overrides || {}) as Promise< + RevertingStringMars & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): RevertingStringMars__factory { + return super.connect(runner) as RevertingStringMars__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): RevertingStringMarsInterface { + return new Interface(_abi) as RevertingStringMarsInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): RevertingStringMars { + return new Contract( + address, + _abi, + runner + ) as unknown as RevertingStringMars; + } +} diff --git a/src/evm/contracts/factories/Mars.sol/index.ts b/src/evm/contracts/factories/Mars.sol/index.ts new file mode 100644 index 00000000..b850b869 --- /dev/null +++ b/src/evm/contracts/factories/Mars.sol/index.ts @@ -0,0 +1,9 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { Mars__factory } from "./Mars__factory"; +export { PanickingMars__factory } from "./PanickingMars__factory"; +export { RevertingBytesMars__factory } from "./RevertingBytesMars__factory"; +export { RevertingEmptyMars__factory } from "./RevertingEmptyMars__factory"; +export { RevertingStringCloseChannelMars__factory } from "./RevertingStringCloseChannelMars__factory"; +export { RevertingStringMars__factory } from "./RevertingStringMars__factory"; diff --git a/src/evm/contracts/factories/OpLightClient.sol/OptimisticLightClient__factory.ts b/src/evm/contracts/factories/OpLightClient.sol/OptimisticLightClient__factory.ts new file mode 100644 index 00000000..dcf2dc1e --- /dev/null +++ b/src/evm/contracts/factories/OpLightClient.sol/OptimisticLightClient__factory.ts @@ -0,0 +1,493 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + BigNumberish, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../../common"; +import type { + OptimisticLightClient, + OptimisticLightClientInterface, +} from "../../OpLightClient.sol/OptimisticLightClient"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "fraudProofWindowSeconds_", + type: "uint32", + internalType: "uint32", + }, + { + name: "verifier_", + type: "address", + internalType: "contract ProofVerifier", + }, + { + name: "_l1BlockProvider", + type: "address", + internalType: "contract L1Block", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "addOpConsensusState", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "consensusStates", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "fraudProofEndtime", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "fraudProofWindowSeconds", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getFraudProofEndtime", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getInternalState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "l1BlockProvider", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract L1Block", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifier", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract ProofVerifier", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "expectedValue", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "AppHashHasNotPassedFraudProofWindow", + inputs: [], + }, + { + type: "error", + name: "CannotUpdatePendingOptimisticConsensusState", + inputs: [], + }, +] as const; + +const _bytecode = + "0x608060405234801561001057600080fd5b50604051610d5f380380610d5f83398101604081905261002f91610084565b63ffffffff92909216600255600380546001600160a01b039283166001600160a01b031991821617909155600480549290931691161790556100da565b6001600160a01b038116811461008157600080fd5b50565b60008060006060848603121561009957600080fd5b835163ffffffff811681146100ad57600080fd5b60208501519093506100be8161006c565b60408501519092506100cf8161006c565b809150509250925092565b610c76806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80635922f420116100715780635922f4201461016f5780636304272014610197578063cb535ab5146101a0578063d56ff842146101b5578063eb772058146101e0578063fdaab4e5146101f357600080fd5b80631b738a22146100ae5780631bc97a78146100e15780632b7ac3f31461011157806334b80a411461013c57806344c9af281461015c575b600080fd5b6100ce6100bc366004610591565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b6100f46100ef366004610591565b610206565b6040805193845260208401929092521515908201526060016100d8565b600354610124906001600160a01b031681565b6040516001600160a01b0390911681526020016100d8565b6100ce61014a366004610591565b60016020526000908152604090205481565b6100f461016a366004610591565b610252565b61018261017d3660046105aa565b61026d565b604080519283529015156020830152016100d8565b6100ce60025481565b6101b36101ae36600461068b565b610441565b005b6100ce6101c3366004610591565b600090815260208181526040808320548352600190915290205490565b600454610124906001600160a01b031681565b6101b3610201366004610720565b6104ec565b600081815260208181526040808320548084526001909252822054829182918190811580159061024457506000838152600160205260409020544210155b935093509350509193909250565b600080600061026084610206565b9250925092509193909250565b60008281526020819052604081205481908082036103fd576003546004805460408051624dead360e51b815290516001600160a01b0394851694630a1bb8b5948d948d948c9493909116926309bd5a60928281019260209291908290030181865afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190610789565b60048054604080516341c0fac560e11b815290516001600160a01b0390921692638381f58a9282820192602092908290030181865afa15801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f91906107bb565b6040518663ffffffff1660e01b815260040161038f9594939291906108f4565b60006040518083038186803b1580156103a757600080fd5b505afa1580156103bb573d6000803e3d6000fd5b50505060008681526020819052604081208690556002549091506103df90426109ea565b60008681526001602052604081208290559094509250610438915050565b83810361041f5760009081526001602052604090205491505042811115610438565b60405163f0cd4ed960e01b815260040160405180910390fd5b94509492505050565b6000806104566100ef600160208a0135610a02565b92505091508061047957604051631234d8dd60e01b815260040160405180910390fd5b60035460405163c2f0329f60e01b81526001600160a01b039091169063c2f0329f906104b39085908a908a908a908a908f90600401610bbb565b60006040518083038186803b1580156104cb57600080fd5b505afa1580156104df573d6000803e3d6000fd5b5050505050505050505050565b6000806105016100ef60016020880135610a02565b92505091508061052457604051631234d8dd60e01b815260040160405180910390fd5b600354604051630a9b7b5d60e21b81526001600160a01b0390911690632a6ded749061055a908590889088908b90600401610c09565b60006040518083038186803b15801561057257600080fd5b505afa158015610586573d6000803e3d6000fd5b505050505050505050565b6000602082840312156105a357600080fd5b5035919050565b600080600080608085870312156105c057600080fd5b843567ffffffffffffffff808211156105d857600080fd5b90860190606082890312156105ec57600080fd5b9094506020860135908082111561060257600080fd5b5085016080818803121561061557600080fd5b93969395505050506040820135916060013590565b60006040828403121561063c57600080fd5b50919050565b60008083601f84011261065457600080fd5b50813567ffffffffffffffff81111561066c57600080fd5b60208301915083602082850101111561068457600080fd5b9250929050565b6000806000806000606086880312156106a357600080fd5b853567ffffffffffffffff808211156106bb57600080fd5b6106c789838a0161062a565b965060208801359150808211156106dd57600080fd5b6106e989838a01610642565b9096509450604088013591508082111561070257600080fd5b5061070f88828901610642565b969995985093965092949392505050565b60008060006040848603121561073557600080fd5b833567ffffffffffffffff8082111561074d57600080fd5b6107598783880161062a565b9450602086013591508082111561076f57600080fd5b5061077c86828701610642565b9497909650939450505050565b60006020828403121561079b57600080fd5b5051919050565b67ffffffffffffffff811681146107b857600080fd5b50565b6000602082840312156107cd57600080fd5b81516107d8816107a2565b9392505050565b6000808335601e198436030181126107f657600080fd5b830160208101925035905067ffffffffffffffff81111561081657600080fd5b8060051b360382131561068457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261086857600080fd5b830160208101925035905067ffffffffffffffff81111561088857600080fd5b80360382131561068457600080fd5b81835260006020808501808196508560051b810191508460005b878110156108e75782840389526108c88288610851565b6108d3868284610828565b9a87019a95505050908401906001016108b1565b5091979650505050505050565b60a08152600061090487886107df565b606060a085015261091a61010085018284610897565b915050602088013560c08401526040880135610935816107a2565b67ffffffffffffffff1660e0840152828103602084015261095687806107df565b60808352610968608084018284610897565b91505061097860208901896107df565b838303602085015261098b838284610897565b92505050604088013560408301526060880135606083015280925050508460408301528360608301526109ca608083018467ffffffffffffffff169052565b9695505050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156109fd576109fd6109d4565b500190565b600082821015610a1457610a146109d4565b500390565b600060408301610a2983846107df565b604086528281845260608701905060608260051b88010193508260005b83811015610ba257888603605f1901835236859003607e1901823512610a6b57600080fd5b8482350160808701610a7d82836107df565b60808a528281845260a08b01905060a08260051b8c010193508260005b83811015610b1b578c8603609f19018352813536869003603e19018112610ac057600080fd5b8501610acc8180610851565b60408952610ade60408a018284610828565b915050610aee6020830183610851565b925088820360208a0152610b03828483610828565b98505050602093840193929092019150600101610a9a565b5050505050610b2d6020830183610851565b89830360208b0152610b40838284610828565b92505050610b516040830183610851565b89830360408b0152610b64838284610828565b92505050610b756060830183610851565b925088820360608a0152610b8a828483610828565b98505050602093840193929092019150600101610a46565b5050505050602083013560208501528091505092915050565b868152608060208201526000610bd5608083018789610828565b8281036040840152610be8818688610828565b90508281036060840152610bfc8185610a19565b9998505050505050505050565b848152606060208201526000610c23606083018587610828565b8281036040840152610c358185610a19565b97965050505050505056fea26469706673582212204ad01076439ab502f974e1544131fd448768b37962ef359187f4fe715a1514f364736f6c634300080f0033"; + +type OptimisticLightClientConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: OptimisticLightClientConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class OptimisticLightClient__factory extends ContractFactory { + constructor(...args: OptimisticLightClientConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + fraudProofWindowSeconds_: BigNumberish, + verifier_: AddressLike, + _l1BlockProvider: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction( + fraudProofWindowSeconds_, + verifier_, + _l1BlockProvider, + overrides || {} + ); + } + override deploy( + fraudProofWindowSeconds_: BigNumberish, + verifier_: AddressLike, + _l1BlockProvider: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy( + fraudProofWindowSeconds_, + verifier_, + _l1BlockProvider, + overrides || {} + ) as Promise< + OptimisticLightClient & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): OptimisticLightClient__factory { + return super.connect(runner) as OptimisticLightClient__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): OptimisticLightClientInterface { + return new Interface(_abi) as OptimisticLightClientInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): OptimisticLightClient { + return new Contract( + address, + _abi, + runner + ) as unknown as OptimisticLightClient; + } +} diff --git a/src/evm/contracts/factories/OpLightClient.sol/index.ts b/src/evm/contracts/factories/OpLightClient.sol/index.ts new file mode 100644 index 00000000..ee6c07e0 --- /dev/null +++ b/src/evm/contracts/factories/OpLightClient.sol/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { OptimisticLightClient__factory } from "./OptimisticLightClient__factory"; diff --git a/src/evm/contracts/factories/OpProofVerifier__factory.ts b/src/evm/contracts/factories/OpProofVerifier__factory.ts new file mode 100644 index 00000000..480a37c5 --- /dev/null +++ b/src/evm/contracts/factories/OpProofVerifier__factory.ts @@ -0,0 +1,365 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + OpProofVerifier, + OpProofVerifierInterface, +} from "../OpProofVerifier"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_l2OutputOracleAddress", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "l2OutputOracleAddress", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "proofs", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyStateUpdate", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockNumber", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "InvalidAppHash", + inputs: [], + }, + { + type: "error", + name: "InvalidIbcStateProof", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockHash", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidPacketProof", + inputs: [], + }, + { + type: "error", + name: "InvalidProofKey", + inputs: [], + }, + { + type: "error", + name: "InvalidProofValue", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1StateRoot", + inputs: [], + }, + { + type: "error", + name: "MethodNotImplemented", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60806040523480156200001157600080fd5b5060405162002df638038062002df683398101604081905262000034916200005a565b600080546001600160a01b0319166001600160a01b03929092169190911790556200008c565b6000602082840312156200006d57600080fd5b81516001600160a01b03811681146200008557600080fd5b9392505050565b612d5a806200009c6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630a1bb8b5146100515780632a6ded741461006657806359c1b56b14610079578063c2f0329f146100a8575b600080fd5b61006461005f3660046124f8565b6100bb565b005b6100646100743660046125ec565b6103bb565b60005461008c906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100646100b636600461265e565b6103d4565b6100cb60608601604087016126f9565b6001600160401b0316816001600160401b0316146100fc57604051630fd8993960e21b815260040160405180910390fd5b6101176101098680612714565b610112916127a3565b6105be565b80519060200120821461013c5760405162fa512960e01b815260040160405180910390fd5b6101468580612714565b600881811061015757610157612877565b9050602002810190610169919061288d565b6040516101779291906128d3565b60405180910390206101a386604001602081019061019591906126f9565b6001600160401b03166105ff565b80519060200120146101c857604051633395483760e01b815260040160405180910390fd5b6101d28580612714565b60038181106101e3576101e3612877565b90506020028101906101f5919061288d565b6040516102039291906128d3565b6040518091039020610239866020013560405160200161022591815260200190565b604051602081830303815290604052610618565b805190602001201461025e576040516313d643bd60e21b815260040160405180910390fd5b6000805460405160609190911b6bffffffffffffffffffffffff191660208201526102c5906102c0906102bb9060340160408051601f198184030181529190526102a88980612714565b6102b1916127a3565b8a60200135610671565b610694565b6106f0565b9050600061033a86604001356040516020016102e391815260200190565b60408051601f198184030181529190526103006020890189612714565b610309916127a3565b61032c8560028151811061031f5761031f612877565b6020026020010151610913565b610335906128e3565b610671565b905061034d61034882610694565b610913565b610356906128e3565b6040805160006020820181905291810188905260608082019290925290880135608082015260a00160405160208183030381529060405280519060200120146103b2576040516330d26e5760e11b815260040160405180910390fd5b50505050505050565b604051632974974360e01b815260040160405180910390fd5b6103de8180612714565b60008181106103ef576103ef612877565b90506020028101906104019190612907565b61040f90602081019061288d565b60405161041d9291906128d3565b604051809103902085856040516104359291906128d3565b60405180910390201461045b5760405163026a287560e51b815260040160405180910390fd5b6104658180612714565b600081811061047657610476612877565b90506020028101906104889190612907565b61049690604081019061288d565b6040516104a49291906128d3565b604051809103902083836040516104bc9291906128d3565b6040518091039020146104e2576040516310d9300f60e11b815260040160405180910390fd5b6105176104ef8280612714565b600081811061050057610500612877565b90506020028101906105129190612907565b610a36565b6105218280612714565b600181811061053257610532612877565b90506020028101906105449190612907565b61055290604081019061288d565b61055b91612927565b1461057957604051636589f0e160e11b815260040160405180910390fd5b6105976105868280612714565b600181811061050057610500612877565b86146105b6576040516392cb8fbb60e01b815260040160405180910390fd5b505050505050565b60606105c982610c5a565b90506105d7815160c0610d93565b816040516020016105e9929190612980565b6040516020818303038152906040529050919050565b606061061261060d83610f3e565b610618565b92915050565b606081516001148015610645575060808260008151811061063b5761063b612877565b016020015160f81c105b1561064e575090565b61065a82516080610d93565b826040516020016105e9929190612980565b919050565b6060600061067e8561106a565b905061068b818585611086565b95945050505050565b604080518082019091526000808252602082015260008251116106d25760405162461bcd60e51b81526004016106c99061299d565b60405180910390fd5b50604080518082019091528151815260209182019181019190915290565b6060600080600061070085611916565b91945092509050600181600181111561071b5761071b612a0d565b1461078e5760405162461bcd60e51b815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d000000000000000060648201526084016106c9565b845161079a8385612a39565b146108025760405162461bcd60e51b815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e76616044820152713634b2103230ba30903932b6b0b4b73232b960711b60648201526084016106c9565b604080516020808252610420820190925290816020015b60408051808201909152600080825260208201528152602001906001900390816108195790505093506000835b86518110156109075760008061088c6040518060400160405280858c600001516108709190612a51565b8152602001858c602001516108859190612a39565b9052611916565b5091509150604051806040016040528083836108a89190612a39565b8152602001848b602001516108bd9190612a39565b8152508885815181106108d2576108d2612877565b60209081029190910101526108e8600185612a39565b93506108f48183612a39565b6108fe9084612a39565b92505050610846565b50845250919392505050565b6060600080600061092385611916565b91945092509050600081600181111561093e5761093e612a0d565b146109b15760405162461bcd60e51b815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d0000000000000060648201526084016106c9565b6109bb8284612a39565b855114610a275760405162461bcd60e51b815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527330b71034b73b30b634b2103932b6b0b4b73232b960611b60648201526084016106c9565b61068b85602001518484611fd9565b6000806002610a48604085018561288d565b604051610a569291906128d3565b602060405180830381855afa158015610a73573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a969190612a68565b90506002610aa7606085018561288d565b610abe610ab7602088018861288d565b905061206c565b610acb602088018861288d565b610ad5602061206c565b87604051602001610aec9796959493929190612a81565b60408051601f1981840301815290829052610b0691612ac5565b602060405180830381855afa158015610b23573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610b469190612a68565b915060005b610b558480612714565b9050811015610c53576002610b6a8580612714565b83818110610b7a57610b7a612877565b9050602002810190610b8c9190612ad1565b610b96908061288d565b85610ba18880612714565b86818110610bb157610bb1612877565b9050602002810190610bc39190612ad1565b610bd190602081019061288d565b604051602001610be5959493929190612ae7565b60408051601f1981840301815290829052610bff91612ac5565b602060405180830381855afa158015610c1c573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610c3f9190612a68565b925080610c4b81612b0f565b915050610b4b565b5050919050565b60608151600003610c7e5760408051600080825260208201909252905b5092915050565b6000805b8351811015610cc557838181518110610c9d57610c9d612877565b60200260200101515182610cb19190612a39565b915080610cbd81612b0f565b915050610c82565b816001600160401b03811115610cdd57610cdd61275d565b6040519080825280601f01601f191660200182016040528015610d07576020820181803683370190505b50925060009050602083015b8451821015610d8b576000858381518110610d3057610d30612877565b602002602001015190506000602082019050610d4e838284516120db565b868481518110610d6057610d60612877565b60200260200101515183610d749190612a39565b925050508180610d8390612b0f565b925050610d13565b505050919050565b60606038831015610df95760408051600180825281830190925290602082018180368337019050509050610dc78284612b28565b60f81b81600081518110610ddd57610ddd612877565b60200101906001600160f81b031916908160001a905350610612565b600060015b610e088186612b63565b15610e2e5781610e1781612b0f565b9250610e27905061010082612b77565b9050610dfe565b610e39826001612a39565b6001600160401b03811115610e5057610e5061275d565b6040519080825280601f01601f191660200182016040528015610e7a576020820181803683370190505b509250610e878483612b28565b610e92906037612b28565b60f81b83600081518110610ea857610ea8612877565b60200101906001600160f81b031916908160001a905350600190505b818111610f3657610100610ed88284612a51565b610ee490610100612c7a565b610eee9087612b63565b610ef89190612c86565b60f81b838281518110610f0d57610f0d612877565b60200101906001600160f81b031916908160001a90535080610f2e81612b0f565b915050610ec4565b505092915050565b6060600082604051602001610f5591815260200190565b604051602081830303815290604052905060005b6020811015610fac57818181518110610f8457610f84612877565b01602001516001600160f81b031916600003610fac5780610fa481612b0f565b915050610f69565b610fb7816020612a51565b6001600160401b03811115610fce57610fce61275d565b6040519080825280601f01601f191660200182016040528015610ff8576020820181803683370190505b50925060005b8351811015610d8b57828261101281612b0f565b93508151811061102457611024612877565b602001015160f81c60f81b84828151811061104157611041612877565b60200101906001600160f81b031916908160001a9053508061106281612b0f565b915050610ffe565b606081805190602001206040516020016105e991815260200190565b606060008451116110d15760405162461bcd60e51b81526020600482015260156024820152744d65726b6c65547269653a20656d707479206b657960581b60448201526064016106c9565b60006110dc84612138565b905060006110e98661221c565b905060008460405160200161110091815260200190565b60405160208183030381529060405290506000805b84518110156118b857600085828151811061113257611132612877565b6020026020010151905084518311156111a45760405162461bcd60e51b815260206004820152602e60248201527f4d65726b6c65547269653a206b657920696e646578206578636565647320746f60448201526d0e8c2d840d6caf240d8cadccee8d60931b60648201526084016106c9565b8260000361124357805180516020918201206040516111f2926111cc92910190815260200190565b604051602081830303815290604052858051602091820120825192909101919091201490565b61123e5760405162461bcd60e51b815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016106c9565b611339565b8051516020116112c9578051805160209182012060405161126d926111cc92910190815260200190565b61123e5760405162461bcd60e51b815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e6044820152660c2d840d0c2e6d60cb1b60648201526084016106c9565b8051845160208087019190912082519190920120146113395760405162461bcd60e51b815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f646044820152650ca40d0c2e6d60d31b60648201526084016106c9565b61134560106001612a39565b816020015151036114e0578451830361147857611372816020015160108151811061031f5761031f612877565b965060008751116113eb5760405162461bcd60e51b815260206004820152603b60248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286272616e636829000000000060648201526084016106c9565b600186516113f99190612a51565b821461146d5760405162461bcd60e51b815260206004820152603a60248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286272616e63682900000000000060648201526084016106c9565b50505050505061190f565b600085848151811061148c5761148c612877565b602001015160f81c60f81b60f81c9050600082602001518260ff16815181106114b7576114b7612877565b602002602001015190506114ca8161227f565b95506114d7600186612a39565b945050506118a5565b60028160200151510361184c5760006114f8826122a4565b905060008160008151811061150f5761150f612877565b016020015160f81c90506000611526600283612c9a565b611531906002612cbc565b90506000611542848360ff166122c8565b905060006115508a896122c8565b9050600061155e83836122fe565b9050808351146115d65760405162461bcd60e51b815260206004820152603a60248201527f4d65726b6c65547269653a20706174682072656d61696e646572206d7573742060448201527f736861726520616c6c206e6962626c65732077697468206b657900000000000060648201526084016106c9565b60ff8516600214806115eb575060ff85166003145b1561178c57808251146116665760405162461bcd60e51b815260206004820152603d60248201527f4d65726b6c65547269653a206b65792072656d61696e646572206d757374206260448201527f65206964656e746963616c20746f20706174682072656d61696e64657200000060648201526084016106c9565b611680876020015160018151811061031f5761031f612877565b9c5060008d51116116f95760405162461bcd60e51b815260206004820152603960248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286c656166290000000000000060648201526084016106c9565b60018c516117079190612a51565b881461177b5760405162461bcd60e51b815260206004820152603860248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286c65616629000000000000000060648201526084016106c9565b50505050505050505050505061190f565b60ff8516158061179f575060ff85166001145b156117de576117cb87602001516001815181106117be576117be612877565b602002602001015161227f565b99506117d7818a612a39565b9850611841565b60405162461bcd60e51b815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f64652077697468604482015271040c2dc40eadcd6dcdeeedc40e0e4caccd2f60731b60648201526084016106c9565b5050505050506118a5565b60405162461bcd60e51b815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e706172736561604482015267626c65206e6f646560c01b60648201526084016106c9565b50806118b081612b0f565b915050611115565b5060405162461bcd60e51b815260206004820152602560248201527f4d65726b6c65547269653a2072616e206f7574206f662070726f6f6620656c656044820152646d656e747360d81b60648201526084016106c9565b9392505050565b60008060008084600001511161193e5760405162461bcd60e51b81526004016106c99061299d565b6020840151805160001a607f8111611963576000600160009450945094505050611fd2565b60b78111611ac0576000611978608083612a51565b9050808760000151116119f85760405162461bcd60e51b815260206004820152604e6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201526d2873686f727420737472696e672960901b608482015260a4016106c9565b6001838101516001600160f81b0319169082141580611a255750600160ff1b6001600160f81b0319821610155b611aad5760405162461bcd60e51b815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201526c73686f727420737472696e672960981b608482015260a4016106c9565b5060019550935060009250611fd2915050565b60bf8111611d01576000611ad560b783612a51565b905080876000015111611b585760405162461bcd60e51b81526020600482015260516024820152600080516020612d0583398151915260448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527067746820286c6f6e6720737472696e672960781b608482015260a4016106c9565b60018301516001600160f81b0319166000819003611bdf5760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f6064820152696e6720737472696e672960b01b608482015260a4016106c9565b600184015160088302610100031c60378111611c625760405162461bcd60e51b81526020600482015260486024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201526720737472696e672960c01b608482015260a4016106c9565b611c6c8184612a39565b895111611ce45760405162461bcd60e51b815260206004820152604c6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201526b6c6f6e6720737472696e672960a01b608482015260a4016106c9565b611cef836001612a39565b9750955060009450611fd29350505050565b60f78111611da3576000611d1660c083612a51565b905080876000015111611d925760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e206c697374206c656e677468202873606482015269686f7274206c6973742960b01b608482015260a4016106c9565b600195509350849250611fd2915050565b6000611db060f783612a51565b905080876000015111611e2f5760405162461bcd60e51b815260206004820152604d6024820152600080516020612d0583398151915260448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201526c6820286c6f6e67206c6973742960981b608482015260a4016106c9565b60018301516001600160f81b0319166000819003611eb45760405162461bcd60e51b81526020600482015260486024820152600080516020612d0583398151915260448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f6064820152676e67206c6973742960c01b608482015260a4016106c9565b600184015160088302610100031c60378111611f355760405162461bcd60e51b81526020600482015260466024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20353520627974657320286c6f6e67606482015265206c6973742960d01b608482015260a4016106c9565b611f3f8184612a39565b895111611fb55760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20746f74616c206c656e67746820286064820152696c6f6e67206c6973742960b01b608482015260a4016106c9565b611fc0836001612a39565b9750955060019450611fd29350505050565b9193909250565b6060816001600160401b03811115611ff357611ff361275d565b6040519080825280601f01601f19166020018201604052801561201d576020820181803683370190505b509050811561190f5760006120328486612a39565b90506020820160005b8481101561205357828101518282015260200161203b565b84811115612062576000858301525b5050509392505050565b6060805b608083106120ae578083607f1660801760f81b604051602001612094929190612cdf565b60408051601f198184030190525260079290921c91612070565b808360f81b6040516020016120c4929190612cdf565b604051602081830303815290604052915050919050565b8282825b6020811061211757815183526120f6602084612a39565b9250612103602083612a39565b9150612110602082612a51565b90506120df565b905182516020929092036101000a6000190180199091169116179052505050565b8051606090806001600160401b038111156121555761215561275d565b60405190808252806020026020018201604052801561219a57816020015b60408051808201909152606080825260208201528152602001906001900390816121735790505b50915060005b81811015610c535760405180604001604052808583815181106121c5576121c5612877565b602002602001015181526020016121f48684815181106121e7576121e7612877565b602002602001015161237b565b81525083828151811061220957612209612877565b60209081029190910101526001016121a0565b606080604051905082518060011b603f8101601f1916830160405280835250602084016020830160005b83811015612274578060011b82018184015160001a8060041c8253600f811660018301535050600101612246565b509295945050505050565b6060602082600001511061229b5761229682610913565b610612565b61061282612389565b60606106126122c3836020015160008151811061031f5761031f612877565b61221c565b6060825182106122e75750604080516020810190915260008152610612565b61190f83838486516122f99190612a51565b61239f565b6000808251845110612311578251612314565b83515b90505b808210801561236b575082828151811061233357612333612877565b602001015160f81c60f81b6001600160f81b03191684838151811061235a5761235a612877565b01602001516001600160f81b031916145b15610c7757816001019150612317565b60606106126102c083610694565b6060610612826020015160008460000151611fd9565b60608182601f0110156123e55760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016106c9565b8282840110156124285760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016106c9565b8183018451101561246f5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016106c9565b60608215801561248e57604051915060008252602082016040526124d8565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156124c75780518352602092830192016124af565b5050858452601f01601f1916604052505b50949350505050565b80356001600160401b038116811461066c57600080fd5b600080600080600060a0868803121561251057600080fd5b85356001600160401b038082111561252757600080fd5b908701906060828a03121561253b57600080fd5b9095506020870135908082111561255157600080fd5b5086016080818903121561256457600080fd5b93506040860135925060608601359150612580608087016124e1565b90509295509295909350565b60008083601f84011261259e57600080fd5b5081356001600160401b038111156125b557600080fd5b6020830191508360208285010111156125cd57600080fd5b9250929050565b6000604082840312156125e657600080fd5b50919050565b6000806000806060858703121561260257600080fd5b8435935060208501356001600160401b038082111561262057600080fd5b61262c8883890161258c565b9095509350604087013591508082111561264557600080fd5b50612652878288016125d4565b91505092959194509250565b6000806000806000806080878903121561267757600080fd5b8635955060208701356001600160401b038082111561269557600080fd5b6126a18a838b0161258c565b909750955060408901359150808211156126ba57600080fd5b6126c68a838b0161258c565b909550935060608901359150808211156126df57600080fd5b506126ec89828a016125d4565b9150509295509295509295565b60006020828403121561270b57600080fd5b61190f826124e1565b6000808335601e1984360301811261272b57600080fd5b8301803591506001600160401b0382111561274557600080fd5b6020019150600581901b36038213156125cd57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561279b5761279b61275d565b604052919050565b60006001600160401b03808411156127bd576127bd61275d565b8360051b60206127ce818301612773565b8681529185019181810190368411156127e657600080fd5b865b8481101561286b578035868111156128005760008081fd5b8801601f36818301126128135760008081fd5b8135888111156128255761282561275d565b612836818301601f19168801612773565b9150808252368782850101111561284d5760008081fd5b808784018884013760009082018701528452509183019183016127e8565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126128a457600080fd5b8301803591506001600160401b038211156128be57600080fd5b6020019150368190038213156125cd57600080fd5b8183823760009101908152919050565b805160208083015191908110156125e65760001960209190910360031b1b16919050565b60008235607e1983360301811261291d57600080fd5b9190910192915050565b8035602083101561061257600019602084900360031b1b1692915050565b6000815160005b81811015612966576020818501810151868301520161294c565b81811115612975576000828601525b509290920192915050565b600061299561298f8386612945565b84612945565b949350505050565b6020808252604a908201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60408201527f206d7573742062652067726561746572207468616e207a65726f20746f206265606082015269206465636f6461626c6560b01b608082015260a00190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612a4c57612a4c612a23565b500190565b600082821015612a6357612a63612a23565b500390565b600060208284031215612a7a57600080fd5b5051919050565b86888237600087820160008152612a988189612945565b9050858782376000908601908152612ab08186612945565b93845250506020909101979650505050505050565b600061190f8284612945565b60008235603e1983360301811261291d57600080fd5b8486823760008582018581528385602083013760009301602001928352509095945050505050565b600060018201612b2157612b21612a23565b5060010190565b600060ff821660ff84168060ff03821115612b4557612b45612a23565b019392505050565b634e487b7160e01b600052601260045260246000fd5b600082612b7257612b72612b4d565b500490565b6000816000190483118215151615612b9157612b91612a23565b500290565b600181815b80851115612bd1578160001904821115612bb757612bb7612a23565b80851615612bc457918102915b93841c9390800290612b9b565b509250929050565b600082612be857506001610612565b81612bf557506000610612565b8160018114612c0b5760028114612c1557612c31565b6001915050610612565b60ff841115612c2657612c26612a23565b50506001821b610612565b5060208310610133831016604e8410600b8410161715612c54575081810a610612565b612c5e8383612b96565b8060001904821115612c7257612c72612a23565b029392505050565b600061190f8383612bd9565b600082612c9557612c95612b4d565b500690565b600060ff831680612cad57612cad612b4d565b8060ff84160691505092915050565b600060ff821660ff841680821015612cd657612cd6612a23565b90039392505050565b6000612ceb8285612945565b6001600160f81b0319939093168352505060010191905056fe524c505265616465723a206c656e677468206f6620636f6e74656e74206d7573a2646970667358221220a4e4509c645bc26a853ece15c077bf394205eafde99a407c39cbc1c78f50981164736f6c634300080f0033"; + +type OpProofVerifierConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: OpProofVerifierConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class OpProofVerifier__factory extends ContractFactory { + constructor(...args: OpProofVerifierConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _l2OutputOracleAddress: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_l2OutputOracleAddress, overrides || {}); + } + override deploy( + _l2OutputOracleAddress: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_l2OutputOracleAddress, overrides || {}) as Promise< + OpProofVerifier & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): OpProofVerifier__factory { + return super.connect(runner) as OpProofVerifier__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): OpProofVerifierInterface { + return new Interface(_abi) as OpProofVerifierInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): OpProofVerifier { + return new Contract(address, _abi, runner) as unknown as OpProofVerifier; + } +} diff --git a/src/evm/contracts/factories/OptimisticLightClient__factory.ts b/src/evm/contracts/factories/OptimisticLightClient__factory.ts new file mode 100644 index 00000000..c05936c9 --- /dev/null +++ b/src/evm/contracts/factories/OptimisticLightClient__factory.ts @@ -0,0 +1,493 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + BigNumberish, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + OptimisticLightClient, + OptimisticLightClientInterface, +} from "../OptimisticLightClient"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "fraudProofWindowSeconds_", + type: "uint32", + internalType: "uint32", + }, + { + name: "verifier_", + type: "address", + internalType: "contract IProofVerifier", + }, + { + name: "_l1BlockProvider", + type: "address", + internalType: "contract L1Block", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "addOpConsensusState", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "consensusStates", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "fraudProofEndtime", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "fraudProofWindowSeconds", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getFraudProofEndtime", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getInternalState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + { + name: "fraudProofEndTime", + type: "uint256", + internalType: "uint256", + }, + { + name: "ended", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "l1BlockProvider", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract L1Block", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifier", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IProofVerifier", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "expectedValue", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "AppHashHasNotPassedFraudProofWindow", + inputs: [], + }, + { + type: "error", + name: "CannotUpdatePendingOptimisticConsensusState", + inputs: [], + }, +] as const; + +const _bytecode = + "0x608060405234801561001057600080fd5b50604051610d5f380380610d5f83398101604081905261002f91610084565b63ffffffff92909216600255600380546001600160a01b039283166001600160a01b031991821617909155600480549290931691161790556100da565b6001600160a01b038116811461008157600080fd5b50565b60008060006060848603121561009957600080fd5b835163ffffffff811681146100ad57600080fd5b60208501519093506100be8161006c565b60408501519092506100cf8161006c565b809150509250925092565b610c76806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80635922f420116100715780635922f4201461016f5780636304272014610197578063cb535ab5146101a0578063d56ff842146101b5578063eb772058146101e0578063fdaab4e5146101f357600080fd5b80631b738a22146100ae5780631bc97a78146100e15780632b7ac3f31461011157806334b80a411461013c57806344c9af281461015c575b600080fd5b6100ce6100bc366004610591565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b6100f46100ef366004610591565b610206565b6040805193845260208401929092521515908201526060016100d8565b600354610124906001600160a01b031681565b6040516001600160a01b0390911681526020016100d8565b6100ce61014a366004610591565b60016020526000908152604090205481565b6100f461016a366004610591565b610252565b61018261017d3660046105aa565b61026d565b604080519283529015156020830152016100d8565b6100ce60025481565b6101b36101ae36600461068b565b610441565b005b6100ce6101c3366004610591565b600090815260208181526040808320548352600190915290205490565b600454610124906001600160a01b031681565b6101b3610201366004610720565b6104ec565b600081815260208181526040808320548084526001909252822054829182918190811580159061024457506000838152600160205260409020544210155b935093509350509193909250565b600080600061026084610206565b9250925092509193909250565b60008281526020819052604081205481908082036103fd576003546004805460408051624dead360e51b815290516001600160a01b0394851694630a1bb8b5948d948d948c9493909116926309bd5a60928281019260209291908290030181865afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190610789565b60048054604080516341c0fac560e11b815290516001600160a01b0390921692638381f58a9282820192602092908290030181865afa15801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f91906107bb565b6040518663ffffffff1660e01b815260040161038f9594939291906108f4565b60006040518083038186803b1580156103a757600080fd5b505afa1580156103bb573d6000803e3d6000fd5b50505060008681526020819052604081208690556002549091506103df90426109ea565b60008681526001602052604081208290559094509250610438915050565b83810361041f5760009081526001602052604090205491505042811115610438565b60405163f0cd4ed960e01b815260040160405180910390fd5b94509492505050565b6000806104566100ef600160208a0135610a02565b92505091508061047957604051631234d8dd60e01b815260040160405180910390fd5b60035460405163c2f0329f60e01b81526001600160a01b039091169063c2f0329f906104b39085908a908a908a908a908f90600401610bbb565b60006040518083038186803b1580156104cb57600080fd5b505afa1580156104df573d6000803e3d6000fd5b5050505050505050505050565b6000806105016100ef60016020880135610a02565b92505091508061052457604051631234d8dd60e01b815260040160405180910390fd5b600354604051630a9b7b5d60e21b81526001600160a01b0390911690632a6ded749061055a908590889088908b90600401610c09565b60006040518083038186803b15801561057257600080fd5b505afa158015610586573d6000803e3d6000fd5b505050505050505050565b6000602082840312156105a357600080fd5b5035919050565b600080600080608085870312156105c057600080fd5b843567ffffffffffffffff808211156105d857600080fd5b90860190606082890312156105ec57600080fd5b9094506020860135908082111561060257600080fd5b5085016080818803121561061557600080fd5b93969395505050506040820135916060013590565b60006040828403121561063c57600080fd5b50919050565b60008083601f84011261065457600080fd5b50813567ffffffffffffffff81111561066c57600080fd5b60208301915083602082850101111561068457600080fd5b9250929050565b6000806000806000606086880312156106a357600080fd5b853567ffffffffffffffff808211156106bb57600080fd5b6106c789838a0161062a565b965060208801359150808211156106dd57600080fd5b6106e989838a01610642565b9096509450604088013591508082111561070257600080fd5b5061070f88828901610642565b969995985093965092949392505050565b60008060006040848603121561073557600080fd5b833567ffffffffffffffff8082111561074d57600080fd5b6107598783880161062a565b9450602086013591508082111561076f57600080fd5b5061077c86828701610642565b9497909650939450505050565b60006020828403121561079b57600080fd5b5051919050565b67ffffffffffffffff811681146107b857600080fd5b50565b6000602082840312156107cd57600080fd5b81516107d8816107a2565b9392505050565b6000808335601e198436030181126107f657600080fd5b830160208101925035905067ffffffffffffffff81111561081657600080fd5b8060051b360382131561068457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261086857600080fd5b830160208101925035905067ffffffffffffffff81111561088857600080fd5b80360382131561068457600080fd5b81835260006020808501808196508560051b810191508460005b878110156108e75782840389526108c88288610851565b6108d3868284610828565b9a87019a95505050908401906001016108b1565b5091979650505050505050565b60a08152600061090487886107df565b606060a085015261091a61010085018284610897565b915050602088013560c08401526040880135610935816107a2565b67ffffffffffffffff1660e0840152828103602084015261095687806107df565b60808352610968608084018284610897565b91505061097860208901896107df565b838303602085015261098b838284610897565b92505050604088013560408301526060880135606083015280925050508460408301528360608301526109ca608083018467ffffffffffffffff169052565b9695505050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156109fd576109fd6109d4565b500190565b600082821015610a1457610a146109d4565b500390565b600060408301610a2983846107df565b604086528281845260608701905060608260051b88010193508260005b83811015610ba257888603605f1901835236859003607e1901823512610a6b57600080fd5b8482350160808701610a7d82836107df565b60808a528281845260a08b01905060a08260051b8c010193508260005b83811015610b1b578c8603609f19018352813536869003603e19018112610ac057600080fd5b8501610acc8180610851565b60408952610ade60408a018284610828565b915050610aee6020830183610851565b925088820360208a0152610b03828483610828565b98505050602093840193929092019150600101610a9a565b5050505050610b2d6020830183610851565b89830360208b0152610b40838284610828565b92505050610b516040830183610851565b89830360408b0152610b64838284610828565b92505050610b756060830183610851565b925088820360608a0152610b8a828483610828565b98505050602093840193929092019150600101610a46565b5050505050602083013560208501528091505092915050565b868152608060208201526000610bd5608083018789610828565b8281036040840152610be8818688610828565b90508281036060840152610bfc8185610a19565b9998505050505050505050565b848152606060208201526000610c23606083018587610828565b8281036040840152610c358185610a19565b97965050505050505056fea2646970667358221220e4a5f132f7cf78072488590227d73cd3e57b68ef63275bfbc05c60a6b7a458a364736f6c634300080f0033"; + +type OptimisticLightClientConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: OptimisticLightClientConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class OptimisticLightClient__factory extends ContractFactory { + constructor(...args: OptimisticLightClientConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + fraudProofWindowSeconds_: BigNumberish, + verifier_: AddressLike, + _l1BlockProvider: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction( + fraudProofWindowSeconds_, + verifier_, + _l1BlockProvider, + overrides || {} + ); + } + override deploy( + fraudProofWindowSeconds_: BigNumberish, + verifier_: AddressLike, + _l1BlockProvider: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy( + fraudProofWindowSeconds_, + verifier_, + _l1BlockProvider, + overrides || {} + ) as Promise< + OptimisticLightClient & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): OptimisticLightClient__factory { + return super.connect(runner) as OptimisticLightClient__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): OptimisticLightClientInterface { + return new Interface(_abi) as OptimisticLightClientInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): OptimisticLightClient { + return new Contract( + address, + _abi, + runner + ) as unknown as OptimisticLightClient; + } +} diff --git a/src/evm/contracts/factories/OptimisticProofVerifier__factory.ts b/src/evm/contracts/factories/OptimisticProofVerifier__factory.ts new file mode 100644 index 00000000..c655b686 --- /dev/null +++ b/src/evm/contracts/factories/OptimisticProofVerifier__factory.ts @@ -0,0 +1,371 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + OptimisticProofVerifier, + OptimisticProofVerifierInterface, +} from "../OptimisticProofVerifier"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_l2OutputOracleAddress", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "l2OutputOracleAddress", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "proofs", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyStateUpdate", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockNumber", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "InvalidAppHash", + inputs: [], + }, + { + type: "error", + name: "InvalidIbcStateProof", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockHash", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidPacketProof", + inputs: [], + }, + { + type: "error", + name: "InvalidProofKey", + inputs: [], + }, + { + type: "error", + name: "InvalidProofValue", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1StateRoot", + inputs: [], + }, + { + type: "error", + name: "MethodNotImplemented", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60806040523480156200001157600080fd5b5060405162002df638038062002df683398101604081905262000034916200005a565b600080546001600160a01b0319166001600160a01b03929092169190911790556200008c565b6000602082840312156200006d57600080fd5b81516001600160a01b03811681146200008557600080fd5b9392505050565b612d5a806200009c6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630a1bb8b5146100515780632a6ded741461006657806359c1b56b14610079578063c2f0329f146100a8575b600080fd5b61006461005f3660046124f8565b6100bb565b005b6100646100743660046125ec565b6103bb565b60005461008c906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100646100b636600461265e565b6103d4565b6100cb60608601604087016126f9565b6001600160401b0316816001600160401b0316146100fc57604051630fd8993960e21b815260040160405180910390fd5b6101176101098680612714565b610112916127a3565b6105be565b80519060200120821461013c5760405162fa512960e01b815260040160405180910390fd5b6101468580612714565b600881811061015757610157612877565b9050602002810190610169919061288d565b6040516101779291906128d3565b60405180910390206101a386604001602081019061019591906126f9565b6001600160401b03166105ff565b80519060200120146101c857604051633395483760e01b815260040160405180910390fd5b6101d28580612714565b60038181106101e3576101e3612877565b90506020028101906101f5919061288d565b6040516102039291906128d3565b6040518091039020610239866020013560405160200161022591815260200190565b604051602081830303815290604052610618565b805190602001201461025e576040516313d643bd60e21b815260040160405180910390fd5b6000805460405160609190911b6bffffffffffffffffffffffff191660208201526102c5906102c0906102bb9060340160408051601f198184030181529190526102a88980612714565b6102b1916127a3565b8a60200135610671565b610694565b6106f0565b9050600061033a86604001356040516020016102e391815260200190565b60408051601f198184030181529190526103006020890189612714565b610309916127a3565b61032c8560028151811061031f5761031f612877565b6020026020010151610913565b610335906128e3565b610671565b905061034d61034882610694565b610913565b610356906128e3565b6040805160006020820181905291810188905260608082019290925290880135608082015260a00160405160208183030381529060405280519060200120146103b2576040516330d26e5760e11b815260040160405180910390fd5b50505050505050565b604051632974974360e01b815260040160405180910390fd5b6103de8180612714565b60008181106103ef576103ef612877565b90506020028101906104019190612907565b61040f90602081019061288d565b60405161041d9291906128d3565b604051809103902085856040516104359291906128d3565b60405180910390201461045b5760405163026a287560e51b815260040160405180910390fd5b6104658180612714565b600081811061047657610476612877565b90506020028101906104889190612907565b61049690604081019061288d565b6040516104a49291906128d3565b604051809103902083836040516104bc9291906128d3565b6040518091039020146104e2576040516310d9300f60e11b815260040160405180910390fd5b6105176104ef8280612714565b600081811061050057610500612877565b90506020028101906105129190612907565b610a36565b6105218280612714565b600181811061053257610532612877565b90506020028101906105449190612907565b61055290604081019061288d565b61055b91612927565b1461057957604051636589f0e160e11b815260040160405180910390fd5b6105976105868280612714565b600181811061050057610500612877565b86146105b6576040516392cb8fbb60e01b815260040160405180910390fd5b505050505050565b60606105c982610c5a565b90506105d7815160c0610d93565b816040516020016105e9929190612980565b6040516020818303038152906040529050919050565b606061061261060d83610f3e565b610618565b92915050565b606081516001148015610645575060808260008151811061063b5761063b612877565b016020015160f81c105b1561064e575090565b61065a82516080610d93565b826040516020016105e9929190612980565b919050565b6060600061067e8561106a565b905061068b818585611086565b95945050505050565b604080518082019091526000808252602082015260008251116106d25760405162461bcd60e51b81526004016106c99061299d565b60405180910390fd5b50604080518082019091528151815260209182019181019190915290565b6060600080600061070085611916565b91945092509050600181600181111561071b5761071b612a0d565b1461078e5760405162461bcd60e51b815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d000000000000000060648201526084016106c9565b845161079a8385612a39565b146108025760405162461bcd60e51b815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e76616044820152713634b2103230ba30903932b6b0b4b73232b960711b60648201526084016106c9565b604080516020808252610420820190925290816020015b60408051808201909152600080825260208201528152602001906001900390816108195790505093506000835b86518110156109075760008061088c6040518060400160405280858c600001516108709190612a51565b8152602001858c602001516108859190612a39565b9052611916565b5091509150604051806040016040528083836108a89190612a39565b8152602001848b602001516108bd9190612a39565b8152508885815181106108d2576108d2612877565b60209081029190910101526108e8600185612a39565b93506108f48183612a39565b6108fe9084612a39565b92505050610846565b50845250919392505050565b6060600080600061092385611916565b91945092509050600081600181111561093e5761093e612a0d565b146109b15760405162461bcd60e51b815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d0000000000000060648201526084016106c9565b6109bb8284612a39565b855114610a275760405162461bcd60e51b815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527330b71034b73b30b634b2103932b6b0b4b73232b960611b60648201526084016106c9565b61068b85602001518484611fd9565b6000806002610a48604085018561288d565b604051610a569291906128d3565b602060405180830381855afa158015610a73573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a969190612a68565b90506002610aa7606085018561288d565b610abe610ab7602088018861288d565b905061206c565b610acb602088018861288d565b610ad5602061206c565b87604051602001610aec9796959493929190612a81565b60408051601f1981840301815290829052610b0691612ac5565b602060405180830381855afa158015610b23573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610b469190612a68565b915060005b610b558480612714565b9050811015610c53576002610b6a8580612714565b83818110610b7a57610b7a612877565b9050602002810190610b8c9190612ad1565b610b96908061288d565b85610ba18880612714565b86818110610bb157610bb1612877565b9050602002810190610bc39190612ad1565b610bd190602081019061288d565b604051602001610be5959493929190612ae7565b60408051601f1981840301815290829052610bff91612ac5565b602060405180830381855afa158015610c1c573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610c3f9190612a68565b925080610c4b81612b0f565b915050610b4b565b5050919050565b60608151600003610c7e5760408051600080825260208201909252905b5092915050565b6000805b8351811015610cc557838181518110610c9d57610c9d612877565b60200260200101515182610cb19190612a39565b915080610cbd81612b0f565b915050610c82565b816001600160401b03811115610cdd57610cdd61275d565b6040519080825280601f01601f191660200182016040528015610d07576020820181803683370190505b50925060009050602083015b8451821015610d8b576000858381518110610d3057610d30612877565b602002602001015190506000602082019050610d4e838284516120db565b868481518110610d6057610d60612877565b60200260200101515183610d749190612a39565b925050508180610d8390612b0f565b925050610d13565b505050919050565b60606038831015610df95760408051600180825281830190925290602082018180368337019050509050610dc78284612b28565b60f81b81600081518110610ddd57610ddd612877565b60200101906001600160f81b031916908160001a905350610612565b600060015b610e088186612b63565b15610e2e5781610e1781612b0f565b9250610e27905061010082612b77565b9050610dfe565b610e39826001612a39565b6001600160401b03811115610e5057610e5061275d565b6040519080825280601f01601f191660200182016040528015610e7a576020820181803683370190505b509250610e878483612b28565b610e92906037612b28565b60f81b83600081518110610ea857610ea8612877565b60200101906001600160f81b031916908160001a905350600190505b818111610f3657610100610ed88284612a51565b610ee490610100612c7a565b610eee9087612b63565b610ef89190612c86565b60f81b838281518110610f0d57610f0d612877565b60200101906001600160f81b031916908160001a90535080610f2e81612b0f565b915050610ec4565b505092915050565b6060600082604051602001610f5591815260200190565b604051602081830303815290604052905060005b6020811015610fac57818181518110610f8457610f84612877565b01602001516001600160f81b031916600003610fac5780610fa481612b0f565b915050610f69565b610fb7816020612a51565b6001600160401b03811115610fce57610fce61275d565b6040519080825280601f01601f191660200182016040528015610ff8576020820181803683370190505b50925060005b8351811015610d8b57828261101281612b0f565b93508151811061102457611024612877565b602001015160f81c60f81b84828151811061104157611041612877565b60200101906001600160f81b031916908160001a9053508061106281612b0f565b915050610ffe565b606081805190602001206040516020016105e991815260200190565b606060008451116110d15760405162461bcd60e51b81526020600482015260156024820152744d65726b6c65547269653a20656d707479206b657960581b60448201526064016106c9565b60006110dc84612138565b905060006110e98661221c565b905060008460405160200161110091815260200190565b60405160208183030381529060405290506000805b84518110156118b857600085828151811061113257611132612877565b6020026020010151905084518311156111a45760405162461bcd60e51b815260206004820152602e60248201527f4d65726b6c65547269653a206b657920696e646578206578636565647320746f60448201526d0e8c2d840d6caf240d8cadccee8d60931b60648201526084016106c9565b8260000361124357805180516020918201206040516111f2926111cc92910190815260200190565b604051602081830303815290604052858051602091820120825192909101919091201490565b61123e5760405162461bcd60e51b815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016106c9565b611339565b8051516020116112c9578051805160209182012060405161126d926111cc92910190815260200190565b61123e5760405162461bcd60e51b815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e6044820152660c2d840d0c2e6d60cb1b60648201526084016106c9565b8051845160208087019190912082519190920120146113395760405162461bcd60e51b815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f646044820152650ca40d0c2e6d60d31b60648201526084016106c9565b61134560106001612a39565b816020015151036114e0578451830361147857611372816020015160108151811061031f5761031f612877565b965060008751116113eb5760405162461bcd60e51b815260206004820152603b60248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286272616e636829000000000060648201526084016106c9565b600186516113f99190612a51565b821461146d5760405162461bcd60e51b815260206004820152603a60248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286272616e63682900000000000060648201526084016106c9565b50505050505061190f565b600085848151811061148c5761148c612877565b602001015160f81c60f81b60f81c9050600082602001518260ff16815181106114b7576114b7612877565b602002602001015190506114ca8161227f565b95506114d7600186612a39565b945050506118a5565b60028160200151510361184c5760006114f8826122a4565b905060008160008151811061150f5761150f612877565b016020015160f81c90506000611526600283612c9a565b611531906002612cbc565b90506000611542848360ff166122c8565b905060006115508a896122c8565b9050600061155e83836122fe565b9050808351146115d65760405162461bcd60e51b815260206004820152603a60248201527f4d65726b6c65547269653a20706174682072656d61696e646572206d7573742060448201527f736861726520616c6c206e6962626c65732077697468206b657900000000000060648201526084016106c9565b60ff8516600214806115eb575060ff85166003145b1561178c57808251146116665760405162461bcd60e51b815260206004820152603d60248201527f4d65726b6c65547269653a206b65792072656d61696e646572206d757374206260448201527f65206964656e746963616c20746f20706174682072656d61696e64657200000060648201526084016106c9565b611680876020015160018151811061031f5761031f612877565b9c5060008d51116116f95760405162461bcd60e51b815260206004820152603960248201527f4d65726b6c65547269653a2076616c7565206c656e677468206d75737420626560448201527f2067726561746572207468616e207a65726f20286c656166290000000000000060648201526084016106c9565b60018c516117079190612a51565b881461177b5760405162461bcd60e51b815260206004820152603860248201527f4d65726b6c65547269653a2076616c7565206e6f6465206d757374206265206c60448201527f617374206e6f646520696e2070726f6f6620286c65616629000000000000000060648201526084016106c9565b50505050505050505050505061190f565b60ff8516158061179f575060ff85166001145b156117de576117cb87602001516001815181106117be576117be612877565b602002602001015161227f565b99506117d7818a612a39565b9850611841565b60405162461bcd60e51b815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f64652077697468604482015271040c2dc40eadcd6dcdeeedc40e0e4caccd2f60731b60648201526084016106c9565b5050505050506118a5565b60405162461bcd60e51b815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e706172736561604482015267626c65206e6f646560c01b60648201526084016106c9565b50806118b081612b0f565b915050611115565b5060405162461bcd60e51b815260206004820152602560248201527f4d65726b6c65547269653a2072616e206f7574206f662070726f6f6620656c656044820152646d656e747360d81b60648201526084016106c9565b9392505050565b60008060008084600001511161193e5760405162461bcd60e51b81526004016106c99061299d565b6020840151805160001a607f8111611963576000600160009450945094505050611fd2565b60b78111611ac0576000611978608083612a51565b9050808760000151116119f85760405162461bcd60e51b815260206004820152604e6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201526d2873686f727420737472696e672960901b608482015260a4016106c9565b6001838101516001600160f81b0319169082141580611a255750600160ff1b6001600160f81b0319821610155b611aad5760405162461bcd60e51b815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201526c73686f727420737472696e672960981b608482015260a4016106c9565b5060019550935060009250611fd2915050565b60bf8111611d01576000611ad560b783612a51565b905080876000015111611b585760405162461bcd60e51b81526020600482015260516024820152600080516020612d0583398151915260448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527067746820286c6f6e6720737472696e672960781b608482015260a4016106c9565b60018301516001600160f81b0319166000819003611bdf5760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f6064820152696e6720737472696e672960b01b608482015260a4016106c9565b600184015160088302610100031c60378111611c625760405162461bcd60e51b81526020600482015260486024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201526720737472696e672960c01b608482015260a4016106c9565b611c6c8184612a39565b895111611ce45760405162461bcd60e51b815260206004820152604c6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201526b6c6f6e6720737472696e672960a01b608482015260a4016106c9565b611cef836001612a39565b9750955060009450611fd29350505050565b60f78111611da3576000611d1660c083612a51565b905080876000015111611d925760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e206c697374206c656e677468202873606482015269686f7274206c6973742960b01b608482015260a4016106c9565b600195509350849250611fd2915050565b6000611db060f783612a51565b905080876000015111611e2f5760405162461bcd60e51b815260206004820152604d6024820152600080516020612d0583398151915260448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201526c6820286c6f6e67206c6973742960981b608482015260a4016106c9565b60018301516001600160f81b0319166000819003611eb45760405162461bcd60e51b81526020600482015260486024820152600080516020612d0583398151915260448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f6064820152676e67206c6973742960c01b608482015260a4016106c9565b600184015160088302610100031c60378111611f355760405162461bcd60e51b81526020600482015260466024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20353520627974657320286c6f6e67606482015265206c6973742960d01b608482015260a4016106c9565b611f3f8184612a39565b895111611fb55760405162461bcd60e51b815260206004820152604a6024820152600080516020612d0583398151915260448201527f742062652067726561746572207468616e20746f74616c206c656e67746820286064820152696c6f6e67206c6973742960b01b608482015260a4016106c9565b611fc0836001612a39565b9750955060019450611fd29350505050565b9193909250565b6060816001600160401b03811115611ff357611ff361275d565b6040519080825280601f01601f19166020018201604052801561201d576020820181803683370190505b509050811561190f5760006120328486612a39565b90506020820160005b8481101561205357828101518282015260200161203b565b84811115612062576000858301525b5050509392505050565b6060805b608083106120ae578083607f1660801760f81b604051602001612094929190612cdf565b60408051601f198184030190525260079290921c91612070565b808360f81b6040516020016120c4929190612cdf565b604051602081830303815290604052915050919050565b8282825b6020811061211757815183526120f6602084612a39565b9250612103602083612a39565b9150612110602082612a51565b90506120df565b905182516020929092036101000a6000190180199091169116179052505050565b8051606090806001600160401b038111156121555761215561275d565b60405190808252806020026020018201604052801561219a57816020015b60408051808201909152606080825260208201528152602001906001900390816121735790505b50915060005b81811015610c535760405180604001604052808583815181106121c5576121c5612877565b602002602001015181526020016121f48684815181106121e7576121e7612877565b602002602001015161237b565b81525083828151811061220957612209612877565b60209081029190910101526001016121a0565b606080604051905082518060011b603f8101601f1916830160405280835250602084016020830160005b83811015612274578060011b82018184015160001a8060041c8253600f811660018301535050600101612246565b509295945050505050565b6060602082600001511061229b5761229682610913565b610612565b61061282612389565b60606106126122c3836020015160008151811061031f5761031f612877565b61221c565b6060825182106122e75750604080516020810190915260008152610612565b61190f83838486516122f99190612a51565b61239f565b6000808251845110612311578251612314565b83515b90505b808210801561236b575082828151811061233357612333612877565b602001015160f81c60f81b6001600160f81b03191684838151811061235a5761235a612877565b01602001516001600160f81b031916145b15610c7757816001019150612317565b60606106126102c083610694565b6060610612826020015160008460000151611fd9565b60608182601f0110156123e55760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016106c9565b8282840110156124285760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016106c9565b8183018451101561246f5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016106c9565b60608215801561248e57604051915060008252602082016040526124d8565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156124c75780518352602092830192016124af565b5050858452601f01601f1916604052505b50949350505050565b80356001600160401b038116811461066c57600080fd5b600080600080600060a0868803121561251057600080fd5b85356001600160401b038082111561252757600080fd5b908701906060828a03121561253b57600080fd5b9095506020870135908082111561255157600080fd5b5086016080818903121561256457600080fd5b93506040860135925060608601359150612580608087016124e1565b90509295509295909350565b60008083601f84011261259e57600080fd5b5081356001600160401b038111156125b557600080fd5b6020830191508360208285010111156125cd57600080fd5b9250929050565b6000604082840312156125e657600080fd5b50919050565b6000806000806060858703121561260257600080fd5b8435935060208501356001600160401b038082111561262057600080fd5b61262c8883890161258c565b9095509350604087013591508082111561264557600080fd5b50612652878288016125d4565b91505092959194509250565b6000806000806000806080878903121561267757600080fd5b8635955060208701356001600160401b038082111561269557600080fd5b6126a18a838b0161258c565b909750955060408901359150808211156126ba57600080fd5b6126c68a838b0161258c565b909550935060608901359150808211156126df57600080fd5b506126ec89828a016125d4565b9150509295509295509295565b60006020828403121561270b57600080fd5b61190f826124e1565b6000808335601e1984360301811261272b57600080fd5b8301803591506001600160401b0382111561274557600080fd5b6020019150600581901b36038213156125cd57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561279b5761279b61275d565b604052919050565b60006001600160401b03808411156127bd576127bd61275d565b8360051b60206127ce818301612773565b8681529185019181810190368411156127e657600080fd5b865b8481101561286b578035868111156128005760008081fd5b8801601f36818301126128135760008081fd5b8135888111156128255761282561275d565b612836818301601f19168801612773565b9150808252368782850101111561284d5760008081fd5b808784018884013760009082018701528452509183019183016127e8565b50979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126128a457600080fd5b8301803591506001600160401b038211156128be57600080fd5b6020019150368190038213156125cd57600080fd5b8183823760009101908152919050565b805160208083015191908110156125e65760001960209190910360031b1b16919050565b60008235607e1983360301811261291d57600080fd5b9190910192915050565b8035602083101561061257600019602084900360031b1b1692915050565b6000815160005b81811015612966576020818501810151868301520161294c565b81811115612975576000828601525b509290920192915050565b600061299561298f8386612945565b84612945565b949350505050565b6020808252604a908201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60408201527f206d7573742062652067726561746572207468616e207a65726f20746f206265606082015269206465636f6461626c6560b01b608082015260a00190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612a4c57612a4c612a23565b500190565b600082821015612a6357612a63612a23565b500390565b600060208284031215612a7a57600080fd5b5051919050565b86888237600087820160008152612a988189612945565b9050858782376000908601908152612ab08186612945565b93845250506020909101979650505050505050565b600061190f8284612945565b60008235603e1983360301811261291d57600080fd5b8486823760008582018581528385602083013760009301602001928352509095945050505050565b600060018201612b2157612b21612a23565b5060010190565b600060ff821660ff84168060ff03821115612b4557612b45612a23565b019392505050565b634e487b7160e01b600052601260045260246000fd5b600082612b7257612b72612b4d565b500490565b6000816000190483118215151615612b9157612b91612a23565b500290565b600181815b80851115612bd1578160001904821115612bb757612bb7612a23565b80851615612bc457918102915b93841c9390800290612b9b565b509250929050565b600082612be857506001610612565b81612bf557506000610612565b8160018114612c0b5760028114612c1557612c31565b6001915050610612565b60ff841115612c2657612c26612a23565b50506001821b610612565b5060208310610133831016604e8410600b8410161715612c54575081810a610612565b612c5e8383612b96565b8060001904821115612c7257612c72612a23565b029392505050565b600061190f8383612bd9565b600082612c9557612c95612b4d565b500690565b600060ff831680612cad57612cad612b4d565b8060ff84160691505092915050565b600060ff821660ff841680821015612cd657612cd6612a23565b90039392505050565b6000612ceb8285612945565b6001600160f81b0319939093168352505060010191905056fe524c505265616465723a206c656e677468206f6620636f6e74656e74206d7573a2646970667358221220b5b725656389619b8689d8987e5b6f8e268389228f23eee9a3446fab0f2d5d7064736f6c634300080f0033"; + +type OptimisticProofVerifierConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: OptimisticProofVerifierConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class OptimisticProofVerifier__factory extends ContractFactory { + constructor(...args: OptimisticProofVerifierConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + _l2OutputOracleAddress: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(_l2OutputOracleAddress, overrides || {}); + } + override deploy( + _l2OutputOracleAddress: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(_l2OutputOracleAddress, overrides || {}) as Promise< + OptimisticProofVerifier & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): OptimisticProofVerifier__factory { + return super.connect(runner) as OptimisticProofVerifier__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): OptimisticProofVerifierInterface { + return new Interface(_abi) as OptimisticProofVerifierInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): OptimisticProofVerifier { + return new Contract( + address, + _abi, + runner + ) as unknown as OptimisticProofVerifier; + } +} diff --git a/src/evm/contracts/factories/ProofVerifier__factory.ts b/src/evm/contracts/factories/ProofVerifier__factory.ts new file mode 100644 index 00000000..c403b851 --- /dev/null +++ b/src/evm/contracts/factories/ProofVerifier__factory.ts @@ -0,0 +1,287 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { ProofVerifier, ProofVerifierInterface } from "../ProofVerifier"; + +const _abi = [ + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyStateUpdate", + inputs: [ + { + name: "l1header", + type: "tuple", + internalType: "struct L1Header", + components: [ + { + name: "header", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "stateRoot", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "number", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "proof", + type: "tuple", + internalType: "struct OpL2StateProof", + components: [ + { + name: "accountProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "outputRootProof", + type: "bytes[]", + internalType: "bytes[]", + }, + { + name: "l2OutputProposalKey", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l2BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "trustedL1BlockNumber", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "InvalidAppHash", + inputs: [], + }, + { + type: "error", + name: "InvalidIbcStateProof", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockHash", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidPacketProof", + inputs: [], + }, + { + type: "error", + name: "InvalidProofKey", + inputs: [], + }, + { + type: "error", + name: "InvalidProofValue", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1StateRoot", + inputs: [], + }, + { + type: "error", + name: "MethodNotImplemented", + inputs: [], + }, +] as const; + +export class ProofVerifier__factory { + static readonly abi = _abi; + static createInterface(): ProofVerifierInterface { + return new Interface(_abi) as ProofVerifierInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): ProofVerifier { + return new Contract(address, _abi, runner) as unknown as ProofVerifier; + } +} diff --git a/src/evm/contracts/factories/UniversalChannelHandler__factory.ts b/src/evm/contracts/factories/UniversalChannelHandler__factory.ts new file mode 100644 index 00000000..da72c9ea --- /dev/null +++ b/src/evm/contracts/factories/UniversalChannelHandler__factory.ts @@ -0,0 +1,885 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { Signer, ContractDeployTransaction, ContractRunner } from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + UniversalChannelHandler, + UniversalChannelHandlerInterface, +} from "../UniversalChannelHandler"; + +const _abi = [ + { + type: "constructor", + inputs: [], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "MW_ID", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "VERSION", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "closeChannel", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "dispatcher", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "initialize", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onAcknowledgementPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "ack", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanCloseInit", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenAck", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenConfirm", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onChanOpenInit", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onChanOpenTry", + inputs: [ + { + name: "", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "", + type: "string[]", + internalType: "string[]", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "string", + internalType: "string", + }, + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "counterpartyVersion", + type: "string", + internalType: "string", + }, + ], + outputs: [ + { + name: "selectedVersion", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "onRecvPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [ + { + name: "ackPacket", + type: "tuple", + internalType: "struct AckPacket", + components: [ + { + name: "success", + type: "bool", + internalType: "bool", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onTimeoutPacket", + inputs: [ + { + name: "packet", + type: "tuple", + internalType: "struct IbcPacket", + components: [ + { + name: "src", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "dest", + type: "tuple", + internalType: "struct IbcEndpoint", + components: [ + { + name: "portId", + type: "string", + internalType: "string", + }, + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + name: "sequence", + type: "uint64", + internalType: "uint64", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutHeight", + type: "tuple", + internalType: "struct Height", + components: [ + { + name: "revision_number", + type: "uint64", + internalType: "uint64", + }, + { + name: "revision_height", + type: "uint64", + internalType: "uint64", + }, + ], + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "openChannel", + inputs: [ + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "ordering", + type: "uint8", + internalType: "enum ChannelOrder", + }, + { + name: "feeEnabled", + type: "bool", + internalType: "bool", + }, + { + name: "connectionHops", + type: "string[]", + internalType: "string[]", + }, + { + name: "counterpartyPortIdentifier", + type: "string", + internalType: "string", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "proxiableUUID", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "sendUniversalPacket", + inputs: [ + { + name: "channelId", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "destPortAddr", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "appData", + type: "bytes", + internalType: "bytes", + }, + { + name: "timeoutTimestamp", + type: "uint64", + internalType: "uint64", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "setDispatcher", + inputs: [ + { + name: "_dispatcher", + type: "address", + internalType: "contract IbcDispatcher", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeTo", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeToAndCall", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "event", + name: "AdminChanged", + inputs: [ + { + name: "previousAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + { + name: "newAdmin", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "BeaconUpgraded", + inputs: [ + { + name: "beacon", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Initialized", + inputs: [ + { + name: "version", + type: "uint8", + indexed: false, + internalType: "uint8", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "UCHPacketSent", + inputs: [ + { + name: "source", + type: "address", + indexed: false, + internalType: "address", + }, + { + name: "destination", + type: "bytes32", + indexed: false, + internalType: "bytes32", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Upgraded", + inputs: [ + { + name: "implementation", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "ChannelNotFound", + inputs: [], + }, + { + type: "error", + name: "MwBitmpaCannotBeZero", + inputs: [], + }, + { + type: "error", + name: "UnsupportedVersion", + inputs: [], + }, + { + type: "error", + name: "notIbcDispatcher", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60a0604052306080523480156200001557600080fd5b506200002062000030565b6200002a62000030565b620000f1565b600054610100900460ff16156200009d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000ef576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516122b1620001296000396000818161058a015281816105d301528181610885015281816108c5015261095801526122b16000f3fe6080604052600436106101445760003560e01c80637a9ccc4b116100b6578063c4d66de81161006f578063c4d66de814610367578063cb7e905714610387578063e847e280146103a7578063f2fde38b146103c7578063fad28a24146103e7578063ffa1ad741461040757600080fd5b80637a9ccc4b146102a05780637e1d42b5146102c05780638da5cb5b146102e0578063ace02de714610312578063ba22bd7614610332578063c1cb44e51461035257600080fd5b80634c2ee09d116101085780634c2ee09d146101e85780634dcc0aa6146102085780634f1ef2861461023557806352d1902d14610248578063602f98341461026b578063715018a61461028b57600080fd5b80631eb7dd5e146101505780631f3a5830146101725780633659cfe6146101925780633f9fdbe4146101505780634bdb5597146101b257600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5061017061016b366004611634565b610436565b005b34801561017e57600080fd5b5061017061018d366004611686565b610467565b34801561019e57600080fd5b506101706101ad36600461170d565b610580565b3480156101be57600080fd5b506101d26101cd366004611804565b610668565b6040516101df9190611995565b60405180910390f35b3480156101f457600080fd5b506101706102033660046119a8565b6106ad565b34801561021457600080fd5b506102286102233660046119d9565b610716565b6040516101df9190611a0d565b610170610243366004611a34565b61087b565b34801561025457600080fd5b5061025d61094b565b6040519081526020016101df565b34801561027757600080fd5b506101706102863660046119d9565b6109fe565b34801561029757600080fd5b50610170610b29565b3480156102ac57600080fd5b506101d26102bb366004611adb565b610b3d565b3480156102cc57600080fd5b506101706102db366004611b65565b610b75565b3480156102ec57600080fd5b506033546001600160a01b03165b6040516001600160a01b0390911681526020016101df565b34801561031e57600080fd5b5061017061032d366004611bdd565b610ca3565b34801561033e57600080fd5b5061017061034d36600461170d565b610d25565b34801561035e57600080fd5b5061025d600181565b34801561037357600080fd5b5061017061038236600461170d565b610d4f565b34801561039357600080fd5b506065546102fa906001600160a01b031681565b3480156103b357600080fd5b506101706103c2366004611c9e565b610e61565b3480156103d357600080fd5b506101706103e236600461170d565b610e97565b3480156103f357600080fd5b506101706104023660046119a8565b610f0d565b34801561041357600080fd5b506101d2604051806040016040528060038152602001620312e360ec1b81525081565b6065546001600160a01b03163314610461576040516321bf7f4960e01b815260040160405180910390fd5b50505050565b60006104d66040518060800160405280610487336001600160a01b031690565b81526020016001815260200187815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250610f38565b60408051338152602081018890529192507f9831d8c66285bfd33de069ced58ad437d6bf08f63446bf06c3713e40b4b7e873910160405180910390a16065546040516330f8455760e21b81526001600160a01b039091169063c3e1155c9061054690899085908790600401611cf0565b600060405180830381600087803b15801561056057600080fd5b505af1158015610574573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036105d15760405162461bcd60e51b81526004016105c890611d22565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661061a600080516020612235833981519152546001600160a01b031690565b6001600160a01b0316146106405760405162461bcd60e51b81526004016105c890611d6e565b61064981610f74565b6040805160008082526020820190925261066591839190610f7c565b50565b6065546060906001600160a01b03163314610696576040516321bf7f4960e01b815260040160405180910390fd5b6106a18684846110ec565b98975050505050505050565b6106b56111b6565b6065546040516381bc079b60e01b8152600481018390526001600160a01b03909116906381bc079b90602401600060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b5050505050565b6040805180820190915260008152606060208201526065546001600160a01b03163314610756576040516321bf7f4960e01b815260040160405180910390fd5b600073__$f61eb90c6f674e787d51c07f105fa231e2$__63d5c39a9d61077f6060860186611dba565b6040518363ffffffff1660e01b815260040161079c929190611e29565b600060405180830381865af41580156107b9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107e19190810190611e82565b90506107ee816040015190565b6001600160a01b0316635b7615856108096020860186611f24565b60200135836040518363ffffffff1660e01b815260040161082b929190611f77565b6000604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108729190810190611f90565b9150505b919050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036108c35760405162461bcd60e51b81526004016105c890611d22565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661090c600080516020612235833981519152546001600160a01b031690565b6001600160a01b0316146109325760405162461bcd60e51b81526004016105c890611d6e565b61093b82610f74565b61094782826001610f7c565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109eb5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105c8565b5060008051602061223583398151915290565b6065546001600160a01b03163314610a29576040516321bf7f4960e01b815260040160405180910390fd5b600073__$f61eb90c6f674e787d51c07f105fa231e2$__63d5c39a9d610a526060850185611dba565b6040518363ffffffff1660e01b8152600401610a6f929190611e29565b600060405180830381865af4158015610a8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ab49190810190611e82565b80519091506001600160a01b031663400d9f5d610ad18480611f24565b60200135836040518363ffffffff1660e01b8152600401610af3929190611f77565b600060405180830381600087803b158015610b0d57600080fd5b505af1158015610b21573d6000803e3d6000fd5b505050505050565b610b316111b6565b610b3b6000611210565b565b6065546060906001600160a01b03163314610b6b576040516321bf7f4960e01b815260040160405180910390fd5b6106a18383611262565b6065546001600160a01b03163314610ba0576040516321bf7f4960e01b815260040160405180910390fd5b600073__$f61eb90c6f674e787d51c07f105fa231e2$__63d5c39a9d610bc96060860186611dba565b6040518363ffffffff1660e01b8152600401610be6929190611e29565b600060405180830381865af4158015610c03573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c2b9190810190611e82565b80519091506001600160a01b031663588152ca610c488580611f24565b6020013583856040518463ffffffff1660e01b8152600401610c6c9392919061206a565b600060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b50505050505050565b610cab6111b6565b60655460405163418925b760e01b81526001600160a01b039091169063418925b790610ce9908b908b908b908b908b908b908b908b906004016120bc565b600060405180830381600087803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505050505050505050505050565b610d2d6111b6565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff1615808015610d6f5750600054600160ff909116105b80610d895750303b158015610d89575060005460ff166001145b610dec5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105c8565b6000805460ff191660011790558015610e0f576000805461ff0019166101001790555b610e188261130e565b8015610947576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6065546001600160a01b03163314610e8c576040516321bf7f4960e01b815260040160405180910390fd5b61070f8483836110ec565b610e9f6111b6565b6001600160a01b038116610f045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105c8565b61066581611210565b6065546001600160a01b03163314610665576040516321bf7f4960e01b815260040160405180910390fd5b805160208083015160408085015160608681015192519095610f5e95909493910161217a565b6040516020818303038152906040529050919050565b6106656111b6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610fb457610faf8361133d565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561100e575060408051601f3d908101601f1916820190925261100b918101906121ae565b60015b6110715760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105c8565b60008051602061223583398151915281146110e05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105c8565b50610faf8383836113d9565b6060604051806040016040528060038152602001620312e360ec1b81525060405160200161111a91906121c7565b6040516020818303038152906040528051906020012083836040516020016111439291906121d9565b60405160208183030381529060405280519060200120146111775760405163b01318a560e01b815260040160405180910390fd5b82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092979650505050505050565b6033546001600160a01b03163314610b3b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105c8565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060604051806040016040528060038152602001620312e360ec1b81525060405160200161129091906121c7565b6040516020818303038152906040528051906020012083836040516020016112b99291906121d9565b60405160208183030381529060405280519060200120146112ed5760405163b01318a560e01b815260040160405180910390fd5b506040805180820190915260038152620312e360ec1b602082015292915050565b600054610100900460ff166113355760405162461bcd60e51b81526004016105c8906121e9565b610d2d6113fe565b6001600160a01b0381163b6113aa5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105c8565b60008051602061223583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6113e28361142d565b6000825111806113ef5750805b15610faf57610461838361146d565b600054610100900460ff166114255760405162461bcd60e51b81526004016105c8906121e9565b610b3b611499565b6114368161133d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114928383604051806060016040528060278152602001612255602791396114c9565b9392505050565b600054610100900460ff166114c05760405162461bcd60e51b81526004016105c8906121e9565b610b3b33611210565b6060600080856001600160a01b0316856040516114e691906121c7565b600060405180830381855af49150503d8060008114611521576040519150601f19603f3d011682016040523d82523d6000602084013e611526565b606091505b509150915061153786838387611541565b9695505050505050565b606083156115b05782516000036115a9576001600160a01b0385163b6115a95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105c8565b50816115ba565b6115ba83836115c2565b949350505050565b8151156115d25781518083602001fd5b8060405162461bcd60e51b81526004016105c89190611995565b60008083601f8401126115fe57600080fd5b5081356001600160401b0381111561161557600080fd5b60208301915083602082850101111561162d57600080fd5b9250929050565b6000806000806060858703121561164a57600080fd5b8435935060208501356001600160401b0381111561166757600080fd5b611673878288016115ec565b9598909750949560400135949350505050565b60008060008060006080868803121561169e57600080fd5b853594506020860135935060408601356001600160401b03808211156116c357600080fd5b6116cf89838a016115ec565b90955093506060880135915080821682146116e957600080fd5b50809150509295509295909350565b6001600160a01b038116811461066557600080fd5b60006020828403121561171f57600080fd5b8135611492816116f8565b80356003811061087657600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561177757611777611739565b604052919050565b60006001600160401b0382111561179857611798611739565b50601f01601f191660200190565b60006117b96117b48461177f565b61174f565b90508281528383830111156117cd57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126117f557600080fd5b611492838335602085016117a6565b600080600080600080600060c0888a03121561181f57600080fd5b6118288861172a565b965060208801356001600160401b038082111561184457600080fd5b818a0191508a601f83011261185857600080fd5b81358181111561186a5761186a611739565b8060051b61187a6020820161174f565b9182526020818501810192908101908e84111561189657600080fd5b6020860192505b838310156118d45784833511156118b357600080fd5b6118c38f602085358901016117e4565b82526020928301929091019061189d565b9a5050505060408a0135965060608a01359150808211156118f457600080fd5b6119008b838c016117e4565b955060808a0135945060a08a013591508082111561191d57600080fd5b5061192a8a828b016115ec565b989b979a50959850939692959293505050565b60005b83811015611958578181015183820152602001611940565b838111156104615750506000910152565b6000815180845261198181602086016020860161193d565b601f01601f19169290920160200192915050565b6020815260006114926020830184611969565b6000602082840312156119ba57600080fd5b5035919050565b600060e082840312156119d357600080fd5b50919050565b6000602082840312156119eb57600080fd5b81356001600160401b03811115611a0157600080fd5b6115ba848285016119c1565b60208152815115156020820152600060208301516040808401526115ba6060840182611969565b60008060408385031215611a4757600080fd5b8235611a52816116f8565b915060208301356001600160401b03811115611a6d57600080fd5b8301601f81018513611a7e57600080fd5b611a8d858235602084016117a6565b9150509250929050565b60008083601f840112611aa957600080fd5b5081356001600160401b03811115611ac057600080fd5b6020830191508360208260051b850101111561162d57600080fd5b60008060008060008060006080888a031215611af657600080fd5b611aff8861172a565b965060208801356001600160401b0380821115611b1b57600080fd5b611b278b838c01611a97565b909850965060408a0135915080821115611b4057600080fd5b611b4c8b838c016115ec565b909650945060608a013591508082111561191d57600080fd5b60008060408385031215611b7857600080fd5b82356001600160401b0380821115611b8f57600080fd5b611b9b868387016119c1565b93506020850135915080821115611bb157600080fd5b50830160408186031215611bc457600080fd5b809150509250929050565b801515811461066557600080fd5b60008060008060008060008060a0898b031215611bf957600080fd5b88356001600160401b0380821115611c1057600080fd5b611c1c8c838d016115ec565b909a509850889150611c3060208c0161172a565b975060408b01359150611c4282611bcf565b90955060608a01359080821115611c5857600080fd5b611c648c838d01611a97565b909650945060808b0135915080821115611c7d57600080fd5b50611c8a8b828c016115ec565b999c989b5096995094979396929594505050565b60008060008060608587031215611cb457600080fd5b843593506020850135925060408501356001600160401b03811115611cd857600080fd5b611ce4878288016115ec565b95989497509550505050565b838152606060208201526000611d096060830185611969565b90506001600160401b0383166040830152949350505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6000808335601e19843603018112611dd157600080fd5b8301803591506001600160401b03821115611deb57600080fd5b60200191503681900382131561162d57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006115ba602083018486611e00565b600082601f830112611e4e57600080fd5b8151611e5c6117b48261177f565b818152846020838601011115611e7157600080fd5b6115ba82602083016020870161193d565b600060208284031215611e9457600080fd5b81516001600160401b0380821115611eab57600080fd5b9083019060808286031215611ebf57600080fd5b604051608081018181108382111715611eda57611eda611739565b8060405250825181526020830151602082015260408301516040820152606083015182811115611f0957600080fd5b611f1587828601611e3d565b60608301525095945050505050565b60008235603e19833603018112611f3a57600080fd5b9190910192915050565b80518252602081015160208301526040810151604083015260006060820151608060608501526115ba6080850182611969565b8281526040602082015260006115ba6040830184611f44565b600060208284031215611fa257600080fd5b81516001600160401b0380821115611fb957600080fd5b9083019060408286031215611fcd57600080fd5b604051604081018181108382111715611fe857611fe8611739565b6040528251611ff681611bcf565b815260208301518281111561200a57600080fd5b61201687828601611e3d565b60208301525095945050505050565b6000808335601e1984360301811261203c57600080fd5b83016020810192503590506001600160401b0381111561205b57600080fd5b80360382131561162d57600080fd5b8381526060602082015260006120836060830185611f44565b8281036040840152833561209681611bcf565b151581526120a76020850185612025565b604060208401526106a1604084018284611e00565b60a0815260006120d060a083018a8c611e00565b602060038a106120f057634e487b7160e01b600052602160045260246000fd5b8381018a905288151560408501528382036060850152868252818101600588901b830182018960005b8a81101561215357858303601f19018452612134828d612025565b61213f858284611e00565b958701959450505090840190600101612119565b5050858103608087015261216881888a611e00565b9e9d5050505050505050505050505050565b8481528360208201528260408201526000825161219e81606085016020870161193d565b9190910160600195945050505050565b6000602082840312156121c057600080fd5b5051919050565b60008251611f3a81846020870161193d565b8183823760009101908152919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122028e713984aad77b9a65c6628ad3349714191164bd421a96a90710d0acd4e06f264736f6c634300080f0033"; + +type UniversalChannelHandlerConstructorParams = + | [ + linkLibraryAddresses: UniversalChannelHandlerLibraryAddresses, + signer?: Signer + ] + | ConstructorParameters; + +const isSuperArgs = ( + xs: UniversalChannelHandlerConstructorParams +): xs is ConstructorParameters => { + return ( + typeof xs[0] === "string" || + (Array.isArray as (arg: any) => arg is readonly any[])(xs[0]) || + "_isInterface" in xs[0] + ); +}; + +export class UniversalChannelHandler__factory extends ContractFactory { + constructor(...args: UniversalChannelHandlerConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + const [linkLibraryAddresses, signer] = args; + super( + _abi, + UniversalChannelHandler__factory.linkBytecode(linkLibraryAddresses), + signer + ); + } + } + + static linkBytecode( + linkLibraryAddresses: UniversalChannelHandlerLibraryAddresses + ): string { + let linkedBytecode = _bytecode; + + linkedBytecode = linkedBytecode.replace( + new RegExp("__\\$f61eb90c6f674e787d51c07f105fa231e2\\$__", "g"), + linkLibraryAddresses["contracts/libs/IbcUtils.sol:IbcUtils"] + .replace(/^0x/, "") + .toLowerCase() + ); + + return linkedBytecode; + } + + override getDeployTransaction( + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(overrides || {}); + } + override deploy(overrides?: NonPayableOverrides & { from?: string }) { + return super.deploy(overrides || {}) as Promise< + UniversalChannelHandler & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): UniversalChannelHandler__factory { + return super.connect(runner) as UniversalChannelHandler__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): UniversalChannelHandlerInterface { + return new Interface(_abi) as UniversalChannelHandlerInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): UniversalChannelHandler { + return new Contract( + address, + _abi, + runner + ) as unknown as UniversalChannelHandler; + } +} + +export interface UniversalChannelHandlerLibraryAddresses { + ["contracts/libs/IbcUtils.sol:IbcUtils"]: string; +} diff --git a/src/evm/contracts/factories/index.ts b/src/evm/contracts/factories/index.ts new file mode 100644 index 00000000..7332a636 --- /dev/null +++ b/src/evm/contracts/factories/index.ts @@ -0,0 +1,15 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export * as marsSol from "./Mars.sol"; +export { Dispatcher__factory } from "./Dispatcher__factory"; +export { DummyLightClient__factory } from "./DummyLightClient__factory"; +export { DummyProofVerifier__factory } from "./DummyProofVerifier__factory"; +export { ERC1967Proxy__factory } from "./ERC1967Proxy__factory"; +export { Earth__factory } from "./Earth__factory"; +export { Ibc__factory } from "./Ibc__factory"; +export { IbcUtils__factory } from "./IbcUtils__factory"; +export { OptimisticLightClient__factory } from "./OptimisticLightClient__factory"; +export { OptimisticProofVerifier__factory } from "./OptimisticProofVerifier__factory"; +export { ProofVerifier__factory } from "./ProofVerifier__factory"; +export { UniversalChannelHandler__factory } from "./UniversalChannelHandler__factory"; diff --git a/src/evm/contracts/index.ts b/src/evm/contracts/index.ts new file mode 100644 index 00000000..ee75cd4a --- /dev/null +++ b/src/evm/contracts/index.ts @@ -0,0 +1,40 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type * as marsSol from "./Mars.sol"; +export type { marsSol }; +export type { Dispatcher } from "./Dispatcher"; +export type { DummyLightClient } from "./DummyLightClient"; +export type { DummyProofVerifier } from "./DummyProofVerifier"; +export type { ERC1967Proxy } from "./ERC1967Proxy"; +export type { Earth } from "./Earth"; +export type { Ibc } from "./Ibc"; +export type { IbcUtils } from "./IbcUtils"; +export type { OptimisticLightClient } from "./OptimisticLightClient"; +export type { OptimisticProofVerifier } from "./OptimisticProofVerifier"; +export type { ProofVerifier } from "./ProofVerifier"; +export type { UniversalChannelHandler } from "./UniversalChannelHandler"; +export * as factories from "./factories"; +export { Dispatcher__factory } from "./factories/Dispatcher__factory"; +export { DummyLightClient__factory } from "./factories/DummyLightClient__factory"; +export { DummyProofVerifier__factory } from "./factories/DummyProofVerifier__factory"; +export { Earth__factory } from "./factories/Earth__factory"; +export { ERC1967Proxy__factory } from "./factories/ERC1967Proxy__factory"; +export { Ibc__factory } from "./factories/Ibc__factory"; +export { IbcUtils__factory } from "./factories/IbcUtils__factory"; +export type { Mars } from "./Mars.sol/Mars"; +export { Mars__factory } from "./factories/Mars.sol/Mars__factory"; +export type { PanickingMars } from "./Mars.sol/PanickingMars"; +export { PanickingMars__factory } from "./factories/Mars.sol/PanickingMars__factory"; +export type { RevertingBytesMars } from "./Mars.sol/RevertingBytesMars"; +export { RevertingBytesMars__factory } from "./factories/Mars.sol/RevertingBytesMars__factory"; +export type { RevertingEmptyMars } from "./Mars.sol/RevertingEmptyMars"; +export { RevertingEmptyMars__factory } from "./factories/Mars.sol/RevertingEmptyMars__factory"; +export type { RevertingStringCloseChannelMars } from "./Mars.sol/RevertingStringCloseChannelMars"; +export { RevertingStringCloseChannelMars__factory } from "./factories/Mars.sol/RevertingStringCloseChannelMars__factory"; +export type { RevertingStringMars } from "./Mars.sol/RevertingStringMars"; +export { RevertingStringMars__factory } from "./factories/Mars.sol/RevertingStringMars__factory"; +export { OptimisticLightClient__factory } from "./factories/OptimisticLightClient__factory"; +export { OptimisticProofVerifier__factory } from "./factories/OptimisticProofVerifier__factory"; +export { ProofVerifier__factory } from "./factories/ProofVerifier__factory"; +export { UniversalChannelHandler__factory } from "./factories/UniversalChannelHandler__factory"; diff --git a/src/evm/index.ts b/src/evm/index.ts new file mode 100644 index 00000000..9b0c4fdc --- /dev/null +++ b/src/evm/index.ts @@ -0,0 +1,3 @@ +export * as contract from "./schemas/contract"; +export * as chain from "./chain"; +export * as account from "./account"; diff --git a/src/evm/schemas/contract.ts b/src/evm/schemas/contract.ts new file mode 100644 index 00000000..4d487454 --- /dev/null +++ b/src/evm/schemas/contract.ts @@ -0,0 +1,118 @@ +import { z } from "zod"; +import { Registry } from "../../utils/registry"; +import { parseZodSchema } from "../../utils/io"; + +// A contract may or may not be deployed (null address). +const ContractItemSchema = z.object({ + name: z.string().min(1), + description: z.optional(z.string()), + factoryName: z.optional(z.string()), + deployArgs: z.optional(z.array(z.any())), + libraries: z.optional( + z.array( + z.object({ + name: z.string().min(1), + address: z.string().min(1), + }) + ) + ), + // either a account name from account registry, or a private key or a mnemonic signer + deployer: z.string().nullish(), + address: z.string().nullish(), + init: z.optional( + z.object({ + signature: z.string().min(1), + args: z.array(z.string().min(1)), + }) + ), + abi: z.optional(z.any()), +}); + +const ContractItemList = z.array(ContractItemSchema); +const registryName = "contracts"; + +const MultiChainContractRegistrySchema = z.array( + z.object({ chainName: z.string().min(1), [registryName]: ContractItemList }) +); + +type ContractItem = z.infer; + +// export type ContractRegistry = Registry +export type MultiChainContractRegistry = Registry<{ + chainName: string; + [registryName]: ContractRegistry; +}>; + +export class ContractRegistry extends Registry {} + +export class ContractRegistryLoader { + static loadSingle(config: any): ContractRegistry { + return loadContractRegistry(config); + } + + static loadMultiple(config: any): MultiChainContractRegistry { + return loadMultiChainContractRegistry(config); + } + + static emptyMultiple(): MultiChainContractRegistry { + // @ts-ignore + return new Registry<{ chainName: string; contracts: ContractRegistry }>( + [], + { + // @ts-ignore + toObj: (c) => { + return { + chainName: c.chainName, + [registryName]: c.contracts.serialize(), + }; + }, + } + ); + } + + static newMultiple( + items: { chainName: string; contracts: ContractRegistry }[] + ): MultiChainContractRegistry { + // @ts-ignore + return new Registry(items, { + nameFunc: (c) => c.chainName, + toObj: (c) => { + return { + chainName: c.chainName, + [registryName]: c.contracts.serialize(), + }; + }, + }); + } + + static emptySingle(): ContractRegistry { + return new ContractRegistry([], { nameInParent: registryName }); + } +} + +function loadContractRegistry(config: any): ContractRegistry { + const parsed = parseZodSchema( + "ContractRegistry", + config, + ContractItemList.parse + ); + return new ContractRegistry(parsed, { + nameFunc: (c) => c.name, + nameInParent: registryName, + }); +} + +function loadMultiChainContractRegistry( + config: any +): MultiChainContractRegistry { + const parsed = parseZodSchema( + "MultiChainContractRegistry", + config, + MultiChainContractRegistrySchema.parse + ); + const contractRegistries = parsed.map((item) => ({ + chainName: item.chainName, + contracts: loadContractRegistry(item.contracts), + })); + return ContractRegistryLoader.newMultiple(contractRegistries); +} diff --git a/src/evm/schemas/tx.ts b/src/evm/schemas/tx.ts new file mode 100644 index 00000000..5212b263 --- /dev/null +++ b/src/evm/schemas/tx.ts @@ -0,0 +1,28 @@ +import { z } from "zod"; +import { Registry } from "../../utils/registry"; +import { parseZodSchema } from "../../utils/io"; + +const TxItemSchema = z.object({ + name: z.string().min(1), + description: z.optional(z.string()), + // either a account name from account registry, or a private key or a mnemonic signer + deployer: z.string().nullish(), + signature: z.string().min(1), + address: z.string().nullish(), + factoryName: z.optional(z.string()), + args: z.optional(z.array(z.any())), +}); + +type TxItem = z.infer; +const TxItemList = z.array(TxItemSchema); + +export class TxRegistry extends Registry {} + +export function loadTxRegistry(config: any): TxRegistry { + const parsed = parseZodSchema("TxRegistry", config, TxItemList.parse); + return new TxRegistry(parsed, { + nameFunc: (c) => c.name, + nameInParent: "transactions", + }); +} + diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..67e0cd24 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,19 @@ +import { AccountRegistry } from "./evm/account"; +import { Chain } from "./evm/chain"; +import { Registry } from "./utils/registry"; +import { ContractRegistryLoader } from "./evm/schemas/contract"; +import { parseObjFromFile } from "./utils/io"; +import { loadEvmAccounts } from "./evm/account"; +import { deployToChain } from "./deploy"; +import { sendTxToChain } from "./tx"; + +export { + deployToChain, + sendTxToChain, + Chain, + Registry, + loadEvmAccounts, + parseObjFromFile, + AccountRegistry, + ContractRegistryLoader, +}; diff --git a/src/scripts/deploy-script.ts b/src/scripts/deploy-script.ts new file mode 100644 index 00000000..a24bd664 --- /dev/null +++ b/src/scripts/deploy-script.ts @@ -0,0 +1,26 @@ +#!/usr/bin/env node +import { ContractRegistryLoader, deployToChain, parseObjFromFile } from ".."; + +import { getMainLogger } from "../utils/cli"; +import { DEPLOY_SPECS_PATH } from "../utils/constants"; +import { parseArgsFromCLI } from "../utils/io"; + +async function main() { + const { chain, accounts, args } = await parseArgsFromCLI(); + + const deploySpecs = (args.DEPLOY_SPECS_PATH as string) || DEPLOY_SPECS_PATH; + const contracts = ContractRegistryLoader.loadSingle( + parseObjFromFile(deploySpecs) + ); + + deployToChain( + chain, + accounts.mustGet(chain.chainName), + contracts.subset(), + getMainLogger(), + false, + false, + true + ); +} +main(); diff --git a/src/scripts/setup-dispatcher-script.ts b/src/scripts/setup-dispatcher-script.ts new file mode 100644 index 00000000..1502acec --- /dev/null +++ b/src/scripts/setup-dispatcher-script.ts @@ -0,0 +1,31 @@ +#!/usr/bin/env node +import { + AccountRegistry, + Chain, + ContractRegistryLoader, + parseObjFromFile, +} from ".."; +import { loadTxRegistry } from "../evm/schemas/tx"; +import { sendTxToChain } from "../tx"; + +import { getOutputLogger } from "../utils/cli"; +import { DISPATCHER_SETUP_SPECS_PATH } from "../utils/constants"; +import { parseArgsFromCLI } from "../utils/io"; + +async function main() { + const { chain, accounts, args } = await parseArgsFromCLI(); + const txSpecs = + (args.DISPATCHER_SETUP_SPECS_PATH as string) || DISPATCHER_SETUP_SPECS_PATH; + + const upgradeTxs = loadTxRegistry(parseObjFromFile(txSpecs)); + + sendTxToChain( + chain, + accounts.mustGet(chain.chainName), + ContractRegistryLoader.emptySingle(), + upgradeTxs.subset(), + getOutputLogger(), + false + ); +} +main(); diff --git a/src/scripts/upgrade-script.ts b/src/scripts/upgrade-script.ts new file mode 100644 index 00000000..636810c5 --- /dev/null +++ b/src/scripts/upgrade-script.ts @@ -0,0 +1,26 @@ +#!/usr/bin/env node +import { ContractRegistryLoader, parseObjFromFile } from ".."; +import { loadTxRegistry } from "../evm/schemas/tx"; +import { sendTxToChain } from "../tx"; + +import { getOutputLogger } from "../utils/cli"; +import { UPGRADE_SPECS_PATH } from "../utils/constants"; +import { parseArgsFromCLI } from "../utils/io"; + +async function main() { + const { chain, accounts, args } = await parseArgsFromCLI(); + const upgradeSpecs = + (args.UPGRADE_SPECS_PATH as string) || UPGRADE_SPECS_PATH; + + const upgradeTxs = loadTxRegistry(parseObjFromFile(upgradeSpecs)); + + sendTxToChain( + chain, + accounts.mustGet(chain.chainName), + ContractRegistryLoader.emptySingle(), + upgradeTxs.subset(), + getOutputLogger(), + false + ); +} +main(); diff --git a/src/tx.ts b/src/tx.ts new file mode 100644 index 00000000..6401b0aa --- /dev/null +++ b/src/tx.ts @@ -0,0 +1,105 @@ +import { ethers } from "ethers"; +import { AccountRegistry } from "./evm/account"; +import { Chain } from "./evm/chain"; +import { TxRegistry, loadTxRegistry } from "./evm/schemas/tx"; +import { Logger } from "./utils/cli"; +import { + readDeploymentFilesIntoEnv, + readFromDeploymentFile, + renderArgs, +} from "./utils/io"; +import { DEFAULT_DEPLOYER } from "./utils/constants"; +import { ContractRegistry } from "./evm/schemas/contract"; + +/** + * Send a tx to an existing contract. Reads contract from the _existingContracts args. Can be used for upgrading proxy to new implementation contracts as well + */ +export async function sendTxToChain( + chain: Chain, // existing contract registry for this chain + accountRegistry: AccountRegistry, + existingContracts: ContractRegistry, + transactionSpec: TxRegistry, + logger: Logger, + dryRun = false +) { + logger.debug( + `sending ${transactionSpec.size} transaction(s) to chain ${ + chain.chainName + } with contractNames: [${transactionSpec.keys()}]` + ); + + if (!dryRun) { + const provider = ethers.getDefaultProvider(chain.rpc); + const newAccounts = accountRegistry.subset([]); + for (const [name, wallet] of accountRegistry.entries()) { + newAccounts.set(name, wallet.connect(provider)); + } + accountRegistry = newAccounts; + } + + // result is the final contract registry after deployment, modified in place + const result = loadTxRegistry( + JSON.parse(JSON.stringify(transactionSpec.serialize())) + ); + const existingContractAddresses: Record = {}; + existingContracts.toList().forEach((item) => { + existingContractAddresses[item.name] = item.address ? item.address : "0x"; + }); + + // @ts-ignore + let env = { ...existingContractAddresses, chain }; + env = await readDeploymentFilesIntoEnv(env); + + const eachTx = async (tx: ReturnType) => { + try { + const factoryName = tx.factoryName ? tx.factoryName : tx.name; + let deployedContractAbi: any; + + const existingContract = existingContracts.get(factoryName); + // Fetch the ABI from the existing contract if it exists; otherwise read from deployment files + if (existingContract && existingContract.abi) { + deployedContractAbi = existingContract.abi; + } else { + const deployedContract: any = await readFromDeploymentFile( + factoryName, + chain + ); + if (!deployedContract) { + throw new Error(`Contract deployment for ${factoryName} not found!`); + } + deployedContractAbi = deployedContract.abi; + } + + const deployer = accountRegistry.mustGet( + tx.deployer ? tx.deployer : DEFAULT_DEPLOYER + ); + const deployedContractAddress = renderArgs([tx.address], "", env)[0]; + + const ethersContract = new ethers.Contract( + deployedContractAddress, + deployedContractAbi, + deployer + ); + const args = renderArgs(tx.args, "", env); + logger.info( + `calling ${tx.signature} on ${tx.name} @:${deployedContractAddress} with args: \n [${args}]` + ); + if (!dryRun) { + const sentTx = await ethersContract.getFunction(tx.signature!)(...args); + try { + await sentTx.wait(); + } catch (err) { + logger.error(`[${chain.chainName}] sendTx ${tx.name} failed: ${err}`); + throw err; + } + } + } catch (err) { + logger.error(`[${chain.chainName}] sendTx ${tx.name} failed: ${err}`); + throw err; + } + }; + + for (const tx of result.values()) { + await eachTx(tx); + } +} diff --git a/src/utils/cli.ts b/src/utils/cli.ts new file mode 100644 index 00000000..16de5b4f --- /dev/null +++ b/src/utils/cli.ts @@ -0,0 +1,327 @@ +import { + Command, + Option, + InvalidArgumentError, +} from "@commander-js/extra-typings"; +import fs from "fs"; +import path from "path"; +import yaml from "yaml"; +import * as winston from "winston"; +import { Writable } from "stream"; + +export { Command, Option, InvalidArgumentError }; +export type CmdArgsType any> = Parameters< + ReturnType["handler"] +>[0]; + +/** + * Extract type of a Command's action function + */ +export type Action Command> = + Parameters["action"]>[0]; + +/** + * Extract params type of a Command's action function + */ +export type ActionParams Command> = + Parameters>; + +/** + * Arg/Opt: an array of strings, split by comma. Whitespaces are not ignored. + */ +export function CommaStrs(value: string) { + return value.split(","); +} + +/** + * Arg/Opt: an array of strings, split by comma or whitespace. Whitespaces are ignored. + */ +export function CommaOrWhitespaceStrs(value: string) { + return value.split(/[, ]+/); +} + +/** + * Arg/Opt: an integer. NaN causes error. + */ +export function Int(value: string) { + const parsed = parseInt(value); + if (isNaN(parsed)) { + throw new InvalidArgumentError(`invalid integer: ${value}`); + } + return parsed; +} + +/** + * Arg/Opt: a port integer [0, 65535] + */ +export function Port(value: string) { + const parsed = Int(value); + if (parsed < 0 || parsed > 65535) { + throw new InvalidArgumentError( + `invalid port: ${value}, must be [0, 65535]` + ); + } + return parsed; +} + +/** + * Arg/Opt: a parsed yaml object + */ +export function YamlFile(value: string) { + const file = FilePath(value); + return yaml.parse(fs.readFileSync(file, "utf8")); +} + +/** + * Arg/Opt: an existing file path + */ +export function FilePath(value: string) { + if (!fs.existsSync(value)) { + throw new InvalidArgumentError(`file not found: ${value}`); + } + if (!fs.statSync(value).isFile()) { + throw new InvalidArgumentError(`not a file: ${value}`); + } + return value; +} + +/** + * Arg/Opt: an existing directory path + */ +export function DirPath(value: string) { + if (!fs.existsSync(value)) { + throw new InvalidArgumentError(`dir not found: ${value}`); + } + if (!fs.statSync(value).isDirectory()) { + throw new InvalidArgumentError(`not a dir: ${value}`); + } + return value; +} + +const OUTPUT_LOGGER_NAME = "output"; +const MAIN_LOGGER_NAME = "main"; + +export const DEFAULT_OUTPUT = "-.yaml"; +export const DEFAULT_LOGGER = "info:-"; +export const MEM_TRANSPORT_NAME = "__mem__"; + +export type Logger = winston.Logger; + +/** + * returns the output logger + * It returns a default logger (defined by DEFAULT_OUTPUT) if not set by user's cli option + * Must use 'info' level for output logger + */ +export function getOutputLogger(): Logger { + if (!winston.loggers.has(OUTPUT_LOGGER_NAME)) { + OutputTarget(DEFAULT_OUTPUT); + } + return winston.loggers.get(OUTPUT_LOGGER_NAME); +} + +/** + * returns the main logger + */ +export function getMainLogger(): Logger { + if (!winston.loggers.has(MAIN_LOGGER_NAME)) { + SetMainLogger(DEFAULT_LOGGER); + } + return winston.loggers.get(MAIN_LOGGER_NAME); +} + +/** + * Arg/Opt: an output target formatted as ., where base is a file path or "-" for stdout, and ext is a file + * extension that determines the output format. + */ +export function OutputTarget(value: string) { + // remove logger if already set + if (winston.loggers.has(OUTPUT_LOGGER_NAME)) { + winston.loggers.close(OUTPUT_LOGGER_NAME); + } + + const valildExtensions = ["json", "yaml", "yml"]; + const parsed = path.parse(value); + const base = path.join(parsed.dir, parsed.name); + const ext = parsed.ext.length > 0 ? parsed.ext.slice(1) : ""; + if (!ext || valildExtensions.indexOf(ext) < 0) { + throw new InvalidArgumentError( + `invalid output extension: ${ext}, must be one of [${valildExtensions.join( + "," + )}]` + ); + } + let outFmt: winston.Logform.Format; + // log the message only; no level or timestamp + switch (ext) { + case "json": + outFmt = winston.format.printf((info: any) => + JSON.stringify(info.message, null, 2) + ); + break; + case "yaml": + case "yml": + outFmt = winston.format.printf((info) => yaml.stringify(info.message)); + break; + default: + throw new InvalidArgumentError( + `invalid output extension: ${ext}, must be one of [${valildExtensions.join( + "," + )}]` + ); + } + let transport: winston.LoggerOptions["transports"]; + + switch (base) { + case "-": + transport = new winston.transports.Console({}); + break; + case MEM_TRANSPORT_NAME: + transport = new winston.transports.Stream({ stream: new MemStream() }); + break; + default: + transport = new winston.transports.File({ filename: value, options: {} }); + break; + } + winston.loggers.add(OUTPUT_LOGGER_NAME, { + transports: transport, + format: outFmt, + level: "info", + }); + return value; +} + +export function getOutputInMem() { + const logger = getOutputLogger(); + const transport: { _stream: MemStream } = logger.transports[0] as any; + if ( + !transport._stream || + typeof transport._stream.getContent() !== "string" + ) { + throw new Error("output logger is not in memory"); + } + return transport._stream.getContent(); +} + +class MemStream extends Writable { + _content: string = ""; + + _write( + chunk: any, + encoding: BufferEncoding, + callback: (error?: Error | null | undefined) => void + ): void { + this._content += chunk; + if (callback) { + callback(); + } + } + + getContent() { + return this._content; + } +} + +// from 0 to 6 +const LogLevel = [ + "error", + "warn", + // default to info + "info", + "http", + "verbose", + "debug", + "silly", +]; + +/** + * parse a logger from a cli arg string, which may contain one or more logger transports, separated by comma + * Logger can be later accessed by calling `getMainLogger` or `winston.loggers.get(MAIN_LOGGER_NAME)` + * @param value a string of logger transports, separated by comma, eg. "info:-,error:err.log" + * by default, file transport will overwrite existing file; use '+' to append to existing file, eg. "info:-,debug:+debug.log" + * @returns same string as value + */ +export function SetMainLogger(value: string): string { + const transports = parseLoggerTransports(value); + // normally we wouldn't set logger multiple times; + // for testing, we clean up existing logger before setting a new one + if (winston.loggers.has(MAIN_LOGGER_NAME)) { + winston.loggers.close(MAIN_LOGGER_NAME); + } + winston.loggers.add(MAIN_LOGGER_NAME, { + transports, + format: winston.format.combine( + // winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS', options: { utc: true } }), // Use UTC time + winston.format.timestamp(), // UTC time by default + winston.format.printf((info) => { + return `${info.timestamp} ${info.level}: ${info.message}`; + }) + ), + }); + return value; +} +/** + * parse a logger from a arg string, which may contain one or more logger transports, separated by comma + * Logger can be later accessed by calling `getMainLogger` or `winston.loggers.get(MAIN_LOGGER_NAME)` + * @param value a string of logger transports, separated by comma, eg. "info:-,error:err.log" + * @returns a winston logger + */ +export function createLogger(value: string) { + return winston.createLogger({ + transports: parseLoggerTransports(value), + format: winston.format.combine( + // winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS', options: { utc: true } }), // Use UTC time + winston.format.timestamp(), // UTC time by default + winston.format.printf((info) => { + return `${info.timestamp} ${info.level}: ${info.message}`; + }) + ), + }); +} + +/** + * Create or use a logger from a string or use an existing Logger instance + * @param value a string of logger transports, separated by comma, eg. "info:-,error:err.log"; + * Or a logger instance created somewhere else. + * If undefined, use the `DEFAULT_LOGGER` string + * @returns a new or existing logger + */ +export function createOrUseLogger(value?: string | Logger) { + value = value || DEFAULT_LOGGER; + if (typeof value === "string") { + return createLogger(value); + } else if (value instanceof winston.Logger) { + return value; + } + throw new Error( + `invalid logger, should be a string or Logger instance, but got: ${value}` + ); +} + +function parseLoggerTransports(value: string) { + const transportStrs = value.split(/,\s*/); + const transports = transportStrs.map((str) => { + // trim whitespaces + const [level, filename] = str.split(/:\s*/); + if (!LogLevel.includes(level)) + throw new Error(`invalid log level: ${level}`); + if (!filename || filename === "-") { + return new winston.transports.Console({ level }); + } else { + // append to existing file + if (filename.startsWith("+")) { + return new winston.transports.File({ + filename: filename.slice(1), + level, + options: { flags: "a" }, + }); + } + // overwrite existing file + return new winston.transports.File({ + filename, + level, + options: { flags: "w" }, + }); + } + }); + return transports; +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 00000000..83f53c0f --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1,47 @@ +import path from "path"; + +// Defaults +export const DEFAULT_DEPLOYER = "default"; +export const DEFAULT_RPC_URL = "http://127.0.0.1:8545"; +export const DEFAULT_CHAIN_ID = "31337"; +export const DEFAULT_CHAIN_NAME = "local"; +const MODULE_ROOT_PATH = "./node_modules/@open-ibc/vibc-core-smart-contracts/"; + +const DEFAULT_ARTIFACTS_PATH = path.join(MODULE_ROOT_PATH, "out"); +const DEFAULT_DEPLOYMENTS_PATH = "./deployments"; +const DEFAULT_SPECS_PATH = path.join(MODULE_ROOT_PATH, "./specs"); + +export const CHAIN_NAME = process.env.CHAIN_NAME || DEFAULT_CHAIN_NAME; +export const CHAIN_ID = parseInt(process.env.CHAIN_ID || DEFAULT_CHAIN_ID); +export const RPC_URL = process.env.RPC_URL || DEFAULT_RPC_URL; + +// The path where we access artifacts for already deployed contracts +export const ARTIFACTS_PATH = process.env.ARTIFACTS_PATH + ? process.env.ARTIFACTS_PATH + : DEFAULT_ARTIFACTS_PATH; // Used for importing both + +// The path where we save deployments +export const DEPLOYMENTS_PATH = process.env.DEPLOYMENTS_PATH + ? process.env.DEPLOYMENTS_PATH + : DEFAULT_DEPLOYMENTS_PATH; + +const SPECS_BASE_PATH = process.env.SPECS_BASE_PATH + ? process.env.SPECS_BASE_PATH + : DEFAULT_SPECS_PATH; + +export const DEPLOY_SPECS_PATH = process.env.DEPLOY_SPECS_PATH + ? process.env.DEPLOY_SPECS_PATH + : path.join(SPECS_BASE_PATH, "contracts.spec.yaml"); + +export const UPGRADE_SPECS_PATH = process.env.UPGRADE_SPECS_PATH + ? process.env.UPGRADE_SPECS_PATH + : path.join(SPECS_BASE_PATH, "upgrade.spec.yaml"); + +export const ACCOUNTS_SPECS_PATH = process.env.ACCOUNTS_SPECS_PATH + ? process.env.ACCOUNTS_SPECS_PATH + : path.join(SPECS_BASE_PATH, "evm.accounts.yaml"); + +export const DISPATCHER_SETUP_SPECS_PATH = process.env + .DISPATCHER_SETUP_SPECS_PATH + ? process.env.DISPATCHER_SETUP_SPECS_PATH + : path.join(SPECS_BASE_PATH, "contracts.setup.spec.yaml"); diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 00000000..debefc31 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,3 @@ +export * as cli from "./cli"; +export * as io from "./io"; +export * as registry from "./registry"; diff --git a/src/utils/io.ts b/src/utils/io.ts new file mode 100644 index 00000000..fcc3d14f --- /dev/null +++ b/src/utils/io.ts @@ -0,0 +1,308 @@ +import { fileURLToPath } from "url"; +import fs from "fs"; +import fsAsync from "fs/promises"; +import path from "path"; +import yaml from "yaml"; +import { z } from "zod"; +import nunjucks from "nunjucks"; +import assert from "assert"; +import { ProcessPromise } from "zx"; +import { Chain } from "../evm/chain"; +import { + DEPLOYMENTS_PATH, + ARTIFACTS_PATH, + ACCOUNTS_SPECS_PATH, + CHAIN_NAME, + CHAIN_ID, + RPC_URL, +} from "./constants"; +import yargs from "yargs/yargs"; +import { hideBin } from "yargs/helpers"; +import { AccountRegistry } from "../evm/account"; + +export interface StringToStringMap { + [key: string]: string | null | undefined; +} + +export type DeployedContractObject = { + factory: string; + address: string; + abi: any; + bytecode: string; + args: any[]; + metadata?: string; + name: string; +}; + +// readYamlFile reads a yaml file and returns the parsed object. +export function readYamlFile(file: string): any { + return yaml.parse(fs.readFileSync(file, "utf-8")); +} + +export function contractNameToDeployFile( + contractName: string, + chainId: number +) { + return `${contractName}-${chainId}.json`; +} + +/** + * Load a json or yaml file and return the parsed object. + * @param file file path must have an extension of .json or .yaml|.yml + * @returns parsed object + * @throws error if file not found, file extension is not supported, or parsing error + */ +export function parseObjFromFile( + file: string, + options: BufferEncoding = "utf8" +): any { + if (!fs.existsSync(file)) { + throw new Error(`file not found: ${file}`); + } + const ext = path.parse(file).ext; + switch (ext) { + case ".json": + return JSON.parse(fs.readFileSync(file, options)); + case ".yaml": + case ".yml": + return yaml.parse(fs.readFileSync(file, options)); + default: + throw new Error( + `unsupported file extension: ${ext}, only {.json, .yaml|.yml} are supported` + ); + } +} + +// configure the renderer to throw an error if a template variable is not found +const renderEnv = nunjucks.configure({ throwOnUndefined: true }); + +/** + * Renders a template string using the provided environment variables. + * @param str - The string to render. `{{var1}}`/`{{obj1.name}}` will be replaced with the value of `env.var1`/`obj.name`. + * @param env - The environment variables (key/value pairs) to use for rendering. + * @returns The rendered string. + */ +export const renderString = (str: string, env: any) => { + try { + return renderEnv.renderString(str, env); + } catch (err: any) { + throw new Error( + `failed to render string: ${JSON.stringify(str)}, error: ${err}` + ); + } +}; + +/** + * Provides a way to parse a zod schema and throw a meaningful error message if parsing fails. + * @param className A meaningful name for the class being parsed. Used for error messages. + * @param config Config object to parse + * @param parseFunc Normally the `parse` method of a zod schema. + * @returns Parsed object that matches the zod schema. + */ +export function parseZodSchema( + className: string, + config: any, + parseFunc: (config: any) => T +) { + try { + return parseFunc(config); + } catch (e) { + const zErr: z.ZodError = e as any; + if (e instanceof z.ZodError) { + throw new Error( + `parsing ${className} failed. ${zErr.issues + .map((i) => i.path) + .join(", ")}: ${zErr.message}\nconfig obj:\n${JSON.stringify( + config, + null, + 2 + )}` + ); + } else { + throw e; + } + } +} + +/** + * create directories recursively if not exists, similar to `mkdir -p dirPath` + */ + +/** + * Remove a dir and its contents recursively, similar to `rm -rf dirPath` + * Then recreate the dir, similar to `mkdir -p dirPath` + * This effectively clears all existing content the dir if they exist; otherwise just create the dir. + */ +export function resetDir(dirPath: string) { + fs.rmSync(dirPath, { recursive: true, force: true }); + fs.mkdirSync(dirPath, { recursive: true }); +} + +export function setStdoutStderr( + proc: ProcessPromise, + wd: string, + stdoutName: string = "stdout", + stderrName: string = "stderr" +): ProcessPromise { + proc.pipe(fs.createWriteStream(path.resolve(wd, stdoutName))); + proc.stderr.pipe(fs.createWriteStream(path.resolve(wd, stderrName))); + proc.quiet(); + return proc; +} + +export function toEnvVarName(e: string) { + return e.replaceAll("-", "_").toUpperCase(); +} + +/** Reads a deployment metadata rom a foundry build file*/ +async function readMetadata(factoryName: string) { + const filePath = path.join( + ARTIFACTS_PATH, + `${factoryName}.sol`, + `${factoryName}.json` + ); + + try { + const data = await fsAsync.readFile(filePath, "utf8"); + return JSON.stringify(JSON.parse(data).metadata); + } catch (e) { + console.error(`error reading from file ${filePath}: \n`, e); + } +} + +const createFolderIfNeeded = async (folder: string) => { + fs.stat(folder, async (err, stats) => { + if (err) { + await fsAsync.mkdir(folder); // create the folder if it doesn't exist + } + }); +}; + +export async function writeDeployedContractToFile( + chain: Chain, + deployedContract: DeployedContractObject +) { + const deployFileName = contractNameToDeployFile( + deployedContract.name, + chain.chainId + ); + const fullPath = path.join(DEPLOYMENTS_PATH, deployFileName); + await createFolderIfNeeded(DEPLOYMENTS_PATH); + // get metadata from contract./ + const metadata = await readMetadata(deployedContract.factory); + deployedContract.metadata = metadata; + const outData = JSON.stringify(deployedContract); + + fs.writeFile(fullPath, outData, (err) => { + if (err) { + console.error(err); + return; + } + }); +} + +export async function readDeploymentFilesIntoEnv(env: any) { + await createFolderIfNeeded(DEPLOYMENTS_PATH); + let files: any[] = []; + try { + files = await fsAsync.readdir(DEPLOYMENTS_PATH); + } catch (e) { + console.log(`no files to read from`); + return env; + } + for (const file of files) { + if (file.endsWith(".json")) { + try { + const data = JSON.parse( + fs.readFileSync(path.join(DEPLOYMENTS_PATH, file), "utf8") + ); + env[data.name] = data.address; + } catch (e) { + console.error(`error reading file ${file}`, e); + } + } + } + return env; +} + +export async function readFromDeploymentFile( + deploymentName: string, + chain: Chain +) { + const filePath = path.join( + DEPLOYMENTS_PATH, + contractNameToDeployFile(deploymentName, chain.chainId) + ); + try { + const data = JSON.parse(fs.readFileSync(filePath, "utf8")); + return data; + } catch (e) { + console.error(`error reading file ${filePath}`, e); + } +} + +/** + * + * @param args Render the args for the contract deployment through looking them up in environment + * @param init replace initArgs with the init string + * @param env to look up the args in + * @returns + */ +export const renderArgs = (args: any[] | undefined, init: string, env: any) => { + return args + ? args.map((arg: any) => { + if (typeof arg !== "string") return arg; + if (arg === "$INITARGS") { + if (init === "") + throw new Error(`Found $INITARGS but no args to replace it with.`); + return init; + } + return renderString(arg, env); + }) + : []; +}; + +/** + * create directories recursively if not exists, similar to `mkdir -p dirPath` + */ +export function ensureDir(dirPath: string) { + if (fs.existsSync(dirPath)) { + assert(fs.statSync(dirPath).isDirectory(), `${dirPath} is not a directory`); + } else { + fs.mkdirSync(dirPath, { recursive: true }); + } +} + +export async function parseArgsFromCLI() { + // Load args from command line. CLI args take priority. Then env vars. Then default values if none are specified + const argv1 = await yargs(hideBin(process.argv)).argv; + + // write a method that uses argv1 if specified, otherwsie use the imported files from utils/constants + const chainName = (argv1.CHAIN_NAME as string) || CHAIN_NAME; + const chainId = (argv1.CHAIN_ID as number) || CHAIN_ID; + const rpcUrl = (argv1.RPC_URL as string) || RPC_URL; + const accountSpecs = + (argv1.ACCOUNT_SPECS_PATH as string) || ACCOUNTS_SPECS_PATH; + + const chain: Chain = { + rpc: rpcUrl, + chainId, + chainName, + vmType: "evm", + description: "local chain", + }; + + const accountConfigFromYaml = { + name: "local", + registry: parseObjFromFile(accountSpecs), + }; + + const accounts = AccountRegistry.loadMultiple([accountConfigFromYaml]); + + return { + chain, + accounts, + accountSpecs, + args: argv1, + }; +} diff --git a/src/utils/registry.ts b/src/utils/registry.ts new file mode 100644 index 00000000..f2f71f96 --- /dev/null +++ b/src/utils/registry.ts @@ -0,0 +1,174 @@ +import assert from "assert"; + +/** + * A template for a registry that maps strings to items of type T. + * Items are ordered by insertion order. + * Invariants: + * - keys are unique + */ +export class Registry { + public readonly registry: Map; + + protected nameFunc: (t: T) => string; + protected itemToObj: (t: T) => S; + protected nameInParent?: string; + + /** + * Create a new registry from a list of items. + * @param src The source array of registry items + * @param nameFunc A function that takes an item and returns its name, which must be unique. + * Names are used for reigstry lookups. + * Duplicated names result in the last item with the name being used. + */ + constructor( + src: T[], + options?: { + nameInParent?: string; + nameFunc?: (t: T) => string; + toObj?: (t: T) => S; + } + ) { + const { nameFunc = (t: any) => t["name"], toObj = (t: any) => t } = options + ? options + : {}; + this.registry = new Map(src.map((item) => [nameFunc(item), item])); + this.itemToObj = toObj; + this.nameFunc = nameFunc; + this.nameInParent = options?.nameInParent; + } + + /** + * Get the element type of the registry. + * Should only use this for type checking. + * Returned run-time value is `undefined`. + */ + get Element(): T { + return undefined as any; + } + + get name(): string { + assert(this.nameInParent, "nameInParent not set"); + return this.nameInParent; + } + + public get size(): number { + return this.registry.size; + } + + public keys(): string[] { + return Array.from(this.registry.keys()); + } + + public values(): T[] { + return Array.from(this.registry.values()); + } + + /** + * Get an item by name. If the item doesn't exist, undefined is returned. + */ + public get(name: string): T | undefined { + return this.registry.get(name); + } + + /** + * Get an non-nullable item by name. If the item doesn't exist, an error is thrown. + */ + public mustGet(name: string): T { + const item = this.get(name); + assert(item, `item ${name} not found in registry keys: ${this.keys()}`); + return item; + } + + /** + * returns an iterator over the registry item tuples [key, value:T]. + */ + public entries(): IterableIterator<[string, T]> { + return this.registry.entries(); + } + + /** + * Copy items from another registry to this registry. + * @param entries + * @param allowDup If true, dup keys are allowed, ie. the last item with the same key is used. + */ + public copyFrom( + entries: IterableIterator<[string, T]>, + allowDup = false + ): void { + for (const [name, item] of entries) { + this.set(name, item, allowDup); + } + } + + /** + * Set an item in the registry. If the item already exists, an error is thrown, unless force is true. + */ + public set(name: string, item: T, force = false): void { + if (!force && this.registry.has(name)) { + throw new Error(`item ${name} already exists in registry`); + } + this.registry.set(name, item); + } + + public has(name: string): boolean { + return this.registry.has(name); + } + + /** + * Create a new registry instance from a subset of items in the current registry. + * Error is thrown if any of the items in names is not found in the current registry, unless ignoreErr is true. + * NOTE: Items in the new registry are shallow copies of the original items. + * @param names items to include in the new registry. + * If undefined, all items are included + * If empty array, an empty registry is returned. + * @param ignoreErr siliently ignore items not found in the current registry + * @returns + */ + public subset(names?: string[], ignoreErr = false): this { + const classConstrutor = this.constructor as new (...args: any[]) => this; + const subset = new classConstrutor([], { + toObj: this.itemToObj, + nameFunc: this.nameFunc, + nameInParent: this.nameInParent, + }); + const keys = names ? names : this.keys(); + for (const name of keys) { + if (this.has(name)) { + subset.set(name, this.mustGet(name), true); + } else if (!ignoreErr) { + throw new Error( + `item ${name} not found in registry keys: ${this.keys()}` + ); + } + } + return subset; + } + + /** + * @returns A list of items in the registry, ordered by insertion order. + */ + public toList(): T[] { + return Array.from(this.registry.values()); + } + + /** + * Serialize the registry to a list of items. Default to toList(). + * Subclasses should override this method if they want to serialize the registry differently. + * @returns A list of items in the registry, ordered by insertion order. + */ + public serialize(): S[] { + return this.toList().map((item) => this.itemToObj(item)); + } + + /** + * + * @returns An object with keys as the item names and values as the items. + */ + toSerializedObj(): Record { + const obj: Record = {}; + this.registry.forEach((item, key) => { + obj[key] = this.itemToObj(item); + }); + return obj; + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..1d2cc8e1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,112 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "ESNext" /* Specify what module code is generated. */, + "rootDir": "./src" /* Specify the root folder within your source files. */, + "moduleResolution": "bundler", + "moduleDetection": "force", + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */, + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + "declarationMap": true /* Create sourcemaps for d.ts files. */, + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist" /* Specify an output folder for all emitted files. */, + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + "skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */, + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "lib"] +} diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 00000000..d9f33173 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,26 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: [ + "src/index.ts", + "src/utils/index.ts", + "src/evm/index.ts", + "src/utils/cli.ts", + "src/utils/io.ts", + "src/utils/constants.ts", + "src/evm/schemas/contract.ts", + "src/evm/schemas/tx.ts", + "src/evm/chain.ts", + "src/evm/contracts/*.ts", + "src/evm/account.ts", + "src/scripts/deploy-script.ts", + "src/scripts/upgrade-script.ts", + "src/scripts/setup-dispatcher-script.ts", + ], + format: ["cjs", "esm"], // Build for commonJS and ESmodules + dts: true, // Generate declaration file (.d.ts) + splitting: false, + sourcemap: true, + clean: true, + outDir: "./dist", +});