Commit c71b87de authored by smartcontracts's avatar smartcontracts Committed by GitHub

maint: remove sdk and add temporary tasks package (#10794)

Removes the SDK and adds a small temporary package that houses
the two Hardhat tasks that the bedrock-devnet relies on. It's
generally much nicer to have a dedicated place for the SDK in the
ecosystem repository rather than having it exist in two places
awkwardly simply because of these two tasks.
parent bee1ecbb
......@@ -840,23 +840,6 @@ jobs:
paths:
- "/root/.cache/go-build"
depcheck:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
steps:
- checkout
- attach_workspace: { at: "." }
- restore_cache:
name: Restore PNPM Package Cache
keys:
- pnpm-packages-v2-{{ checksum "pnpm-lock.yaml" }}
- check-changed:
patterns: packages
- run:
name: Check sdk
command: npx depcheck
working_directory: packages/sdk
l1-geth-version-check:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
......@@ -1632,9 +1615,6 @@ workflows:
dependencies: "contracts-bedrock"
requires:
- pnpm-monorepo
- depcheck:
requires:
- pnpm-monorepo
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
......
......@@ -71,7 +71,7 @@ def main():
devnet_config_path = pjoin(deploy_config_dir, 'devnetL1.json')
devnet_config_template_path = pjoin(deploy_config_dir, 'devnetL1-template.json')
ops_chain_ops = pjoin(monorepo_dir, 'op-chain-ops')
sdk_dir = pjoin(monorepo_dir, 'packages', 'sdk')
tasks_dir = pjoin(monorepo_dir, 'packages', 'devnet-tasks')
paths = Bunch(
mono_repo_dir=monorepo_dir,
......@@ -86,7 +86,7 @@ def main():
op_node_dir=op_node_dir,
ops_bedrock_dir=ops_bedrock_dir,
ops_chain_ops=ops_chain_ops,
sdk_dir=sdk_dir,
tasks_dir=tasks_dir,
genesis_l1_path=pjoin(devnet_dir, 'genesis-l1.json'),
genesis_l2_path=pjoin(devnet_dir, 'genesis-l2.json'),
allocs_l1_path=pjoin(devnet_dir, 'allocs-l1.json'),
......@@ -334,11 +334,11 @@ def devnet_test(paths):
CommandPreset('erc20-test',
['npx', 'hardhat', 'deposit-erc20', '--network', 'devnetL1',
'--l1-contracts-json-path', paths.addresses_json_path, '--signer-index', '14'],
cwd=paths.sdk_dir, timeout=8*60),
cwd=paths.tasks_dir, timeout=8*60),
CommandPreset('eth-test',
['npx', 'hardhat', 'deposit-eth', '--network', 'devnetL1',
'--l1-contracts-json-path', paths.addresses_json_path, '--signer-index', '15'],
cwd=paths.sdk_dir, timeout=8*60)
cwd=paths.tasks_dir, timeout=8*60)
], max_workers=1)
......
module.exports = {
extends: '../../.eslintrc.js',
overrides: [],
}
(The MIT License)
Copyright 2020-2021 Optimism
Copyright 2020-2024 Optimism
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......
# @eth-optimism/devnet-tasks
`@eth-optimism/devnet-tasks` is a temporary package that hosts two [Hardhat](https://hardhat.org/) tasks used within the [`bedrock-devnet`](/bedrock-devnet/README.md) and is not meant to be published to NPM.
You can generally disregard this package unless you are working on the `bedrock-devnet`.
......@@ -5,7 +5,7 @@ import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import 'hardhat-deploy'
import './tasks'
import './src/tasks'
const config: HardhatUserConfig = {
solidity: {
......
{
"name": "@eth-optimism/sdk",
"private": true,
"name": "@eth-optimism/devnet-tasks",
"version": "3.3.1",
"description": "[Optimism] Tools for working with Optimism",
"description": "[Optimism] Hardhat devnet testing tasks",
"main": "dist/index",
"types": "dist/index",
"files": [
......@@ -17,17 +18,15 @@
"lint:fix": "pnpm lint:check --fix",
"pre-commit": "lint-staged",
"test": "hardhat test",
"test:next": "vitest",
"test:next:run": "vitest run",
"test:coverage": "nyc hardhat test && nyc merge .nyc_output coverage.json",
"autogen:docs": "typedoc --out docs src/index.ts"
},
"keywords": [
"optimism",
"ethereum",
"sdk"
"devnet"
],
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/sdk#readme",
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/devnet-tasks#readme",
"license": "MIT",
"author": "Optimism PBC",
"repository": {
......@@ -35,38 +34,21 @@
"url": "https://github.com/ethereum-optimism/optimism.git"
},
"devDependencies": {
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/transactions": "^5.7.0",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@types/chai": "^4.3.11",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.17",
"@types/semver": "^7.5.7",
"chai-as-promised": "^7.1.1",
"ethereum-waffle": "^4.0.10",
"ethers": "^5.7.2",
"hardhat": "^2.20.1",
"hardhat-deploy": "^0.12.2",
"isomorphic-fetch": "^3.0.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"ts-node": "^10.9.2",
"typedoc": "^0.25.7",
"typescript": "^5.4.5",
"viem": "^2.8.13",
"vitest": "^1.2.2",
"zod": "^3.22.4"
"typescript": "^5.4.5"
},
"dependencies": {
"@eth-optimism/contracts": "0.6.0",
"@eth-optimism/core-utils": "^0.13.2",
"lodash": "^4.17.21",
"merkletreejs": "^0.3.11",
"rlp": "^2.2.7",
"semver": "^7.6.0"
"@eth-optimism/sdk": "^3.3.1"
},
"peerDependencies": {
"ethers": "^5"
......
......@@ -7,24 +7,23 @@ import '@nomiclabs/hardhat-ethers'
import 'hardhat-deploy'
import { Event, Contract, Wallet, providers, utils, ethers } from 'ethers'
import { predeploys, sleep } from '@eth-optimism/core-utils'
import Artifact__WETH9 from '../src/forge-artifacts/WETH9.json'
import Artifact__OptimismMintableERC20TokenFactory from '../src/forge-artifacts/OptimismMintableERC20Factory.json'
import Artifact__OptimismMintableERC20Token from '../src/forge-artifacts/OptimismMintableERC20.json'
import Artifact__L2ToL1MessagePasser from '../src/forge-artifacts/L2ToL1MessagePasser.json'
import Artifact__L2CrossDomainMessenger from '../src/forge-artifacts/L2CrossDomainMessenger.json'
import Artifact__L2StandardBridge from '../src/forge-artifacts/L2StandardBridge.json'
import Artifact__OptimismPortal from '../src/forge-artifacts/OptimismPortal.json'
import Artifact__L1CrossDomainMessenger from '../src/forge-artifacts/L1CrossDomainMessenger.json'
import Artifact__L1StandardBridge from '../src/forge-artifacts/L1StandardBridge.json'
import Artifact__L2OutputOracle from '../src/forge-artifacts/L2OutputOracle.json'
import Artifact__WETH9 from '@eth-optimism/sdk/dist/forge-artifacts/WETH9.json'
import Artifact__OptimismMintableERC20TokenFactory from '@eth-optimism/sdk/dist/forge-artifacts/OptimismMintableERC20Factory.json'
import Artifact__OptimismMintableERC20Token from '@eth-optimism/sdk/dist/forge-artifacts/OptimismMintableERC20.json'
import Artifact__L2ToL1MessagePasser from '@eth-optimism/sdk/dist/forge-artifacts/L2ToL1MessagePasser.json'
import Artifact__L2CrossDomainMessenger from '@eth-optimism/sdk/dist/forge-artifacts/L2CrossDomainMessenger.json'
import Artifact__L2StandardBridge from '@eth-optimism/sdk/dist/forge-artifacts/L2StandardBridge.json'
import Artifact__OptimismPortal from '@eth-optimism/sdk/dist/forge-artifacts/OptimismPortal.json'
import Artifact__L1CrossDomainMessenger from '@eth-optimism/sdk/dist/forge-artifacts/L1CrossDomainMessenger.json'
import Artifact__L1StandardBridge from '@eth-optimism/sdk/dist/forge-artifacts/L1StandardBridge.json'
import Artifact__L2OutputOracle from '@eth-optimism/sdk/dist/forge-artifacts/L2OutputOracle.json'
import {
CrossChainMessenger,
MessageStatus,
CONTRACT_ADDRESSES,
OEContractsLike,
DEFAULT_L2_CONTRACT_ADDRESSES,
} from '../src'
} from '@eth-optimism/sdk/dist'
const deployWETH9 = async (
hre: HardhatRuntimeEnvironment,
......
import { promises as fs } from 'fs'
import { task, types } from 'hardhat/config'
import { Deployment } from 'hardhat-deploy/types'
import '@nomiclabs/hardhat-ethers'
import 'hardhat-deploy'
import { Deployment } from 'hardhat-deploy/types'
import { predeploys } from '@eth-optimism/core-utils'
import { providers, utils, ethers } from 'ethers'
import Artifact__L2ToL1MessagePasser from '../src/forge-artifacts/L2ToL1MessagePasser.json'
import Artifact__L2CrossDomainMessenger from '../src/forge-artifacts/L2CrossDomainMessenger.json'
import Artifact__L2StandardBridge from '../src/forge-artifacts/L2StandardBridge.json'
import Artifact__OptimismPortal from '../src/forge-artifacts/OptimismPortal.json'
import Artifact__L1CrossDomainMessenger from '../src/forge-artifacts/L1CrossDomainMessenger.json'
import Artifact__L1StandardBridge from '../src/forge-artifacts/L1StandardBridge.json'
import Artifact__L2OutputOracle from '../src/forge-artifacts/L2OutputOracle.json'
import Artifact__L2ToL1MessagePasser from '@eth-optimism/sdk/dist/forge-artifacts/L2ToL1MessagePasser.json'
import Artifact__L2CrossDomainMessenger from '@eth-optimism/sdk/dist/forge-artifacts/L2CrossDomainMessenger.json'
import Artifact__L2StandardBridge from '@eth-optimism/sdk/dist/forge-artifacts/L2StandardBridge.json'
import Artifact__OptimismPortal from '@eth-optimism/sdk/dist/forge-artifacts/OptimismPortal.json'
import Artifact__L1CrossDomainMessenger from '@eth-optimism/sdk/dist/forge-artifacts/L1CrossDomainMessenger.json'
import Artifact__L1StandardBridge from '@eth-optimism/sdk/dist/forge-artifacts/L1StandardBridge.json'
import Artifact__L2OutputOracle from '@eth-optimism/sdk/dist/forge-artifacts/L2OutputOracle.json'
import {
CrossChainMessenger,
MessageStatus,
CONTRACT_ADDRESSES,
OEContractsLike,
DEFAULT_L2_CONTRACT_ADDRESSES,
} from '../src'
} from '@eth-optimism/sdk'
const { formatEther } = utils
......
import './deposit-eth'
import './deposit-erc20'
import './finalize-withdrawal'
module.exports = {
extends: '../../.eslintrc.js',
overrides: [
{
files: ['src/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
'assert',
'buffer',
'child_process',
'cluster',
'crypto',
'dgram',
'dns',
'domain',
'events',
'freelist',
'fs',
'http',
'https',
'module',
'net',
'os',
'path',
'punycode',
'querystring',
'readline',
'repl',
'smalloc',
'stream',
'string_decoder',
'sys',
'timers',
'tls',
'tracing',
'tty',
'url',
'util',
'vm',
'zlib',
],
},
},
],
}
# @eth-optimism/sdk
## 3.3.1
### Patch Changes
- [#10593](https://github.com/ethereum-optimism/optimism/pull/10593) [`799bc898bfb207e2ccd4b2027e3fb4db4372292b`](https://github.com/ethereum-optimism/optimism/commit/799bc898bfb207e2ccd4b2027e3fb4db4372292b) Thanks [@nitaliano](https://github.com/nitaliano)! - expose FaultDisputeGame in getOEContract
## 3.3.0
### Minor Changes
- [#9951](https://github.com/ethereum-optimism/optimism/pull/9951) [`ac5b061dfce6a9817b928a8703be9252daaeeca7`](https://github.com/ethereum-optimism/optimism/commit/ac5b061dfce6a9817b928a8703be9252daaeeca7) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Updates SDK for FPAC proven withdrawals mapping.
### Patch Changes
- [#9964](https://github.com/ethereum-optimism/optimism/pull/9964) [`8241220898128e1f61064f22dcb6fdd0a5f043c3`](https://github.com/ethereum-optimism/optimism/commit/8241220898128e1f61064f22dcb6fdd0a5f043c3) Thanks [@roninjin10](https://github.com/roninjin10)! - Removed only-allow command from package.json
- [#9973](https://github.com/ethereum-optimism/optimism/pull/9973) [`87093b0e9144a4709f11c7fbd631828847d891f9`](https://github.com/ethereum-optimism/optimism/commit/87093b0e9144a4709f11c7fbd631828847d891f9) Thanks [@raffaele-oplabs](https://github.com/raffaele-oplabs)! - Added support for MODE sepolia and MODE mainnet
- [#9969](https://github.com/ethereum-optimism/optimism/pull/9969) [`372bca2257764be33797d67ddca9b53c3dd3c295`](https://github.com/ethereum-optimism/optimism/commit/372bca2257764be33797d67ddca9b53c3dd3c295) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed bug where replayable transactions would fail `finalize` if they previously were marked as errors but replayable.
- Updated dependencies [[`8241220898128e1f61064f22dcb6fdd0a5f043c3`](https://github.com/ethereum-optimism/optimism/commit/8241220898128e1f61064f22dcb6fdd0a5f043c3)]:
- @eth-optimism/contracts-bedrock@0.17.2
- @eth-optimism/core-utils@0.13.2
## 3.2.3
### Patch Changes
- [#9907](https://github.com/ethereum-optimism/optimism/pull/9907) [`5fe797f183e502c1c7e91fc1e74dd3cc664ba22e`](https://github.com/ethereum-optimism/optimism/commit/5fe797f183e502c1c7e91fc1e74dd3cc664ba22e) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Minor optimizations and improvements to FPAC functions.
- [#9919](https://github.com/ethereum-optimism/optimism/pull/9919) [`3dc129fade77ddf9d45bb4c2ecd34360d1aa838a`](https://github.com/ethereum-optimism/optimism/commit/3dc129fade77ddf9d45bb4c2ecd34360d1aa838a) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Sets the address of the DisputeGameFactory contract for OP Sepolia.
## 3.2.2
### Patch Changes
- [#9805](https://github.com/ethereum-optimism/optimism/pull/9805) [`3ccd12fe5c8c4c5a6acbf370d474ffa8db816562`](https://github.com/ethereum-optimism/optimism/commit/3ccd12fe5c8c4c5a6acbf370d474ffa8db816562) Thanks [@alecananian](https://github.com/alecananian)! - Fixed an issue where Vercel builds were failing due to the `preinstall` command.
## 3.2.1
### Patch Changes
- [#9663](https://github.com/ethereum-optimism/optimism/pull/9663) [`a1329f21f33ecafe409990964d3af7bf05a8a756`](https://github.com/ethereum-optimism/optimism/commit/a1329f21f33ecafe409990964d3af7bf05a8a756) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Fixes a bug in the SDK that would sometimes cause proof submission reverts.
## 3.2.0
### Minor Changes
- [#9325](https://github.com/ethereum-optimism/optimism/pull/9325) [`44a2d9cec5f3b309b723b3e4dd8d29b5b70f1cc8`](https://github.com/ethereum-optimism/optimism/commit/44a2d9cec5f3b309b723b3e4dd8d29b5b70f1cc8) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Updates the SDK to support FPAC in a backwards compatible way.
### Patch Changes
- [#9367](https://github.com/ethereum-optimism/optimism/pull/9367) [`d99d425a4f73fba19ffcf180deb0ef48ff3b9a6a`](https://github.com/ethereum-optimism/optimism/commit/d99d425a4f73fba19ffcf180deb0ef48ff3b9a6a) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Fixes a bug in the SDK for finalizing fpac withdrawals.
- [#9244](https://github.com/ethereum-optimism/optimism/pull/9244) [`73a748575e7c3d67c293814a12bf41eee216163c`](https://github.com/ethereum-optimism/optimism/commit/73a748575e7c3d67c293814a12bf41eee216163c) Thanks [@roninjin10](https://github.com/roninjin10)! - Added maintence mode warning to sdk
- Updated dependencies [[`79effc52e8b82d15b5eda43acf540ac6c5f8d5d7`](https://github.com/ethereum-optimism/optimism/commit/79effc52e8b82d15b5eda43acf540ac6c5f8d5d7)]:
- @eth-optimism/contracts-bedrock@0.17.1
## 3.1.8
### Patch Changes
- [#8902](https://github.com/ethereum-optimism/optimism/pull/8902) [`18becd7e4`](https://github.com/ethereum-optimism/optimism/commit/18becd7e457577c105f6bc03597e069334cb7433) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Fixes a bug in the SDK that would fail if unsupported fields were provided.
## 3.1.7
### Patch Changes
- [#8836](https://github.com/ethereum-optimism/optimism/pull/8836) [`6ec80fd19`](https://github.com/ethereum-optimism/optimism/commit/6ec80fd19d9155b17a0873672fb095d323f6e8fb) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Fixes a bug in l1 gas cost estimation.
## 3.1.6
### Patch Changes
- [#8212](https://github.com/ethereum-optimism/optimism/pull/8212) [`dd0e46986`](https://github.com/ethereum-optimism/optimism/commit/dd0e46986f19dcceb304fc48f2bd410685ecd179) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Simplifies getMessageStatus to use an O(1) lookup instead of an event query
## 3.1.5
### Patch Changes
- [#8155](https://github.com/ethereum-optimism/optimism/pull/8155) [`2534eabb5`](https://github.com/ethereum-optimism/optimism/commit/2534eabb50afe76f176407f83cc1f1c606e6de69) Thanks [@smartcontracts](https://github.com/smartcontracts)! - Fixed bug with tokenBridge checks throwing
## 3.1.4
### Patch Changes
- [#7450](https://github.com/ethereum-optimism/optimism/pull/7450) [`ac90e16a7`](https://github.com/ethereum-optimism/optimism/commit/ac90e16a7f85c4f73661ae6023135c3d00421c1e) Thanks [@roninjin10](https://github.com/roninjin10)! - Updated dev dependencies related to testing that is causing audit tooling to report failures
- Updated dependencies [[`ac90e16a7`](https://github.com/ethereum-optimism/optimism/commit/ac90e16a7f85c4f73661ae6023135c3d00421c1e)]:
- @eth-optimism/contracts-bedrock@0.16.2
- @eth-optimism/core-utils@0.13.1
## 3.1.3
### Patch Changes
- [#7244](https://github.com/ethereum-optimism/optimism/pull/7244) [`679207751`](https://github.com/ethereum-optimism/optimism/commit/6792077510fd76553c179d8b8d068262cda18db6) Thanks [@nitaliano](https://github.com/nitaliano)! - Adds Sepolia & OP Sepolia support to SDK
- Updated dependencies [[`210b2c81d`](https://github.com/ethereum-optimism/optimism/commit/210b2c81dd383bad93480aa876b283d9a0c991c2), [`2440f5e7a`](https://github.com/ethereum-optimism/optimism/commit/2440f5e7ab6577f2d2e9c8b0c78c014290dde8e7)]:
- @eth-optimism/core-utils@0.13.0
- @eth-optimism/contracts-bedrock@0.16.1
## 3.1.2
### Patch Changes
- [#6886](https://github.com/ethereum-optimism/optimism/pull/6886) [`9c3a03855`](https://github.com/ethereum-optimism/optimism/commit/9c3a03855dc982f0b4e1d664e83271883536632b) Thanks [@roninjin10](https://github.com/roninjin10)! - Updated npm dependencies to latest
## 3.1.1
### Patch Changes
- Updated dependencies [[`dfa309e34`](https://github.com/ethereum-optimism/optimism/commit/dfa309e3430ebc8790b932554dde120aafc4161e)]:
- @eth-optimism/core-utils@0.12.3
## 3.1.0
### Minor Changes
- [#6053](https://github.com/ethereum-optimism/optimism/pull/6053) [`ff577455f`](https://github.com/ethereum-optimism/optimism/commit/ff577455f196b5f5b8a889339b845561ca6c538a) Thanks [@roninjin10](https://github.com/roninjin10)! - Add support for claiming multicall3 withdrawals
- [#6042](https://github.com/ethereum-optimism/optimism/pull/6042) [`89ca741a6`](https://github.com/ethereum-optimism/optimism/commit/89ca741a63c5e07f9d691bb6f7a89f7718fc49ca) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixes issue with legacy withdrawal message status detection
- [#6332](https://github.com/ethereum-optimism/optimism/pull/6332) [`639163253`](https://github.com/ethereum-optimism/optimism/commit/639163253a5e2128f1c21c446b68d358d38cbd30) Thanks [@wilsoncusack](https://github.com/wilsoncusack)! - Added to and from block filters to several methods in CrossChainMessenger
### Patch Changes
- [#6254](https://github.com/ethereum-optimism/optimism/pull/6254) [`a666c4f20`](https://github.com/ethereum-optimism/optimism/commit/a666c4f2082253abbb68c0678e5a0a1ed0c00f4b) Thanks [@roninjin10](https://github.com/roninjin10)! - Fixed missing indexes for multicall support
- [#6164](https://github.com/ethereum-optimism/optimism/pull/6164) [`c11039060`](https://github.com/ethereum-optimism/optimism/commit/c11039060bc037a88916c2cba602687b6d69ad1a) Thanks [@pengin7384](https://github.com/pengin7384)! - fix typo
- [#6198](https://github.com/ethereum-optimism/optimism/pull/6198) [`77da6edc6`](https://github.com/ethereum-optimism/optimism/commit/77da6edc643e0b5e39f7b6bb41c3c7ead418a876) Thanks [@tremarkley](https://github.com/tremarkley)! - Delete dead typescript https://github.com/ethereum-optimism/optimism/pull/6148.
- [#6182](https://github.com/ethereum-optimism/optimism/pull/6182) [`3f13fd0bb`](https://github.com/ethereum-optimism/optimism/commit/3f13fd0bbea051a4550f1df6def1a53a616aa6f6) Thanks [@tremarkley](https://github.com/tremarkley)! - Update the addresses of the bridges on optimism and optimism goerli for the ECO bridge adapter
- Updated dependencies [[`c11039060`](https://github.com/ethereum-optimism/optimism/commit/c11039060bc037a88916c2cba602687b6d69ad1a), [`72d184854`](https://github.com/ethereum-optimism/optimism/commit/72d184854ebad8b2025641f126ed76573b1f0ac3), [`77da6edc6`](https://github.com/ethereum-optimism/optimism/commit/77da6edc643e0b5e39f7b6bb41c3c7ead418a876)]:
- @eth-optimism/contracts-bedrock@0.16.0
- @eth-optimism/core-utils@0.12.2
## 3.0.0
### Major Changes
- 119754c2f: Make optimism/sdk default to bedrock mode
### Patch Changes
- Updated dependencies [8d7dcc70c]
- Updated dependencies [d6388be4a]
- Updated dependencies [af292562f]
- @eth-optimism/core-utils@0.12.1
- @eth-optimism/contracts-bedrock@0.15.0
## 2.1.0
### Minor Changes
- 5063a69fb: Update sdk contract addresses for bedrock
### Patch Changes
- a1b7ff9e3: add eco bridge adapter
- 8133872ed: Fix firefox bug with getTokenPair
- afc2ab8c9: Update the migrated withdrawal gas limit for non goerli networks
- aa854bdd8: Add warning if bedrock is not turned on
- Updated dependencies [f1e867177]
- Updated dependencies [197884eae]
- Updated dependencies [6eb05430d]
- Updated dependencies [5063a69fb]
- @eth-optimism/contracts-bedrock@0.14.0
- @eth-optimism/contracts@0.6.0
## 2.0.2
### Patch Changes
- be3315689: Have SDK automatically create Standard and ETH bridges when L1StandardBridge is provided.
- Updated dependencies [b16067a9f]
- Updated dependencies [9a02079eb]
- Updated dependencies [98fbe9d22]
- @eth-optimism/contracts-bedrock@0.13.2
## 2.0.1
### Patch Changes
- 66cafc00a: Update migrated withdrawal gaslimit calculation
- Updated dependencies [22c3885f5]
- Updated dependencies [f52c07529]
- @eth-optimism/contracts-bedrock@0.13.1
## 2.0.0
### Major Changes
- cb19e2f9c: Moves `FINALIZATION_PERIOD_SECONDS` from the `OptimismPortal` to the `L2OutputOracle` & ensures the `CHALLENGER` key cannot delete finalized outputs.
### Patch Changes
- Updated dependencies [cb19e2f9c]
- @eth-optimism/contracts-bedrock@0.13.0
## 1.10.4
### Patch Changes
- Updated dependencies [80f2271f5]
- @eth-optimism/contracts-bedrock@0.12.1
## 1.10.3
### Patch Changes
- Updated dependencies [7c0a2cc37]
- Updated dependencies [2865dd9b4]
- Updated dependencies [efc98d261]
- Updated dependencies [388f2c25a]
- @eth-optimism/contracts-bedrock@0.12.0
## 1.10.2
### Patch Changes
- 5372c9f5b: Remove assert node builtin from sdk
- Updated dependencies [3c22333b8]
- @eth-optimism/contracts-bedrock@0.11.4
## 1.10.1
### Patch Changes
- Updated dependencies [4964be480]
- @eth-optimism/contracts-bedrock@0.11.3
## 1.10.0
### Minor Changes
- 3f4b3c328: Add in goerli bedrock addresses
## 1.9.1
### Patch Changes
- Updated dependencies [8784bc0bc]
- @eth-optimism/contracts-bedrock@0.11.2
## 1.9.0
### Minor Changes
- d1f9098f9: Removes support for Kovan
### Patch Changes
- ba8b94a60: Don't pass 0 gasLimit for migrated withdrawals
- Updated dependencies [fe80a9488]
- Updated dependencies [827fc7b04]
- Updated dependencies [a2166dcad]
- Updated dependencies [ff09ec22d]
- Updated dependencies [85dfa9fe2]
- Updated dependencies [d1f9098f9]
- Updated dependencies [0f8fc58ad]
- Updated dependencies [89f70c591]
- Updated dependencies [03940c3cb]
- @eth-optimism/contracts-bedrock@0.11.1
- @eth-optimism/contracts@0.5.40
## 1.8.0
### Minor Changes
- c975c9620: Add suppory for finalizing legacy withdrawals after the Bedrock migration
### Patch Changes
- 767585b07: Removes an unused variable from the SDK
- 136ea1785: Refactors the L2OutputOracle to key the l2Outputs mapping by index instead of by L2 block number.
- Updated dependencies [43f33f39f]
- Updated dependencies [237a351f1]
- Updated dependencies [1d3c749a2]
- Updated dependencies [c975c9620]
- Updated dependencies [1594678e0]
- Updated dependencies [1d3c749a2]
- Updated dependencies [136ea1785]
- Updated dependencies [4d13f0afe]
- Updated dependencies [7300a7ca7]
- @eth-optimism/contracts-bedrock@0.11.0
- @eth-optimism/contracts@0.5.39
- @eth-optimism/core-utils@0.12.0
## 1.7.0
### Minor Changes
- 1bfe79f20: Adds an implementation of the Two Step Withdrawals V2 proposal
### Patch Changes
- Updated dependencies [c025a1153]
- Updated dependencies [f8697a607]
- Updated dependencies [59adcaa09]
- Updated dependencies [c71500a7e]
- Updated dependencies [f49b71d50]
- Updated dependencies [1bfe79f20]
- Updated dependencies [ccaf5bc83]
- @eth-optimism/contracts-bedrock@0.10.0
## 1.6.11
### Patch Changes
- Updated dependencies [52079cc12]
- Updated dependencies [13bfafb21]
- Updated dependencies [eeae96941]
- Updated dependencies [427831d86]
- @eth-optimism/contracts-bedrock@0.9.1
## 1.6.10
### Patch Changes
- Updated dependencies [1e76cdb86]
- Updated dependencies [c02831144]
- Updated dependencies [d58b0a397]
- Updated dependencies [ff860ecf3]
- Updated dependencies [cc5adbc61]
- Updated dependencies [31c91ea74]
- Updated dependencies [87702c741]
- @eth-optimism/core-utils@0.11.0
- @eth-optimism/contracts-bedrock@0.9.0
- @eth-optimism/contracts@0.5.38
## 1.6.9
### Patch Changes
- Updated dependencies [db84317b]
- Updated dependencies [9b90c732]
- @eth-optimism/contracts-bedrock@0.8.3
## 1.6.8
### Patch Changes
- Updated dependencies [7d7d9ba8]
- @eth-optimism/contracts-bedrock@0.8.2
## 1.6.7
### Patch Changes
- b40913b1: Adds contract addresses for the Bedrock Alpha testnet
- a5e715c3: Rename the event emitted in the L2ToL1MessagePasser
- Updated dependencies [35a7bb5e]
- Updated dependencies [a5e715c3]
- Updated dependencies [d18b8aa3]
- @eth-optimism/contracts-bedrock@0.8.1
## 1.6.6
### Patch Changes
- Updated dependencies [6ed68fa3]
- Updated dependencies [628affc7]
- Updated dependencies [3d4e8529]
- Updated dependencies [caf5dd3e]
- Updated dependencies [740e1bcc]
- Updated dependencies [a6cbfee2]
- Updated dependencies [394a26ec]
- @eth-optimism/contracts-bedrock@0.8.0
- @eth-optimism/contracts@0.5.37
## 1.6.5
### Patch Changes
- e2faaa8b: Update for new BedrockMessagePasser contract
- Updated dependencies [cb5fed67]
- Updated dependencies [c427f0c0]
- Updated dependencies [e2faaa8b]
- Updated dependencies [d28ad592]
- Updated dependencies [76c8ee2d]
- @eth-optimism/contracts-bedrock@0.7.0
## 1.6.4
### Patch Changes
- 7215f4ce: Bump ethers to 5.7.0 globally
- 206f6033: Fix outdated references to 'withdrawal contract'
- d7679ca4: Add source maps
- Updated dependencies [88dde7c8]
- Updated dependencies [7215f4ce]
- Updated dependencies [249a8ed6]
- Updated dependencies [7d7c4fdf]
- Updated dependencies [e164e22e]
- Updated dependencies [0bc1be45]
- Updated dependencies [af3e56b1]
- Updated dependencies [206f6033]
- Updated dependencies [88dde7c8]
- Updated dependencies [8790156c]
- Updated dependencies [515685f4]
- @eth-optimism/contracts-bedrock@0.6.3
- @eth-optimism/contracts@0.5.36
- @eth-optimism/core-utils@0.10.1
## 1.6.3
### Patch Changes
- Updated dependencies [651a2883]
- @eth-optimism/contracts-bedrock@0.6.2
## 1.6.2
### Patch Changes
- cfa81f88: Add DAI bridge support to Goerli
- Updated dependencies [85232179]
- Updated dependencies [593f1cfb]
- Updated dependencies [334a3eb0]
- Updated dependencies [f78eb056]
- @eth-optimism/contracts-bedrock@0.6.1
- @eth-optimism/contracts@0.5.35
## 1.6.1
### Patch Changes
- b27d0fa7: Add wsteth support for DAI bridge to sdk
- Updated dependencies [7fdc490c]
- Updated dependencies [3d228a0e]
- Updated dependencies [dbfea116]
- Updated dependencies [63ef1949]
- Updated dependencies [299157e7]
- @eth-optimism/contracts-bedrock@0.6.0
- @eth-optimism/core-utils@0.10.0
- @eth-optimism/contracts@0.5.34
## 1.6.0
### Minor Changes
- 3af9c7a9: Removes the ICrossChainMessenger interface to speed up SDK development.
### Patch Changes
- 3df66a9a: Fix eth withdrawal bug
- 8323407f: Fixes a bug in the SDK for certain bridge withdrawals.
- aa2949ef: Add eth withdrawal support
- a1a73e64: Updates the SDK to pull contract addresses from the deployments of the contracts package. Updates the Contracts package to export a function that makes it possible to pull deployed addresses.
- f53c30b9: Minor refactor to variables within the SDK package.
- Updated dependencies [a095d544]
- Updated dependencies [cdf2163e]
- Updated dependencies [791f30bc]
- Updated dependencies [193befed]
- Updated dependencies [0c2719f8]
- Updated dependencies [02420db0]
- Updated dependencies [94a8f287]
- Updated dependencies [7d03c5c0]
- Updated dependencies [fec22bfe]
- Updated dependencies [9272253e]
- Updated dependencies [a1a73e64]
- Updated dependencies [c025f418]
- Updated dependencies [329d21b6]
- Updated dependencies [35eafed0]
- Updated dependencies [3cde9205]
- @eth-optimism/contracts-bedrock@0.5.4
- @eth-optimism/contracts@0.5.33
## 1.5.0
### Minor Changes
- dcd715a6: Update wsteth bridge address
## 1.4.0
### Minor Changes
- f05ab6b6: Add wstETH to sdk
- dac4a9f0: Updates the SDK to be compatible with Bedrock (via the "bedrock: true" constructor param). Updates the build pipeline for contracts-bedrock to export a properly formatted dist folder that matches our other packages.
### Patch Changes
- Updated dependencies [056cb982]
- Updated dependencies [a32e68ac]
- Updated dependencies [c648d55c]
- Updated dependencies [d544f804]
- Updated dependencies [ccbfe545]
- Updated dependencies [c97ad241]
- Updated dependencies [0df744f6]
- Updated dependencies [45541553]
- Updated dependencies [3dd296e8]
- Updated dependencies [fe94b864]
- Updated dependencies [28649d64]
- Updated dependencies [898c7ac5]
- Updated dependencies [51a1595b]
- Updated dependencies [8ae39154]
- Updated dependencies [af96563a]
- Updated dependencies [dac4a9f0]
- @eth-optimism/contracts-bedrock@0.5.3
- @eth-optimism/core-utils@0.9.3
- @eth-optimism/contracts@0.5.32
## 1.3.1
### Patch Changes
- 680714c1: Updates the CCM to throw a better error for missing or invalid chain IDs
- 29830750: Update the Goerli SCC's address
- Updated dependencies [0bf3b9b4]
- Updated dependencies [8d26459b]
- Updated dependencies [4477fe9f]
- Updated dependencies [1de4f48e]
- @eth-optimism/core-utils@0.9.2
- @eth-optimism/contracts@0.5.31
## 1.3.0
### Minor Changes
- 032f7214: Update Goerli SDK addresses for new Goerli testnet
## 1.2.1
### Patch Changes
- Updated dependencies [6e3449ba]
- Updated dependencies [f9fee446]
- @eth-optimism/contracts@0.5.30
- @eth-optimism/core-utils@0.9.1
## 1.2.0
### Minor Changes
- 977493bc: Have SDK use L2 chain ID as the source of truth.
### Patch Changes
- Updated dependencies [700dcbb0]
- @eth-optimism/core-utils@0.9.0
- @eth-optimism/contracts@0.5.29
## 1.1.9
### Patch Changes
- 29ff7462: Revert es target back to 2017
- Updated dependencies [27234f68]
- Updated dependencies [29ff7462]
- @eth-optimism/contracts@0.5.28
- @eth-optimism/core-utils@0.8.7
## 1.1.8
### Patch Changes
- Updated dependencies [7c5ac36f]
- Updated dependencies [3d4d988c]
- @eth-optimism/contracts@0.5.27
## 1.1.7
### Patch Changes
- Updated dependencies [17962ca9]
- @eth-optimism/core-utils@0.8.6
- @eth-optimism/contracts@0.5.26
## 1.1.6
### Patch Changes
- d18ae135: Updates all ethers versions in response to BN.js bug
- Updated dependencies [d18ae135]
- @eth-optimism/contracts@0.5.25
- @eth-optimism/core-utils@0.8.5
## 1.1.5
### Patch Changes
- 86901552: Fixes a bug in the SDK which would cause the SDK to throw if no tx nonce is provided
## 1.1.4
### Patch Changes
- Updated dependencies [b7a04acf]
- @eth-optimism/contracts@0.5.24
## 1.1.3
### Patch Changes
- Updated dependencies [412688d5]
- @eth-optimism/contracts@0.5.23
## 1.1.2
### Patch Changes
- Updated dependencies [51adb389]
- Updated dependencies [5cb3a5f7]
- Updated dependencies [6b9fc055]
- @eth-optimism/contracts@0.5.22
- @eth-optimism/core-utils@0.8.4
## 1.1.1
### Patch Changes
- 1338135c: Fixes a bug where the wrong Overrides type was being used for gas estimation functions
## 1.1.0
### Minor Changes
- a9f8e577: New isL2Provider helper function. Internal cleanups.
### Patch Changes
- Updated dependencies [5818decb]
- @eth-optimism/contracts@0.5.21
## 1.0.4
### Patch Changes
- b57014d1: Update to typescript@4.6.2
- Updated dependencies [d040a8d9]
- Updated dependencies [b57014d1]
- @eth-optimism/contracts@0.5.20
- @eth-optimism/core-utils@0.8.3
## 1.0.3
### Patch Changes
- c1957126: Update Dockerfile to use Alpine
- d9a51154: Bump to hardhat@2.9.1
- Updated dependencies [c1957126]
- Updated dependencies [d9a51154]
- @eth-optimism/contracts@0.5.19
- @eth-optimism/core-utils@0.8.2
## 1.0.2
### Patch Changes
- d49feca1: Comment out non-functional getMessagesByAddress function
- Updated dependencies [88601cb7]
- @eth-optimism/contracts@0.5.18
## 1.0.1
### Patch Changes
- 7ae1c67f: Update package json to include correct repo link
- 47e5d118: Tighten type restriction on ProviderLike
- Updated dependencies [175ae0bf]
- @eth-optimism/contracts@0.5.17
## 1.0.0
### Major Changes
- 84f63c49: Update README and bump SDK to 1.0.0
### Patch Changes
- 42227d69: Fix typo in constructor docstring
## 0.2.5
### Patch Changes
- b66e3131: Add a function for waiting for a particular message status
- Updated dependencies [962f36e4]
- Updated dependencies [f2179e37]
- Updated dependencies [b6a4fa4b]
- Updated dependencies [b7c0a5ca]
- Updated dependencies [5a6f539c]
- Updated dependencies [27d8942e]
- @eth-optimism/contracts@0.5.16
- @eth-optimism/core-utils@0.8.1
## 0.2.4
### Patch Changes
- 44420939: 1. Fix a bug in `L2Provider.getL1GasPrice()` 2. Make it easier to get correct estimates from `L2Provider.estimateL1Gas()` and `L2.estimateL2GasCost`.
## 0.2.3
### Patch Changes
- f37c283c: Have SDK properly handle case when no batches are submitted yet
- 3f4d3c13: Have SDK wait for transactions in getMessagesByTransaction
- 0c54e60e: Add approval functions to the SDK
- Updated dependencies [0b4453f7]
- Updated dependencies [78298782]
- @eth-optimism/core-utils@0.8.0
- @eth-optimism/contracts@0.5.15
## 0.2.2
### Patch Changes
- fd6ea3ee: Adds support for depositing or withdrawing to a target address
- 5ffb5fcf: Removes the getTokenBridgeMessagesByAddress function
- dd4b2055: This update implements the asL2Provider function
- f08c06a8: Updates the SDK to include default bridges for the local Optimism network (31337)
- da53dc64: Have SDK sort deposits/withdrawals descending by block number
- Updated dependencies [b4165299]
- Updated dependencies [3c2acd91]
- @eth-optimism/core-utils@0.7.7
- @eth-optimism/contracts@0.5.14
## 0.2.1
### Patch Changes
- Updated dependencies [438bc78a]
- @eth-optimism/contracts@0.5.13
## 0.2.0
### Minor Changes
- dd9683bb: Correctly export SDK contents
## 0.1.0
### Minor Changes
- cb65f3d8: Beta release of the Optimism SDK
### Patch Changes
- ba14c59d: Updates various ethers dependencies to their latest versions
- 64e746b6: Have SDK include ethers as a peer dependency
- Updated dependencies [ba14c59d]
- @eth-optimism/contracts@0.5.12
- @eth-optimism/core-utils@0.7.6
## 0.0.7
### Patch Changes
- Updated dependencies [e631c39c]
- @eth-optimism/contracts@0.5.11
## 0.0.6
### Patch Changes
- Updated dependencies [ad94b9d1]
- @eth-optimism/core-utils@0.7.5
- @eth-optimism/contracts@0.5.10
## 0.0.5
### Patch Changes
- Updated dependencies [ba96a455]
- Updated dependencies [c3e85fef]
- @eth-optimism/core-utils@0.7.4
- @eth-optimism/contracts@0.5.9
## 0.0.4
### Patch Changes
- Updated dependencies [b3efb8b7]
- Updated dependencies [279603e5]
- Updated dependencies [b6040bb3]
- @eth-optimism/contracts@0.5.8
## 0.0.3
### Patch Changes
- Updated dependencies [b6f89fad]
- @eth-optimism/contracts@0.5.7
## 0.0.2
### Patch Changes
- Updated dependencies [bbd42e03]
- Updated dependencies [453f0774]
- @eth-optimism/contracts@0.5.6
# @eth-optimism/sdk
[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/master/graph/badge.svg?token=0VTG7PG7YR&flag=sdk-tests)](https://codecov.io/gh/ethereum-optimism/optimism)
The `@eth-optimism/sdk` package provides a set of tools for interacting with Optimism.
## Warning!!!
`@eth-optimism/sdk` has been superseded by `op-viem`. For most developers we suggest you migrate to [viem](https://viem.sh/op-stack) which has native built in op-stack support built in. It also has additional benefits.
**The OP Labs team has no plans to add new features @eth-optimism/sdk and it is in maintenance mode**
If you are already using the sdk you are safe as it will continue to be maintained.
- an intuitive API that learned from this package and is now revamped
- great treeshaking with a 10x+ improvement to bundlesize
- Better performance
- Updated to use the latest op stack contracts. At times it will save you gas compared to using viem.
If viem does not have what you need please let us know by opening an issue in the viem repo or here. Letting us know helps us advocate to upstream more functionality to viem. Viem is missing the following functionality:
- ERC20 support
If viem doesn't have what you need, the extensions for viem, [op-viem extensions](https://github.com/base-org/op-viem), likely have it too.
## Installation
```
npm install @eth-optimism/sdk
```
## Docs
You can find auto-generated API documentation over at [sdk.optimism.io](https://sdk.optimism.io).
## Contributing
Most of the core functionality is in the [CrossChainMessenger](./src/cross-chain-messenger.ts) file.
## Using the SDK
### CrossChainMessenger
The [`CrossChainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/sdk/src/cross-chain-messenger.ts) class simplifies the process of moving assets and data between Ethereum and Optimism.
You can use this class to, for example, initiate a withdrawal of ERC20 tokens from Optimism back to Ethereum, accurately track when the withdrawal is ready to be finalized on Ethereum, and execute the finalization transaction after the challenge period has elapsed.
The `CrossChainMessenger` can handle deposits and withdrawals of ETH and any ERC20-compatible token.
Detailed API descriptions can be found at [sdk.optimism.io](https://sdk.optimism.io/classes/crosschainmessenger).
The `CrossChainMessenger` automatically connects to all relevant contracts so complex configuration is not necessary.
### L2Provider and related utilities
The Optimism SDK includes [various utilities](https://github.com/ethereum-optimism/optimism/blob/develop/packages/sdk/src/l2-provider.ts) for handling Optimism's [transaction fee model](https://community.optimism.io/docs/developers/build/transaction-fees/).
For instance, [`estimateTotalGasCost`](https://sdk.optimism.io/modules.html#estimateTotalGasCost) will estimate the total cost (in wei) to send at transaction on Optimism including both the L2 execution cost and the L1 data cost.
You can also use the [`asL2Provider`](https://sdk.optimism.io/modules.html#asL2Provider) function to wrap an ethers Provider object into an `L2Provider` which will have all of these helper functions attached.
### Other utilities
The SDK contains other useful helper functions and constants.
For a complete list, refer to the auto-generated [SDK documentation](https://sdk.optimism.io/)
// public rpcs are heavily throttled/rate limited so replace these with rpcs with apikeys. These are meant to be testnet rpcs
// in future these will get renamed to VITE_E2E_RPC_URL_GOERLI etc.
VITE_E2E_RPC_URL_L1=https://ethereum-goerli.publicnode.com
VITE_E2E_RPC_URL_L2=https://goerli.optimism.io
\ No newline at end of file
import fetch from 'isomorphic-fetch'
// viem needs this
global.fetch = fetch
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Contract } from 'ethers'
import { hexStringEquals } from '@eth-optimism/core-utils'
import { AddressLike } from '../interfaces'
import { toAddress } from '../utils'
import { StandardBridgeAdapter } from './standard-bridge'
/**
* Bridge adapter for DAI.
*/
export class DAIBridgeAdapter extends StandardBridgeAdapter {
public async supportsTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<boolean> {
// Just need access to this ABI for this one function.
const l1Bridge = new Contract(
this.l1Bridge.address,
[
{
inputs: [],
name: 'l1Token' as const,
outputs: [
{
internalType: 'address' as const,
name: '' as const,
type: 'address' as const,
},
],
stateMutability: 'view' as const,
type: 'function' as const,
},
{
inputs: [],
name: 'l2Token' as const,
outputs: [
{
internalType: 'address' as const,
name: '' as const,
type: 'address' as const,
},
],
stateMutability: 'view' as const,
type: 'function' as const,
},
],
this.messenger.l1Provider
)
const allowedL1Token = await l1Bridge.l1Token()
if (!hexStringEquals(allowedL1Token, toAddress(l1Token))) {
return false
}
const allowedL2Token = await l1Bridge.l2Token()
if (!hexStringEquals(allowedL2Token, toAddress(l2Token))) {
return false
}
return true
}
}
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Contract } from 'ethers'
import { hexStringEquals } from '@eth-optimism/core-utils'
import { AddressLike } from '../interfaces'
import { toAddress } from '../utils'
import { StandardBridgeAdapter } from './standard-bridge'
/**
* Bridge adapter for ECO.
* ECO bridge requires a separate adapter as exposes different functions than our standard bridge
*/
export class ECOBridgeAdapter extends StandardBridgeAdapter {
public async supportsTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<boolean> {
const l1Bridge = new Contract(
this.l1Bridge.address,
[
{
inputs: [],
name: 'l1Eco',
outputs: [
{
internalType: 'address',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
],
this.messenger.l1Provider
)
const l2Bridge = new Contract(
this.l2Bridge.address,
[
{
inputs: [],
name: 'l2Eco',
outputs: [
{
internalType: 'contract L2ECO',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
],
this.messenger.l2Provider
)
const [remoteL1Token, remoteL2Token] = await Promise.all([
l1Bridge.l1Eco(),
l2Bridge.l2Eco(),
])
if (!hexStringEquals(remoteL1Token, toAddress(l1Token))) {
return false
}
if (!hexStringEquals(remoteL2Token, toAddress(l2Token))) {
return false
}
return true
}
}
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ethers, Overrides, BigNumber } from 'ethers'
import { TransactionRequest, BlockTag } from '@ethersproject/abstract-provider'
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import {
NumberLike,
AddressLike,
TokenBridgeMessage,
MessageDirection,
} from '../interfaces'
import { toAddress, omit } from '../utils'
import { StandardBridgeAdapter } from './standard-bridge'
/**
* Bridge adapter for the ETH bridge.
*/
export class ETHBridgeAdapter extends StandardBridgeAdapter {
public async approval(
l1Token: AddressLike,
l2Token: AddressLike,
signer: ethers.Signer
): Promise<BigNumber> {
throw new Error(`approval not necessary for ETH bridge`)
}
public async getDepositsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]> {
const events = await this.l1Bridge.queryFilter(
this.l1Bridge.filters.ETHDepositInitiated(address),
opts?.fromBlock,
opts?.toBlock
)
return events
.map((event) => {
return {
direction: MessageDirection.L1_TO_L2,
from: event.args.from,
to: event.args.to,
l1Token: ethers.constants.AddressZero,
l2Token: predeploys.OVM_ETH,
amount: event.args.amount,
data: event.args.extraData,
logIndex: event.logIndex,
blockNumber: event.blockNumber,
transactionHash: event.transactionHash,
}
})
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
public async getWithdrawalsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]> {
const events = await this.l2Bridge.queryFilter(
this.l2Bridge.filters.WithdrawalInitiated(undefined, undefined, address),
opts?.fromBlock,
opts?.toBlock
)
return events
.filter((event) => {
// Only find ETH withdrawals.
return (
hexStringEquals(event.args.l1Token, ethers.constants.AddressZero) &&
hexStringEquals(event.args.l2Token, predeploys.OVM_ETH)
)
})
.map((event) => {
return {
direction: MessageDirection.L2_TO_L1,
from: event.args.from,
to: event.args.to,
l1Token: event.args.l1Token,
l2Token: event.args.l2Token,
amount: event.args.amount,
data: event.args.extraData,
logIndex: event.logIndex,
blockNumber: event.blockNumber,
transactionHash: event.transactionHash,
}
})
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
public async supportsTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<boolean> {
// Only support ETH deposits and withdrawals.
return (
hexStringEquals(toAddress(l1Token), ethers.constants.AddressZero) &&
hexStringEquals(toAddress(l2Token), predeploys.OVM_ETH)
)
}
populateTransaction = {
approve: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: Overrides
}
): Promise<never> => {
throw new Error(`approvals not necessary for ETH bridge`)
},
deposit: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
if (opts?.recipient === undefined) {
return this.l1Bridge.populateTransaction.depositETH(
opts?.l2GasLimit || 200_000, // Default to 200k gas limit.
'0x', // No data.
{
...omit(opts?.overrides || {}, 'value'),
value: amount,
}
)
} else {
return this.l1Bridge.populateTransaction.depositETHTo(
toAddress(opts.recipient),
opts?.l2GasLimit || 200_000, // Default to 200k gas limit.
'0x', // No data.
{
...omit(opts?.overrides || {}, 'value'),
value: amount,
}
)
}
},
withdraw: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
if (opts?.recipient === undefined) {
return this.l2Bridge.populateTransaction.withdraw(
toAddress(l2Token),
amount,
0, // L1 gas not required.
'0x', // No data.
{
...omit(opts?.overrides || {}, 'value'),
value: this.messenger.bedrock ? amount : 0,
}
)
} else {
return this.l2Bridge.populateTransaction.withdrawTo(
toAddress(l2Token),
toAddress(opts.recipient),
amount,
0, // L1 gas not required.
'0x', // No data.
{
...omit(opts?.overrides || {}, 'value'),
value: this.messenger.bedrock ? amount : 0,
}
)
}
},
}
}
export * from './standard-bridge'
export * from './eth-bridge'
export * from './dai-bridge'
export * from './eco-bridge'
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
ethers,
Contract,
Overrides,
Signer,
BigNumber,
CallOverrides,
} from 'ethers'
import {
TransactionRequest,
TransactionResponse,
BlockTag,
} from '@ethersproject/abstract-provider'
import { predeploys } from '@eth-optimism/contracts'
import { hexStringEquals } from '@eth-optimism/core-utils'
import l1StandardBridgeArtifact from '../forge-artifacts/L1StandardBridge.json'
import l2StandardBridgeArtifact from '../forge-artifacts/L2StandardBridge.json'
import optimismMintableERC20 from '../forge-artifacts/OptimismMintableERC20.json'
import { CrossChainMessenger } from '../cross-chain-messenger'
import {
IBridgeAdapter,
NumberLike,
AddressLike,
TokenBridgeMessage,
MessageDirection,
} from '../interfaces'
import { toAddress } from '../utils'
/**
* Bridge adapter for any token bridge that uses the standard token bridge interface.
*/
export class StandardBridgeAdapter implements IBridgeAdapter {
public messenger: CrossChainMessenger
public l1Bridge: Contract
public l2Bridge: Contract
/**
* Creates a StandardBridgeAdapter instance.
*
* @param opts Options for the adapter.
* @param opts.messenger Provider used to make queries related to cross-chain interactions.
* @param opts.l1Bridge L1 bridge contract.
* @param opts.l2Bridge L2 bridge contract.
*/
constructor(opts: {
messenger: CrossChainMessenger
l1Bridge: AddressLike
l2Bridge: AddressLike
}) {
this.messenger = opts.messenger
this.l1Bridge = new Contract(
toAddress(opts.l1Bridge),
l1StandardBridgeArtifact.abi,
this.messenger.l1Provider
)
this.l2Bridge = new Contract(
toAddress(opts.l2Bridge),
l2StandardBridgeArtifact.abi,
this.messenger.l2Provider
)
}
public async getDepositsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]> {
const events = await this.l1Bridge.queryFilter(
this.l1Bridge.filters.ERC20DepositInitiated(
undefined,
undefined,
address
),
opts?.fromBlock,
opts?.toBlock
)
return events
.filter((event) => {
// Specifically filter out ETH. ETH deposits and withdrawals are handled by the ETH bridge
// adapter. Bridges that are not the ETH bridge should not be able to handle or even
// present ETH deposits or withdrawals.
return (
!hexStringEquals(event.args.l1Token, ethers.constants.AddressZero) &&
!hexStringEquals(event.args.l2Token, predeploys.OVM_ETH)
)
})
.map((event) => {
return {
direction: MessageDirection.L1_TO_L2,
from: event.args.from,
to: event.args.to,
l1Token: event.args.l1Token,
l2Token: event.args.l2Token,
amount: event.args.amount,
data: event.args.extraData,
logIndex: event.logIndex,
blockNumber: event.blockNumber,
transactionHash: event.transactionHash,
}
})
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
public async getWithdrawalsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]> {
const events = await this.l2Bridge.queryFilter(
this.l2Bridge.filters.WithdrawalInitiated(undefined, undefined, address),
opts?.fromBlock,
opts?.toBlock
)
return events
.filter((event) => {
// Specifically filter out ETH. ETH deposits and withdrawals are handled by the ETH bridge
// adapter. Bridges that are not the ETH bridge should not be able to handle or even
// present ETH deposits or withdrawals.
return (
!hexStringEquals(event.args.l1Token, ethers.constants.AddressZero) &&
!hexStringEquals(event.args.l2Token, predeploys.OVM_ETH)
)
})
.map((event) => {
return {
direction: MessageDirection.L2_TO_L1,
from: event.args.from,
to: event.args.to,
l1Token: event.args.l1Token,
l2Token: event.args.l2Token,
amount: event.args.amount,
data: event.args.extraData,
logIndex: event.logIndex,
blockNumber: event.blockNumber,
transactionHash: event.transactionHash,
}
})
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
public async supportsTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<boolean> {
const contract = new Contract(
toAddress(l2Token),
optimismMintableERC20.abi,
this.messenger.l2Provider
)
// Don't support ETH deposits or withdrawals via this bridge.
if (
hexStringEquals(toAddress(l1Token), ethers.constants.AddressZero) ||
hexStringEquals(toAddress(l2Token), predeploys.OVM_ETH)
) {
return false
}
// Make sure the L1 token matches.
const remoteL1Token = await contract.l1Token()
if (!hexStringEquals(remoteL1Token, toAddress(l1Token))) {
return false
}
// Make sure the L2 bridge matches.
const remoteL2Bridge = await contract.l2Bridge()
if (!hexStringEquals(remoteL2Bridge, this.l2Bridge.address)) {
return false
}
return true
}
public async approval(
l1Token: AddressLike,
l2Token: AddressLike,
signer: ethers.Signer
): Promise<BigNumber> {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
const token = new Contract(
toAddress(l1Token),
optimismMintableERC20.abi,
this.messenger.l1Provider
)
return token.allowance(await signer.getAddress(), this.l1Bridge.address)
}
public async approve(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
overrides?: Overrides
}
): Promise<TransactionResponse> {
return signer.sendTransaction(
await this.populateTransaction.approve(l1Token, l2Token, amount, opts)
)
}
public async deposit(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionResponse> {
return signer.sendTransaction(
await this.populateTransaction.deposit(l1Token, l2Token, amount, opts)
)
}
public async withdraw(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionResponse> {
return signer.sendTransaction(
await this.populateTransaction.withdraw(l1Token, l2Token, amount, opts)
)
}
populateTransaction = {
approve: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
const token = new Contract(
toAddress(l1Token),
optimismMintableERC20.abi,
this.messenger.l1Provider
)
return token.populateTransaction.approve(
this.l1Bridge.address,
amount,
opts?.overrides || {}
)
},
deposit: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
if (opts?.recipient === undefined) {
return this.l1Bridge.populateTransaction.depositERC20(
toAddress(l1Token),
toAddress(l2Token),
amount,
opts?.l2GasLimit || 200_000, // Default to 200k gas limit.
'0x', // No data.
opts?.overrides || {}
)
} else {
return this.l1Bridge.populateTransaction.depositERC20To(
toAddress(l1Token),
toAddress(l2Token),
toAddress(opts.recipient),
amount,
opts?.l2GasLimit || 200_000, // Default to 200k gas limit.
'0x', // No data.
opts?.overrides || {}
)
}
},
withdraw: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (!(await this.supportsTokenPair(l1Token, l2Token))) {
throw new Error(`token pair not supported by bridge`)
}
if (opts?.recipient === undefined) {
return this.l2Bridge.populateTransaction.withdraw(
toAddress(l2Token),
amount,
0, // L1 gas not required.
'0x', // No data.
opts?.overrides || {}
)
} else {
return this.l2Bridge.populateTransaction.withdrawTo(
toAddress(l2Token),
toAddress(opts.recipient),
amount,
0, // L1 gas not required.
'0x', // No data.
opts?.overrides || {}
)
}
},
}
estimateGas = {
approve: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.messenger.l1Provider.estimateGas(
await this.populateTransaction.approve(l1Token, l2Token, amount, opts)
)
},
deposit: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.messenger.l1Provider.estimateGas(
await this.populateTransaction.deposit(l1Token, l2Token, amount, opts)
)
},
withdraw: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.messenger.l2Provider.estimateGas(
await this.populateTransaction.withdraw(l1Token, l2Token, amount, opts)
)
},
}
}
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
Provider,
BlockTag,
TransactionReceipt,
TransactionResponse,
TransactionRequest,
} from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer'
import {
ethers,
BigNumber,
Overrides,
CallOverrides,
PayableOverrides,
} from 'ethers'
import {
sleep,
remove0x,
toHexString,
toRpcHexString,
encodeCrossDomainMessageV0,
encodeCrossDomainMessageV1,
BedrockOutputData,
BedrockCrossChainMessageProof,
decodeVersionedNonce,
encodeVersionedNonce,
getChainId,
hashCrossDomainMessagev0,
hashCrossDomainMessagev1,
} from '@eth-optimism/core-utils'
import { getContractInterface, predeploys } from '@eth-optimism/contracts'
import * as rlp from 'rlp'
import semver from 'semver'
import {
OEContracts,
OEContractsLike,
MessageLike,
MessageRequestLike,
TransactionLike,
AddressLike,
NumberLike,
SignerOrProviderLike,
CrossChainMessage,
CrossChainMessageRequest,
CrossChainMessageProof,
MessageDirection,
MessageStatus,
TokenBridgeMessage,
MessageReceipt,
MessageReceiptStatus,
BridgeAdapterData,
BridgeAdapters,
StateRoot,
StateRootBatch,
IBridgeAdapter,
ProvenWithdrawal,
LowLevelMessage,
FPACProvenWithdrawal,
} from './interfaces'
import {
toSignerOrProvider,
toNumber,
toTransactionHash,
DeepPartial,
getAllOEContracts,
getBridgeAdapters,
makeMerkleTreeProof,
makeStateTrieProof,
hashLowLevelMessage,
migratedWithdrawalGasLimit,
DEPOSIT_CONFIRMATION_BLOCKS,
CHAIN_BLOCK_TIMES,
hashMessageHash,
getContractInterfaceBedrock,
toJsonRpcProvider,
} from './utils'
export class CrossChainMessenger {
/**
* Provider connected to the L1 chain.
*/
public l1SignerOrProvider: Signer | Provider
/**
* Provider connected to the L2 chain.
*/
public l2SignerOrProvider: Signer | Provider
/**
* Chain ID for the L1 network.
*/
public l1ChainId: number
/**
* Chain ID for the L2 network.
*/
public l2ChainId: number
/**
* Contract objects attached to their respective providers and addresses.
*/
public contracts: OEContracts
/**
* List of custom bridges for the given network.
*/
public bridges: BridgeAdapters
/**
* Number of blocks before a deposit is considered confirmed.
*/
public depositConfirmationBlocks: number
/**
* Estimated average L1 block time in seconds.
*/
public l1BlockTimeSeconds: number
/**
* Whether or not Bedrock compatibility is enabled.
*/
public bedrock: boolean
/**
* Cache for output root validation. Output roots are expensive to verify, so we cache them.
*/
private _outputCache: Array<{ root: string; valid: boolean }> = []
/**
* Creates a new CrossChainProvider instance.
*
* @param opts Options for the provider.
* @param opts.l1SignerOrProvider Signer or Provider for the L1 chain, or a JSON-RPC url.
* @param opts.l2SignerOrProvider Signer or Provider for the L2 chain, or a JSON-RPC url.
* @param opts.l1ChainId Chain ID for the L1 chain.
* @param opts.l2ChainId Chain ID for the L2 chain.
* @param opts.depositConfirmationBlocks Optional number of blocks before a deposit is confirmed.
* @param opts.l1BlockTimeSeconds Optional estimated block time in seconds for the L1 chain.
* @param opts.contracts Optional contract address overrides.
* @param opts.bridges Optional bridge address list.
* @param opts.bedrock Whether or not to enable Bedrock compatibility.
*/
constructor(opts: {
l1SignerOrProvider: SignerOrProviderLike
l2SignerOrProvider: SignerOrProviderLike
l1ChainId: NumberLike
l2ChainId: NumberLike
depositConfirmationBlocks?: NumberLike
l1BlockTimeSeconds?: NumberLike
contracts?: DeepPartial<OEContractsLike>
bridges?: BridgeAdapterData
bedrock?: boolean
}) {
this.bedrock = opts.bedrock ?? true
this.l1SignerOrProvider = toSignerOrProvider(opts.l1SignerOrProvider)
this.l2SignerOrProvider = toSignerOrProvider(opts.l2SignerOrProvider)
try {
this.l1ChainId = toNumber(opts.l1ChainId)
} catch (err) {
throw new Error(`L1 chain ID is missing or invalid: ${opts.l1ChainId}`)
}
try {
this.l2ChainId = toNumber(opts.l2ChainId)
} catch (err) {
throw new Error(`L2 chain ID is missing or invalid: ${opts.l2ChainId}`)
}
this.depositConfirmationBlocks =
opts?.depositConfirmationBlocks !== undefined
? toNumber(opts.depositConfirmationBlocks)
: DEPOSIT_CONFIRMATION_BLOCKS[this.l2ChainId] || 0
this.l1BlockTimeSeconds =
opts?.l1BlockTimeSeconds !== undefined
? toNumber(opts.l1BlockTimeSeconds)
: CHAIN_BLOCK_TIMES[this.l1ChainId] || 1
this.contracts = getAllOEContracts(this.l2ChainId, {
l1SignerOrProvider: this.l1SignerOrProvider,
l2SignerOrProvider: this.l2SignerOrProvider,
overrides: opts.contracts,
})
this.bridges = getBridgeAdapters(this.l2ChainId, this, {
overrides: opts.bridges,
contracts: opts.contracts,
})
}
/**
* Provider connected to the L1 chain.
*/
get l1Provider(): Provider {
if (Provider.isProvider(this.l1SignerOrProvider)) {
return this.l1SignerOrProvider
} else {
return this.l1SignerOrProvider.provider
}
}
/**
* Provider connected to the L2 chain.
*/
get l2Provider(): Provider {
if (Provider.isProvider(this.l2SignerOrProvider)) {
return this.l2SignerOrProvider
} else {
return this.l2SignerOrProvider.provider
}
}
/**
* Signer connected to the L1 chain.
*/
get l1Signer(): Signer {
if (Provider.isProvider(this.l1SignerOrProvider)) {
throw new Error(`messenger has no L1 signer`)
} else {
return this.l1SignerOrProvider
}
}
/**
* Signer connected to the L2 chain.
*/
get l2Signer(): Signer {
if (Provider.isProvider(this.l2SignerOrProvider)) {
throw new Error(`messenger has no L2 signer`)
} else {
return this.l2SignerOrProvider
}
}
/**
* Uses portal version to determine if the messenger is using fpac contracts. Better not to cache
* this value as it will change during the fpac upgrade and we want clients to automatically
* begin using the new logic without throwing any errors.
*
* @returns Whether or not the messenger is using fpac contracts.
*/
public async fpac(): Promise<boolean> {
if (
this.contracts.l1.OptimismPortal.address === ethers.constants.AddressZero
) {
// Only really relevant for certain SDK tests where the portal is not deployed. We should
// probably just update the tests so the portal gets deployed but feels like it's out of
// scope for the FPAC changes.
return false
} else {
return semver.gte(
await this.contracts.l1.OptimismPortal.version(),
'3.0.0'
)
}
}
/**
* Retrieves all cross chain messages sent within a given transaction.
*
* @param transaction Transaction hash or receipt to find messages from.
* @param opts Options object.
* @param opts.direction Direction to search for messages in. If not provided, will attempt to
* automatically search both directions under the assumption that a transaction hash will only
* exist on one chain. If the hash exists on both chains, will throw an error.
* @returns All cross chain messages sent within the transaction.
*/
public async getMessagesByTransaction(
transaction: TransactionLike,
opts: {
direction?: MessageDirection
} = {}
): Promise<CrossChainMessage[]> {
// Wait for the transaction receipt if the input is waitable.
await (transaction as TransactionResponse).wait?.()
// Convert the input to a transaction hash.
const txHash = toTransactionHash(transaction)
let receipt: TransactionReceipt
if (opts.direction !== undefined) {
// Get the receipt for the requested direction.
if (opts.direction === MessageDirection.L1_TO_L2) {
receipt = await this.l1Provider.getTransactionReceipt(txHash)
} else {
receipt = await this.l2Provider.getTransactionReceipt(txHash)
}
} else {
// Try both directions, starting with L1 => L2.
receipt = await this.l1Provider.getTransactionReceipt(txHash)
if (receipt) {
opts.direction = MessageDirection.L1_TO_L2
} else {
receipt = await this.l2Provider.getTransactionReceipt(txHash)
opts.direction = MessageDirection.L2_TO_L1
}
}
if (!receipt) {
throw new Error(`unable to find transaction receipt for ${txHash}`)
}
// By this point opts.direction will always be defined.
const messenger =
opts.direction === MessageDirection.L1_TO_L2
? this.contracts.l1.L1CrossDomainMessenger
: this.contracts.l2.L2CrossDomainMessenger
return receipt.logs
.filter((log) => {
// Only look at logs emitted by the messenger address
return log.address === messenger.address
})
.filter((log) => {
// Only look at SentMessage logs specifically
const parsed = messenger.interface.parseLog(log)
return parsed.name === 'SentMessage'
})
.map((log) => {
// Try to pull out the value field, but only if the very next log is a SentMessageExtension1
// event which was introduced in the Bedrock upgrade.
let value = ethers.BigNumber.from(0)
const next = receipt.logs.find((l) => {
return (
l.logIndex === log.logIndex + 1 && l.address === messenger.address
)
})
if (next) {
const nextParsed = messenger.interface.parseLog(next)
if (nextParsed.name === 'SentMessageExtension1') {
value = nextParsed.args.value
}
}
// Convert each SentMessage log into a message object
const parsed = messenger.interface.parseLog(log)
return {
direction: opts.direction,
target: parsed.args.target,
sender: parsed.args.sender,
message: parsed.args.message,
messageNonce: parsed.args.messageNonce,
value,
minGasLimit: parsed.args.gasLimit,
logIndex: log.logIndex,
blockNumber: log.blockNumber,
transactionHash: log.transactionHash,
}
})
}
/**
* Transforms a legacy message into its corresponding Bedrock representation.
*
* @param message Legacy message to transform.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Bedrock representation of the message.
*/
public async toBedrockCrossChainMessage(
message: MessageLike,
messageIndex = 0
): Promise<CrossChainMessage> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
// Bedrock messages are already in the correct format.
const { version } = decodeVersionedNonce(resolved.messageNonce)
if (version.eq(1)) {
return resolved
}
let value = BigNumber.from(0)
if (
resolved.direction === MessageDirection.L2_TO_L1 &&
resolved.sender === this.contracts.l2.L2StandardBridge.address &&
resolved.target === this.contracts.l1.L1StandardBridge.address
) {
try {
;[, , value] =
this.contracts.l1.L1StandardBridge.interface.decodeFunctionData(
'finalizeETHWithdrawal',
resolved.message
)
} catch (err) {
// No problem, not a message with value.
}
}
return {
...resolved,
value,
minGasLimit: BigNumber.from(0),
messageNonce: encodeVersionedNonce(
BigNumber.from(0),
resolved.messageNonce
),
}
}
/**
* Transforms a CrossChainMessenger message into its low-level representation inside the
* L2ToL1MessagePasser contract on L2.
*
* @param message Message to transform.
* @param messageIndex The index of the message, if multiple exist from multicall
* @return Transformed message.
*/
public async toLowLevelMessage(
message: MessageLike,
messageIndex = 0
): Promise<LowLevelMessage> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`can only convert L2 to L1 messages to low level`)
}
// We may have to update the message if it's a legacy message.
const { version } = decodeVersionedNonce(resolved.messageNonce)
let updated: CrossChainMessage
if (version.eq(0)) {
updated = await this.toBedrockCrossChainMessage(resolved, messageIndex)
} else {
updated = resolved
}
// Encode the updated message, we need this for legacy messages.
const encoded = encodeCrossDomainMessageV1(
updated.messageNonce,
updated.sender,
updated.target,
updated.value,
updated.minGasLimit,
updated.message
)
// EVERYTHING following here is basically repeating the logic from getMessagesByTransaction
// consider cleaning this up
// We need to figure out the final withdrawal data that was used to compute the withdrawal hash
// inside the L2ToL1Message passer contract. Exact mechanism here depends on whether or not
// this is a legacy message or a new Bedrock message.
let gasLimit: BigNumber
let messageNonce: BigNumber
if (version.eq(0)) {
const chainID = await getChainId(this.l2Provider)
gasLimit = migratedWithdrawalGasLimit(encoded, chainID)
messageNonce = resolved.messageNonce
} else {
const receipt = await this.l2Provider.getTransactionReceipt(
(
await this.toCrossChainMessage(message)
).transactionHash
)
const withdrawals: ethers.utils.Result[] = []
for (const log of receipt.logs) {
if (log.address === this.contracts.l2.BedrockMessagePasser.address) {
const decoded =
this.contracts.l2.L2ToL1MessagePasser.interface.parseLog(log)
if (decoded.name === 'MessagePassed') {
withdrawals.push(decoded.args)
}
}
}
// Should not happen.
if (withdrawals.length === 0) {
throw new Error(`no withdrawals found in receipt`)
}
const withdrawal = withdrawals[messageIndex]
if (!withdrawal) {
throw new Error(
`withdrawal index ${messageIndex} out of bounds there are ${withdrawals.length} withdrawals`
)
}
messageNonce = withdrawal.nonce
gasLimit = withdrawal.gasLimit
}
return {
messageNonce,
sender: this.contracts.l2.L2CrossDomainMessenger.address,
target: this.contracts.l1.L1CrossDomainMessenger.address,
value: updated.value,
minGasLimit: gasLimit,
message: encoded,
}
}
// public async getMessagesByAddress(
// address: AddressLike,
// opts?: {
// direction?: MessageDirection
// fromBlock?: NumberLike
// toBlock?: NumberLike
// }
// ): Promise<CrossChainMessage[]> {
// throw new Error(`
// The function getMessagesByAddress is currently not enabled because the sender parameter of
// the SentMessage event is not indexed within the CrossChainMessenger contracts.
// getMessagesByAddress will be enabled by plugging in an Optimism Indexer (coming soon).
// See the following issue on GitHub for additional context:
// https://github.com/ethereum-optimism/optimism/issues/2129
// `)
// }
/**
* Finds the appropriate bridge adapter for a given L1<>L2 token pair. Will throw if no bridges
* support the token pair or if more than one bridge supports the token pair.
*
* @param l1Token L1 token address.
* @param l2Token L2 token address.
* @returns The appropriate bridge adapter for the given token pair.
*/
public async getBridgeForTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<IBridgeAdapter> {
const bridges: IBridgeAdapter[] = []
for (const bridge of Object.values(this.bridges)) {
try {
if (await bridge.supportsTokenPair(l1Token, l2Token)) {
bridges.push(bridge)
}
} catch (err) {
if (
!err?.message?.toString().includes('CALL_EXCEPTION') &&
!err?.stack?.toString().includes('execution reverted')
) {
console.error('Unexpected error when checking bridge', err)
}
}
}
if (bridges.length === 0) {
throw new Error(`no supported bridge for token pair`)
}
if (bridges.length > 1) {
throw new Error(`found more than one bridge for token pair`)
}
return bridges[0]
}
/**
* Gets all deposits for a given address.
*
* @param address Address to search for messages from.
* @param opts Options object.
* @param opts.fromBlock Block to start searching for messages from. If not provided, will start
* from the first block (block #0).
* @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
* latest known block ("latest").
* @returns All deposit token bridge messages sent by the given address.
*/
public async getDepositsByAddress(
address: AddressLike,
opts: {
fromBlock?: BlockTag
toBlock?: BlockTag
} = {}
): Promise<TokenBridgeMessage[]> {
return (
await Promise.all(
Object.values(this.bridges).map(async (bridge) => {
return bridge.getDepositsByAddress(address, opts)
})
)
)
.reduce((acc, val) => {
return acc.concat(val)
}, [])
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
/**
* Gets all withdrawals for a given address.
*
* @param address Address to search for messages from.
* @param opts Options object.
* @param opts.fromBlock Block to start searching for messages from. If not provided, will start
* from the first block (block #0).
* @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
* latest known block ("latest").
* @returns All withdrawal token bridge messages sent by the given address.
*/
public async getWithdrawalsByAddress(
address: AddressLike,
opts: {
fromBlock?: BlockTag
toBlock?: BlockTag
} = {}
): Promise<TokenBridgeMessage[]> {
return (
await Promise.all(
Object.values(this.bridges).map(async (bridge) => {
return bridge.getWithdrawalsByAddress(address, opts)
})
)
)
.reduce((acc, val) => {
return acc.concat(val)
}, [])
.sort((a, b) => {
// Sort descending by block number
return b.blockNumber - a.blockNumber
})
}
/**
* Resolves a MessageLike into a CrossChainMessage object.
* Unlike other coercion functions, this function is stateful and requires making additional
* requests. For now I'm going to keep this function here, but we could consider putting a
* similar function inside of utils/coercion.ts if people want to use this without having to
* create an entire CrossChainProvider object.
*
* @param message MessageLike to resolve into a CrossChainMessage.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Message coerced into a CrossChainMessage.
*/
public async toCrossChainMessage(
message: MessageLike,
messageIndex = 0
): Promise<CrossChainMessage> {
if (!message) {
throw new Error('message is undefined')
}
// TODO: Convert these checks into proper type checks.
if ((message as CrossChainMessage).message) {
return message as CrossChainMessage
} else if (
(message as TokenBridgeMessage).l1Token &&
(message as TokenBridgeMessage).l2Token &&
(message as TokenBridgeMessage).transactionHash
) {
const messages = await this.getMessagesByTransaction(
(message as TokenBridgeMessage).transactionHash
)
// The `messages` object corresponds to a list of SentMessage events that were triggered by
// the same transaction. We want to find the specific SentMessage event that corresponds to
// the TokenBridgeMessage (either a ETHDepositInitiated, ERC20DepositInitiated, or
// WithdrawalInitiated event). We expect the behavior of bridge contracts to be that these
// TokenBridgeMessage events are triggered and then a SentMessage event is triggered. Our
// goal here is therefore to find the first SentMessage event that comes after the input
// event.
const found = messages
.sort((a, b) => {
// Sort all messages in ascending order by log index.
return a.logIndex - b.logIndex
})
.find((m) => {
return m.logIndex > (message as TokenBridgeMessage).logIndex
})
if (!found) {
throw new Error(`could not find SentMessage event for message`)
}
return found
} else {
// TODO: Explicit TransactionLike check and throw if not TransactionLike
const messages = await this.getMessagesByTransaction(
message as TransactionLike
)
const out = messages[messageIndex]
if (!out) {
throw new Error(
`withdrawal index ${messageIndex} out of bounds. There are ${messages.length} withdrawals`
)
}
return out
}
}
/**
* Retrieves the status of a particular message as an enum.
*
* @param message Cross chain message to check the status of.
* @param messageIndex The index of the message, if multiple exist from multicall
* @param fromBlockOrBlockHash The start block to use for the query filter on the RECEIVING chain
* @param toBlockOrBlockHash The end block to use for the query filter on the RECEIVING chain
* @returns Status of the message.
*/
public async getMessageStatus(
message: MessageLike,
// consider making this an options object next breaking release
messageIndex = 0,
/**
* @deprecated no longer used since no log filters are used
*/
fromBlockOrBlockHash?: BlockTag,
/**
* @deprecated no longer used since no log filters are used
*/
toBlockOrBlockHash?: BlockTag
): Promise<MessageStatus> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
// legacy withdrawals relayed prebedrock are v1
const messageHashV0 = hashCrossDomainMessagev0(
resolved.target,
resolved.sender,
resolved.message,
resolved.messageNonce
)
// bedrock withdrawals are v1
// legacy withdrawals relayed postbedrock are v1
// there is no good way to differentiate between the two types of legacy
// so what we will check for both
const messageHashV1 = hashCrossDomainMessagev1(
resolved.messageNonce,
resolved.sender,
resolved.target,
resolved.value,
resolved.minGasLimit,
resolved.message
)
// Here we want the messenger that will receive the message, not the one that sent it.
const messenger =
resolved.direction === MessageDirection.L1_TO_L2
? this.contracts.l2.L2CrossDomainMessenger
: this.contracts.l1.L1CrossDomainMessenger
const success =
(await messenger.successfulMessages(messageHashV0)) ||
(await messenger.successfulMessages(messageHashV1))
// Avoid the extra query if we already know the message was successful.
if (success) {
return MessageStatus.RELAYED
}
const failure =
(await messenger.failedMessages(messageHashV0)) ||
(await messenger.failedMessages(messageHashV1))
if (resolved.direction === MessageDirection.L1_TO_L2) {
if (failure) {
return MessageStatus.FAILED_L1_TO_L2_MESSAGE
} else {
return MessageStatus.UNCONFIRMED_L1_TO_L2_MESSAGE
}
} else {
if (failure) {
return MessageStatus.READY_FOR_RELAY
} else {
let timestamp: number
if (this.bedrock) {
const output = await this.getMessageBedrockOutput(
resolved,
messageIndex
)
if (output === null) {
return MessageStatus.STATE_ROOT_NOT_PUBLISHED
}
// Convert the message to the low level message that was proven.
const withdrawal = await this.toLowLevelMessage(
resolved,
messageIndex
)
// Attempt to fetch the proven withdrawal.
const provenWithdrawal = await this.getProvenWithdrawal(
hashLowLevelMessage(withdrawal)
)
// If the withdrawal hash has not been proven on L1, return READY_TO_PROVE.
// Note that this will also apply in the case that a withdrawal has been proven but the
// proposal used to create the proof was invalidated. This is fine because in that case
// the withdrawal needs to be proven again anyway.
if (provenWithdrawal === null) {
return MessageStatus.READY_TO_PROVE
}
// Set the timestamp to the provenWithdrawal's timestamp
timestamp = provenWithdrawal.timestamp.toNumber()
} else {
const stateRoot = await this.getMessageStateRoot(
resolved,
messageIndex
)
if (stateRoot === null) {
return MessageStatus.STATE_ROOT_NOT_PUBLISHED
}
const bn = stateRoot.batch.blockNumber
const block = await this.l1Provider.getBlock(bn)
timestamp = block.timestamp
}
if (await this.fpac()) {
// Convert the message to the low level message that was proven.
const withdrawal = await this.toLowLevelMessage(
resolved,
messageIndex
)
// Get the withdrawal hash.
const withdrawalHash = hashLowLevelMessage(withdrawal)
// Grab the proven withdrawal data.
const provenWithdrawal = await this.getProvenWithdrawal(
withdrawalHash
)
// Sanity check, should've already happened above but do it just in case.
if (provenWithdrawal === null) {
// Ready to prove is the correct status here, we would not expect to hit this code path
// unless there was an unexpected reorg on L1. Since this is unlikely we log a warning.
console.warn(
'Unexpected code path reached in getMessageStatus, returning READY_TO_PROVE'
)
return MessageStatus.READY_TO_PROVE
}
// Shouldn't happen, but worth checking just in case.
if (!('proofSubmitter' in provenWithdrawal)) {
throw new Error(
`expected to get FPAC withdrawal but got legacy withdrawal`
)
}
try {
// If this doesn't revert then we should be fine to relay.
await this.contracts.l1.OptimismPortal2.checkWithdrawal(
hashLowLevelMessage(withdrawal),
provenWithdrawal.proofSubmitter
)
return MessageStatus.READY_FOR_RELAY
} catch (err) {
return MessageStatus.IN_CHALLENGE_PERIOD
}
} else {
const challengePeriod = await this.getChallengePeriodSeconds()
const latestBlock = await this.l1Provider.getBlock('latest')
if (timestamp + challengePeriod > latestBlock.timestamp) {
return MessageStatus.IN_CHALLENGE_PERIOD
} else {
return MessageStatus.READY_FOR_RELAY
}
}
}
}
}
/**
* Finds the receipt of the transaction that executed a particular cross chain message.
*
* @param message Message to find the receipt of.
* @param messageIndex The index of the message, if multiple exist from multicall
* @param fromBlockOrBlockHash The start block to use for the query filter on the RECEIVING chain
* @param toBlockOrBlockHash The end block to use for the query filter on the RECEIVING chain
* @returns CrossChainMessage receipt including receipt of the transaction that relayed the
* given message.
*/
public async getMessageReceipt(
message: MessageLike,
messageIndex = 0,
fromBlockOrBlockHash?: BlockTag,
toBlockOrHash?: BlockTag
): Promise<MessageReceipt> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
// legacy withdrawals relayed prebedrock are v1
const messageHashV0 = hashCrossDomainMessagev0(
resolved.target,
resolved.sender,
resolved.message,
resolved.messageNonce
)
// bedrock withdrawals are v1
// legacy withdrawals relayed postbedrock are v1
// there is no good way to differentiate between the two types of legacy
// so what we will check for both
const messageHashV1 = hashCrossDomainMessagev1(
resolved.messageNonce,
resolved.sender,
resolved.target,
resolved.value,
resolved.minGasLimit,
resolved.message
)
// Here we want the messenger that will receive the message, not the one that sent it.
const messenger =
resolved.direction === MessageDirection.L1_TO_L2
? this.contracts.l2.L2CrossDomainMessenger
: this.contracts.l1.L1CrossDomainMessenger
// this is safe because we can guarantee only one of these filters max will return something
const relayedMessageEvents = [
...(await messenger.queryFilter(
messenger.filters.RelayedMessage(messageHashV0),
fromBlockOrBlockHash,
toBlockOrHash
)),
...(await messenger.queryFilter(
messenger.filters.RelayedMessage(messageHashV1),
fromBlockOrBlockHash,
toBlockOrHash
)),
]
// Great, we found the message. Convert it into a transaction receipt.
if (relayedMessageEvents.length === 1) {
return {
receiptStatus: MessageReceiptStatus.RELAYED_SUCCEEDED,
transactionReceipt:
await relayedMessageEvents[0].getTransactionReceipt(),
}
} else if (relayedMessageEvents.length > 1) {
// Should never happen!
throw new Error(`multiple successful relays for message`)
}
// We didn't find a transaction that relayed the message. We now attempt to find
// FailedRelayedMessage events instead.
const failedRelayedMessageEvents = [
...(await messenger.queryFilter(
messenger.filters.FailedRelayedMessage(messageHashV0),
fromBlockOrBlockHash,
toBlockOrHash
)),
...(await messenger.queryFilter(
messenger.filters.FailedRelayedMessage(messageHashV1),
fromBlockOrBlockHash,
toBlockOrHash
)),
]
// A transaction can fail to be relayed multiple times. We'll always return the last
// transaction that attempted to relay the message.
// TODO: Is this the best way to handle this?
if (failedRelayedMessageEvents.length > 0) {
return {
receiptStatus: MessageReceiptStatus.RELAYED_FAILED,
transactionReceipt: await failedRelayedMessageEvents[
failedRelayedMessageEvents.length - 1
].getTransactionReceipt(),
}
}
// TODO: If the user doesn't provide enough gas then there's a chance that FailedRelayedMessage
// will never be triggered. We should probably fix this at the contract level by requiring a
// minimum amount of input gas and designing the contracts such that the gas will always be
// enough to trigger the event. However, for now we need a temporary way to find L1 => L2
// transactions that fail but don't alert us because they didn't provide enough gas.
// TODO: Talk with the systems and protocol team about coordinating a hard fork that fixes this
// on both L1 and L2.
// Just return null if we didn't find a receipt. Slightly nicer than throwing an error.
return null
}
/**
* Waits for a message to be executed and returns the receipt of the transaction that executed
* the given message.
*
* @param message Message to wait for.
* @param opts Options to pass to the waiting function.
* @param opts.confirmations Number of transaction confirmations to wait for before returning.
* @param opts.pollIntervalMs Number of milliseconds to wait between polling for the receipt.
* @param opts.timeoutMs Milliseconds to wait before timing out.
* @param opts.fromBlockOrBlockHash The start block to use for the query filter on the RECEIVING chain
* @param opts.toBlockOrBlockHash The end block to use for the query filter on the RECEIVING chain
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns CrossChainMessage receipt including receipt of the transaction that relayed the
* given message.
*/
public async waitForMessageReceipt(
message: MessageLike,
opts: {
fromBlockOrBlockHash?: BlockTag
toBlockOrHash?: BlockTag
confirmations?: number
pollIntervalMs?: number
timeoutMs?: number
} = {},
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex = 0
): Promise<MessageReceipt> {
// Resolving once up-front is slightly more efficient.
const resolved = await this.toCrossChainMessage(message, messageIndex)
let totalTimeMs = 0
while (totalTimeMs < (opts.timeoutMs || Infinity)) {
const tick = Date.now()
const receipt = await this.getMessageReceipt(
resolved,
messageIndex,
opts.fromBlockOrBlockHash,
opts.toBlockOrHash
)
if (receipt !== null) {
return receipt
} else {
await sleep(opts.pollIntervalMs || 4000)
totalTimeMs += Date.now() - tick
}
}
throw new Error(`timed out waiting for message receipt`)
}
/**
* Waits until the status of a given message changes to the expected status. Note that if the
* status of the given message changes to a status that implies the expected status, this will
* still return. If the status of the message changes to a status that exclues the expected
* status, this will throw an error.
*
* @param message Message to wait for.
* @param status Expected status of the message.
* @param opts Options to pass to the waiting function.
* @param opts.pollIntervalMs Number of milliseconds to wait when polling.
* @param opts.timeoutMs Milliseconds to wait before timing out.
* @param opts.fromBlockOrBlockHash The start block to use for the query filter on the RECEIVING chain
* @param opts.toBlockOrBlockHash The end block to use for the query filter on the RECEIVING chain
* @param messageIndex The index of the message, if multiple exist from multicall
*/
public async waitForMessageStatus(
message: MessageLike,
status: MessageStatus,
opts: {
fromBlockOrBlockHash?: BlockTag
toBlockOrBlockHash?: BlockTag
pollIntervalMs?: number
timeoutMs?: number
} = {},
messageIndex = 0
): Promise<void> {
// Resolving once up-front is slightly more efficient.
const resolved = await this.toCrossChainMessage(message, messageIndex)
let totalTimeMs = 0
while (totalTimeMs < (opts.timeoutMs || Infinity)) {
const tick = Date.now()
const currentStatus = await this.getMessageStatus(
resolved,
messageIndex,
opts.fromBlockOrBlockHash,
opts.toBlockOrBlockHash
)
// Handle special cases for L1 to L2 messages.
if (resolved.direction === MessageDirection.L1_TO_L2) {
// If we're at the expected status, we're done.
if (currentStatus === status) {
return
}
if (
status === MessageStatus.UNCONFIRMED_L1_TO_L2_MESSAGE &&
currentStatus > status
) {
// Anything other than UNCONFIRMED_L1_TO_L2_MESSAGE implies that the message was at one
// point "unconfirmed", so we can stop waiting.
return
}
if (
status === MessageStatus.FAILED_L1_TO_L2_MESSAGE &&
currentStatus === MessageStatus.RELAYED
) {
throw new Error(
`incompatible message status, expected FAILED_L1_TO_L2_MESSAGE got RELAYED`
)
}
if (
status === MessageStatus.RELAYED &&
currentStatus === MessageStatus.FAILED_L1_TO_L2_MESSAGE
) {
throw new Error(
`incompatible message status, expected RELAYED got FAILED_L1_TO_L2_MESSAGE`
)
}
}
// Handle special cases for L2 to L1 messages.
if (resolved.direction === MessageDirection.L2_TO_L1) {
if (currentStatus >= status) {
// For L2 to L1 messages, anything after the expected status implies the previous status,
// so we can safely return if the current status enum is larger than the expected one.
return
}
}
await sleep(opts.pollIntervalMs || 4000)
totalTimeMs += Date.now() - tick
}
throw new Error(`timed out waiting for message status change`)
}
/**
* Estimates the amount of gas required to fully execute a given message on L2. Only applies to
* L1 => L2 messages. You would supply this gas limit when sending the message to L2.
*
* @param message Message get a gas estimate for.
* @param opts Options object.
* @param opts.bufferPercent Percentage of gas to add to the estimate. Defaults to 20.
* @param opts.from Address to use as the sender.
* @returns Estimates L2 gas limit.
*/
public async estimateL2MessageGasLimit(
message: MessageRequestLike,
opts?: {
bufferPercent?: number
from?: string
},
messageIndex = 0
): Promise<BigNumber> {
let resolved: CrossChainMessage | CrossChainMessageRequest
let from: string
if ((message as CrossChainMessage).messageNonce === undefined) {
resolved = message as CrossChainMessageRequest
from = opts?.from
} else {
resolved = await this.toCrossChainMessage(
message as MessageLike,
messageIndex
)
from = opts?.from || (resolved as CrossChainMessage).sender
}
// L2 message gas estimation is only used for L1 => L2 messages.
if (resolved.direction === MessageDirection.L2_TO_L1) {
throw new Error(`cannot estimate gas limit for L2 => L1 message`)
}
const estimate = await this.l2Provider.estimateGas({
from,
to: resolved.target,
data: resolved.message,
})
// Return the estimate plus a buffer of 20% just in case.
const bufferPercent = opts?.bufferPercent || 20
return estimate.mul(100 + bufferPercent).div(100)
}
/**
* Returns the estimated amount of time before the message can be executed. When this is a
* message being sent to L1, this will return the estimated time until the message will complete
* its challenge period. When this is a message being sent to L2, this will return the estimated
* amount of time until the message will be picked up and executed on L2.
*
* @param message Message to estimate the time remaining for.
* @param messageIndex The index of the message, if multiple exist from multicall
* @param opts.fromBlockOrBlockHash The start block to use for the query filter on the RECEIVING chain
* @param opts.toBlockOrBlockHash The end block to use for the query filter on the RECEIVING chain
* @returns Estimated amount of time remaining (in seconds) before the message can be executed.
*/
public async estimateMessageWaitTimeSeconds(
message: MessageLike,
// consider making this an options object next breaking release
messageIndex = 0,
fromBlockOrBlockHash?: BlockTag,
toBlockOrBlockHash?: BlockTag
): Promise<number> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
const status = await this.getMessageStatus(
resolved,
messageIndex,
fromBlockOrBlockHash,
toBlockOrBlockHash
)
if (resolved.direction === MessageDirection.L1_TO_L2) {
if (
status === MessageStatus.RELAYED ||
status === MessageStatus.FAILED_L1_TO_L2_MESSAGE
) {
// Transactions that are relayed or failed are considered completed, so the wait time is 0.
return 0
} else {
// Otherwise we need to estimate the number of blocks left until the transaction will be
// considered confirmed by the Layer 2 system. Then we multiply this by the estimated
// average L1 block time.
const receipt = await this.l1Provider.getTransactionReceipt(
resolved.transactionHash
)
const blocksLeft = Math.max(
this.depositConfirmationBlocks - receipt.confirmations,
0
)
return blocksLeft * this.l1BlockTimeSeconds
}
} else {
if (
status === MessageStatus.RELAYED ||
status === MessageStatus.READY_FOR_RELAY
) {
// Transactions that are relayed or ready for relay are considered complete.
return 0
} else if (status === MessageStatus.STATE_ROOT_NOT_PUBLISHED) {
// If the state root hasn't been published yet, just assume it'll be published relatively
// quickly and return the challenge period for now. In the future we could use more
// advanced techniques to figure out average time between transaction execution and
// state root publication.
return this.getChallengePeriodSeconds()
} else if (status === MessageStatus.IN_CHALLENGE_PERIOD) {
// If the message is still within the challenge period, then we need to estimate exactly
// the amount of time left until the challenge period expires. The challenge period starts
// when the state root is published.
const stateRoot = await this.getMessageStateRoot(resolved, messageIndex)
const challengePeriod = await this.getChallengePeriodSeconds()
const targetBlock = await this.l1Provider.getBlock(
stateRoot.batch.blockNumber
)
const latestBlock = await this.l1Provider.getBlock('latest')
return Math.max(
challengePeriod - (latestBlock.timestamp - targetBlock.timestamp),
0
)
} else {
// Should not happen
throw new Error(`unexpected message status`)
}
}
}
/**
* Queries the current challenge period in seconds from the StateCommitmentChain.
*
* @returns Current challenge period in seconds.
*/
public async getChallengePeriodSeconds(): Promise<number> {
if (!this.bedrock) {
return (
await this.contracts.l1.StateCommitmentChain.FRAUD_PROOF_WINDOW()
).toNumber()
}
const oracleVersion = await this.contracts.l1.L2OutputOracle.version()
const challengePeriod =
oracleVersion === '1.0.0'
? // The ABI in the SDK does not contain FINALIZATION_PERIOD_SECONDS
// in OptimismPortal, so making an explicit call instead.
BigNumber.from(
await this.contracts.l1.OptimismPortal.provider.call({
to: this.contracts.l1.OptimismPortal.address,
data: '0xf4daa291', // FINALIZATION_PERIOD_SECONDS
})
)
: await this.contracts.l1.L2OutputOracle.FINALIZATION_PERIOD_SECONDS()
return challengePeriod.toNumber()
}
/**
* Queries the OptimismPortal contract's `provenWithdrawals` mapping
* for a ProvenWithdrawal that matches the passed withdrawalHash
*
* @bedrock
* Note: This function is bedrock-specific.
*
* @returns A ProvenWithdrawal object
*/
public async getProvenWithdrawal(
withdrawalHash: string
): Promise<ProvenWithdrawal | null> {
if (!this.bedrock) {
throw new Error('message proving only applies after the bedrock upgrade')
}
// Getting the withdrawal is easy before FPAC.
if (!(await this.fpac())) {
// Grab the proven withdrawal directly by hash.
const provenWithdrawal =
await this.contracts.l1.OptimismPortal.provenWithdrawals(withdrawalHash)
// If the timestamp is 0 then the withdrawal has not been proven.
if (provenWithdrawal.timestamp.eq(0)) {
return null
} else {
return provenWithdrawal
}
}
// Getting the withdrawal is a bit more complicated after FPAC.
// First we need to get the number of proof submitters for this withdrawal.
const numProofSubmitters = BigNumber.from(
await this.contracts.l1.OptimismPortal2.numProofSubmitters(withdrawalHash)
).toNumber()
// Now we need to find any withdrawal where the output proposal that the withdrawal was proven
// against is actually valid. We can use the same output validation cache used elsewhere.
for (let i = 0; i < numProofSubmitters; i++) {
// Grab the proof submitter.
const proofSubmitter =
await this.contracts.l1.OptimismPortal2.proofSubmitters(
withdrawalHash,
i
)
// Grab the ProvenWithdrawal struct for this proof.
const provenWithdrawal =
await this.contracts.l1.OptimismPortal2.provenWithdrawals(
withdrawalHash,
proofSubmitter
)
// Grab the game that was proven against.
const game = new ethers.Contract(
provenWithdrawal.disputeGameProxy,
getContractInterfaceBedrock('FaultDisputeGame'),
this.l1SignerOrProvider
)
// Check the game status.
const status = await game.status()
if (status === 1) {
// If status is CHALLENGER_WINS then it's no good.
continue
} else if (status === 2) {
// If status is DEFENDER_WINS then it's a valid proof.
return {
...provenWithdrawal,
proofSubmitter,
}
} else if (status > 2) {
// Shouldn't happen in practice.
throw new Error('got invalid game status')
}
// Otherwise we're IN_PROGRESS.
// Grab the block number from the extra data. Since this is not a standardized field we need
// to be defensive and assume that the extra data could be anything. If the extra data does
// not decode properly then we just skip this game.
const extraData = await game.extraData()
let l2BlockNumber: number
try {
;[l2BlockNumber] = ethers.utils.defaultAbiCoder.decode(
['uint256'],
extraData
)
} catch (err) {
// Didn't decode properly, bad game.
continue
}
// Finally we check if the output root is valid. If it is, then we can return the proven
// withdrawal. If it isn't, then we act as if this proof does not exist because it isn't
// useful for finalizing the withdrawal.
if (await this.isValidOutputRoot(await game.rootClaim(), l2BlockNumber)) {
return {
...provenWithdrawal,
proofSubmitter,
}
}
}
// Return null if we didn't find a valid proof.
return null
}
/**
* Checks whether a given root claim is valid. Uses the L2 node that the SDK is connected to
* when verifying the claim. Assumes that the connected L2 node is honest.
*
* @param outputRoot Output root to verify.
* @param l2BlockNumber L2 block number the root is for.
* @returns Whether or not the root is valid.
*/
public async isValidOutputRoot(
outputRoot: string,
l2BlockNumber: number
): Promise<boolean> {
// Use the cache if we can.
const cached = this._outputCache.find((other) => {
return other.root === outputRoot
})
// Skip if we can use the cached.
if (cached) {
return cached.valid
}
// If the cache ever gets to 10k elements, clear out the first half. Works well enough
// since the cache will generally tend to be used in a FIFO manner.
if (this._outputCache.length > 10000) {
this._outputCache = this._outputCache.slice(5000)
}
// We didn't hit the cache so we're going to have to do the work.
try {
// Make sure this is a JSON RPC provider.
const provider = toJsonRpcProvider(this.l2Provider)
// Grab the block and storage proof at the same time.
const [block, proof] = await Promise.all([
provider.send('eth_getBlockByNumber', [
toRpcHexString(l2BlockNumber),
false,
]),
makeStateTrieProof(
provider,
l2BlockNumber,
this.contracts.l2.OVM_L2ToL1MessagePasser.address,
ethers.constants.HashZero
),
])
// Compute the output.
const output = ethers.utils.solidityKeccak256(
['bytes32', 'bytes32', 'bytes32', 'bytes32'],
[
ethers.constants.HashZero,
block.stateRoot,
proof.storageRoot,
block.hash,
]
)
// If the output matches the proposal then we're good.
const valid = output === outputRoot
this._outputCache.push({ root: outputRoot, valid })
return valid
} catch (err) {
// Assume the game is invalid but don't add it to the cache just in case we had a temp error.
return false
}
}
/**
* Returns the Bedrock output root that corresponds to the given message.
*
* @param message Message to get the Bedrock output root for.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Bedrock output root.
*/
public async getMessageBedrockOutput(
message: MessageLike,
messageIndex = 0
): Promise<BedrockOutputData | null> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
// Outputs are only a thing for L2 to L1 messages.
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`cannot get a state root for an L1 to L2 message`)
}
let proposal: any
let l2OutputIndex: BigNumber
if (await this.fpac()) {
// Get the respected game type from the portal.
const gameType =
await this.contracts.l1.OptimismPortal2.respectedGameType()
// Get the total game count from the DisputeGameFactory since that will give us the end of
// the array that we're searching over. We'll then use that to find the latest games.
const gameCount = await this.contracts.l1.DisputeGameFactory.gameCount()
// Find the latest 100 games (or as many as we can up to 100).
const latestGames =
await this.contracts.l1.DisputeGameFactory.findLatestGames(
gameType,
Math.max(0, gameCount.sub(1).toNumber()),
Math.min(100, gameCount.toNumber())
)
// Find all games that are for proposals about blocks newer than the message block.
const matches: any[] = []
for (const game of latestGames) {
try {
const [blockNumber] = ethers.utils.defaultAbiCoder.decode(
['uint256'],
game.extraData
)
if (blockNumber.gte(resolved.blockNumber)) {
matches.push({
...game,
l2BlockNumber: blockNumber,
})
}
} catch (err) {
// If we can't decode the extra data then we just skip this game.
continue
}
}
// Shuffle the list of matches. We shuffle here to avoid potential DoS vectors where the
// latest games are all invalid and the SDK would be forced to make a bunch of archive calls.
for (let i = matches.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1))
;[matches[i], matches[j]] = [matches[j], matches[i]]
}
// Now we verify the proposals in the matches array.
let match: any
for (const option of matches) {
if (
await this.isValidOutputRoot(option.rootClaim, option.l2BlockNumber)
) {
match = option
break
}
}
// If there's no match then we can't prove the message to the portal.
if (!match) {
return null
}
// Put the result into the same format as the old logic for now to reduce added code.
l2OutputIndex = match.index
proposal = {
outputRoot: match.rootClaim,
timestamp: match.timestamp,
l2BlockNumber: match.l2BlockNumber,
}
} else {
// Try to find the output index that corresponds to the block number attached to the message.
// We'll explicitly handle "cannot get output" errors as a null return value, but anything else
// needs to get thrown. Might need to revisit this in the future to be a little more robust
// when connected to RPCs that don't return nice error messages.
try {
l2OutputIndex =
await this.contracts.l1.L2OutputOracle.getL2OutputIndexAfter(
resolved.blockNumber
)
} catch (err) {
if (err.message.includes('L2OutputOracle: cannot get output')) {
return null
} else {
throw err
}
}
// Now pull the proposal out given the output index. Should always work as long as the above
// codepath completed successfully.
proposal = await this.contracts.l1.L2OutputOracle.getL2Output(
l2OutputIndex
)
}
// Format everything and return it nicely.
return {
outputRoot: proposal.outputRoot,
l1Timestamp: proposal.timestamp.toNumber(),
l2BlockNumber: proposal.l2BlockNumber.toNumber(),
l2OutputIndex: l2OutputIndex.toNumber(),
}
}
/**
* Returns the state root that corresponds to a given message. This is the state root for the
* block in which the transaction was included, as published to the StateCommitmentChain. If the
* state root for the given message has not been published yet, this function returns null.
*
* @param message Message to find a state root for.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns State root for the block in which the message was created.
*/
public async getMessageStateRoot(
message: MessageLike,
messageIndex = 0
): Promise<StateRoot | null> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
// State roots are only a thing for L2 to L1 messages.
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`cannot get a state root for an L1 to L2 message`)
}
// We need the block number of the transaction that triggered the message so we can look up the
// state root batch that corresponds to that block number.
const messageTxReceipt = await this.l2Provider.getTransactionReceipt(
resolved.transactionHash
)
// Every block has exactly one transaction in it. Since there's a genesis block, the
// transaction index will always be one less than the block number.
const messageTxIndex = messageTxReceipt.blockNumber - 1
// Pull down the state root batch, we'll try to pick out the specific state root that
// corresponds to our message.
const stateRootBatch = await this.getStateRootBatchByTransactionIndex(
messageTxIndex
)
// No state root batch, no state root.
if (stateRootBatch === null) {
return null
}
// We have a state root batch, now we need to find the specific state root for our transaction.
// First we need to figure out the index of the state root within the batch we found. This is
// going to be the original transaction index offset by the total number of previous state
// roots.
const indexInBatch =
messageTxIndex - stateRootBatch.header.prevTotalElements.toNumber()
// Just a sanity check.
if (stateRootBatch.stateRoots.length <= indexInBatch) {
// Should never happen!
throw new Error(`state root does not exist in batch`)
}
return {
stateRoot: stateRootBatch.stateRoots[indexInBatch],
stateRootIndexInBatch: indexInBatch,
batch: stateRootBatch,
}
}
/**
* Returns the StateBatchAppended event that was emitted when the batch with a given index was
* created. Returns null if no such event exists (the batch has not been submitted).
*
* @param batchIndex Index of the batch to find an event for.
* @returns StateBatchAppended event for the batch, or null if no such batch exists.
*/
public async getStateBatchAppendedEventByBatchIndex(
batchIndex: number
): Promise<ethers.Event | null> {
const events = await this.contracts.l1.StateCommitmentChain.queryFilter(
this.contracts.l1.StateCommitmentChain.filters.StateBatchAppended(
batchIndex
)
)
if (events.length === 0) {
return null
} else if (events.length > 1) {
// Should never happen!
throw new Error(`found more than one StateBatchAppended event`)
} else {
return events[0]
}
}
/**
* Returns the StateBatchAppended event for the batch that includes the transaction with the
* given index. Returns null if no such event exists.
*
* @param transactionIndex Index of the L2 transaction to find an event for.
* @returns StateBatchAppended event for the batch that includes the given transaction by index.
*/
public async getStateBatchAppendedEventByTransactionIndex(
transactionIndex: number
): Promise<ethers.Event | null> {
const isEventHi = (event: ethers.Event, index: number) => {
const prevTotalElements = event.args._prevTotalElements.toNumber()
return index < prevTotalElements
}
const isEventLo = (event: ethers.Event, index: number) => {
const prevTotalElements = event.args._prevTotalElements.toNumber()
const batchSize = event.args._batchSize.toNumber()
return index >= prevTotalElements + batchSize
}
const totalBatches: ethers.BigNumber =
await this.contracts.l1.StateCommitmentChain.getTotalBatches()
if (totalBatches.eq(0)) {
return null
}
let lowerBound = 0
let upperBound = totalBatches.toNumber() - 1
let batchEvent: ethers.Event | null =
await this.getStateBatchAppendedEventByBatchIndex(upperBound)
// Only happens when no batches have been submitted yet.
if (batchEvent === null) {
return null
}
if (isEventLo(batchEvent, transactionIndex)) {
// Upper bound is too low, means this transaction doesn't have a corresponding state batch yet.
return null
} else if (!isEventHi(batchEvent, transactionIndex)) {
// Upper bound is not too low and also not too high. This means the upper bound event is the
// one we're looking for! Return it.
return batchEvent
}
// Binary search to find the right event. The above checks will guarantee that the event does
// exist and that we'll find it during this search.
while (lowerBound < upperBound) {
const middleOfBounds = Math.floor((lowerBound + upperBound) / 2)
batchEvent = await this.getStateBatchAppendedEventByBatchIndex(
middleOfBounds
)
if (isEventHi(batchEvent, transactionIndex)) {
upperBound = middleOfBounds
} else if (isEventLo(batchEvent, transactionIndex)) {
lowerBound = middleOfBounds
} else {
break
}
}
return batchEvent
}
/**
* Returns information about the state root batch that included the state root for the given
* transaction by index. Returns null if no such state root has been published yet.
*
* @param transactionIndex Index of the L2 transaction to find a state root batch for.
* @returns State root batch for the given transaction index, or null if none exists yet.
*/
public async getStateRootBatchByTransactionIndex(
transactionIndex: number
): Promise<StateRootBatch | null> {
const stateBatchAppendedEvent =
await this.getStateBatchAppendedEventByTransactionIndex(transactionIndex)
if (stateBatchAppendedEvent === null) {
return null
}
const stateBatchTransaction = await stateBatchAppendedEvent.getTransaction()
const [stateRoots] =
this.contracts.l1.StateCommitmentChain.interface.decodeFunctionData(
'appendStateBatch',
stateBatchTransaction.data
)
return {
blockNumber: stateBatchAppendedEvent.blockNumber,
stateRoots,
header: {
batchIndex: stateBatchAppendedEvent.args._batchIndex,
batchRoot: stateBatchAppendedEvent.args._batchRoot,
batchSize: stateBatchAppendedEvent.args._batchSize,
prevTotalElements: stateBatchAppendedEvent.args._prevTotalElements,
extraData: stateBatchAppendedEvent.args._extraData,
},
}
}
/**
* Generates the proof required to finalize an L2 to L1 message.
*
* @param message Message to generate a proof for.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Proof that can be used to finalize the message.
*/
public async getMessageProof(
message: MessageLike,
messageIndex = 0
): Promise<CrossChainMessageProof> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`can only generate proofs for L2 to L1 messages`)
}
const stateRoot = await this.getMessageStateRoot(resolved, messageIndex)
if (stateRoot === null) {
throw new Error(`state root for message not yet published`)
}
// We need to calculate the specific storage slot that demonstrates that this message was
// actually included in the L2 chain. The following calculation is based on the fact that
// messages are stored in the following mapping on L2:
// https://github.com/ethereum-optimism/optimism/blob/c84d3450225306abbb39b4e7d6d82424341df2be/packages/contracts/contracts/L2/predeploys/OVM_L2ToL1MessagePasser.sol#L23
// You can read more about how Solidity storage slots are computed for mappings here:
// https://docs.soliditylang.org/en/v0.8.4/internals/layout_in_storage.html#mappings-and-dynamic-arrays
const messageSlot = ethers.utils.keccak256(
ethers.utils.keccak256(
encodeCrossDomainMessageV0(
resolved.target,
resolved.sender,
resolved.message,
resolved.messageNonce
) + remove0x(this.contracts.l2.L2CrossDomainMessenger.address)
) + '00'.repeat(32)
)
const stateTrieProof = await makeStateTrieProof(
toJsonRpcProvider(this.l2Provider),
resolved.blockNumber,
this.contracts.l2.OVM_L2ToL1MessagePasser.address,
messageSlot
)
return {
stateRoot: stateRoot.stateRoot,
stateRootBatchHeader: stateRoot.batch.header,
stateRootProof: {
index: stateRoot.stateRootIndexInBatch,
siblings: makeMerkleTreeProof(
stateRoot.batch.stateRoots,
stateRoot.stateRootIndexInBatch
),
},
stateTrieWitness: toHexString(rlp.encode(stateTrieProof.accountProof)),
storageTrieWitness: toHexString(rlp.encode(stateTrieProof.storageProof)),
}
}
/**
* Generates the bedrock proof required to finalize an L2 to L1 message.
*
* @param message Message to generate a proof for.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Proof that can be used to finalize the message.
*/
public async getBedrockMessageProof(
message: MessageLike,
messageIndex = 0
): Promise<BedrockCrossChainMessageProof> {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`can only generate proofs for L2 to L1 messages`)
}
const output = await this.getMessageBedrockOutput(resolved, messageIndex)
if (output === null) {
throw new Error(`state root for message not yet published`)
}
const withdrawal = await this.toLowLevelMessage(resolved, messageIndex)
const hash = hashLowLevelMessage(withdrawal)
const messageSlot = hashMessageHash(hash)
const provider = toJsonRpcProvider(this.l2Provider)
const stateTrieProof = await makeStateTrieProof(
provider,
output.l2BlockNumber,
this.contracts.l2.BedrockMessagePasser.address,
messageSlot
)
const block = await provider.send('eth_getBlockByNumber', [
toRpcHexString(output.l2BlockNumber),
false,
])
return {
outputRootProof: {
version: ethers.constants.HashZero,
stateRoot: block.stateRoot,
messagePasserStorageRoot: stateTrieProof.storageRoot,
latestBlockhash: block.hash,
},
withdrawalProof: stateTrieProof.storageProof,
l2OutputIndex: output.l2OutputIndex,
}
}
/**
* Sends a given cross chain message. Where the message is sent depends on the direction attached
* to the message itself.
*
* @param message Cross chain message to send.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the message sending transaction.
*/
public async sendMessage(
message: CrossChainMessageRequest,
opts?: {
signer?: Signer
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionResponse> {
const tx = await this.populateTransaction.sendMessage(message, opts)
if (message.direction === MessageDirection.L1_TO_L2) {
return (opts?.signer || this.l1Signer).sendTransaction(tx)
} else {
return (opts?.signer || this.l2Signer).sendTransaction(tx)
}
}
/**
* Resends a given cross chain message with a different gas limit. Only applies to L1 to L2
* messages. If provided an L2 to L1 message, this function will throw an error.
*
* @param message Cross chain message to resend.
* @param messageGasLimit New gas limit to use for the message.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the message resending transaction.
*/
public async resendMessage(
message: MessageLike,
messageGasLimit: NumberLike,
opts?: {
signer?: Signer
overrides?: Overrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.resendMessage(
message,
messageGasLimit,
opts
)
)
}
/**
* Proves a cross chain message that was sent from L2 to L1. Only applicable for L2 to L1
* messages.
*
* @param message Message to finalize.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the finalization transaction.
*/
public async proveMessage(
message: MessageLike,
opts?: {
signer?: Signer
overrides?: Overrides
},
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex: number = 0
): Promise<TransactionResponse> {
const tx = await this.populateTransaction.proveMessage(
message,
opts,
messageIndex
)
return (opts?.signer || this.l1Signer).sendTransaction(tx)
}
/**
* Finalizes a cross chain message that was sent from L2 to L1. Only applicable for L2 to L1
* messages. Will throw an error if the message has not completed its challenge period yet.
*
* @param message Message to finalize.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.overrides Optional transaction overrides.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Transaction response for the finalization transaction.
*/
public async finalizeMessage(
message: MessageLike,
opts?: {
signer?: Signer
overrides?: PayableOverrides
},
messageIndex = 0
): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.finalizeMessage(
message,
opts,
messageIndex
)
)
}
/**
* Deposits some ETH into the L2 chain.
*
* @param amount Amount of ETH to deposit (in wei).
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the deposit transaction.
*/
public async depositETH(
amount: NumberLike,
opts?: {
recipient?: AddressLike
signer?: Signer
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.depositETH(amount, opts)
)
}
/**
* Withdraws some ETH back to the L1 chain.
*
* @param amount Amount of ETH to withdraw.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the withdraw transaction.
*/
public async withdrawETH(
amount: NumberLike,
opts?: {
recipient?: AddressLike
signer?: Signer
overrides?: Overrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l2Signer).sendTransaction(
await this.populateTransaction.withdrawETH(amount, opts)
)
}
/**
* Queries the account's approval amount for a given L1 token.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param opts Additional options.
* @param opts.signer Optional signer to get the approval for.
* @returns Amount of tokens approved for deposits from the account.
*/
public async approval(
l1Token: AddressLike,
l2Token: AddressLike,
opts?: {
signer?: Signer
}
): Promise<BigNumber> {
const bridge = await this.getBridgeForTokenPair(l1Token, l2Token)
return bridge.approval(l1Token, l2Token, opts?.signer || this.l1Signer)
}
/**
* Approves a deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the approval transaction.
*/
public async approveERC20(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
signer?: Signer
overrides?: Overrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.approveERC20(
l1Token,
l2Token,
amount,
opts
)
)
}
/**
* Deposits some ERC20 tokens into the L2 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to deposit.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the deposit transaction.
*/
public async depositERC20(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
signer?: Signer
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l1Signer).sendTransaction(
await this.populateTransaction.depositERC20(
l1Token,
l2Token,
amount,
opts
)
)
}
/**
* Withdraws some ERC20 tokens back to the L1 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to withdraw.
* @param opts Additional options.
* @param opts.signer Optional signer to use to send the transaction.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the withdraw transaction.
*/
public async withdrawERC20(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
signer?: Signer
overrides?: Overrides
}
): Promise<TransactionResponse> {
return (opts?.signer || this.l2Signer).sendTransaction(
await this.populateTransaction.withdrawERC20(
l1Token,
l2Token,
amount,
opts
)
)
}
/**
* Object that holds the functions that generate transactions to be signed by the user.
* Follows the pattern used by ethers.js.
*/
populateTransaction = {
/**
* Generates a transaction that sends a given cross chain message. This transaction can be signed
* and executed by a signer.
*
* @param message Cross chain message to send.
* @param opts Additional options.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to send the message.
*/
sendMessage: async (
message: CrossChainMessageRequest,
opts?: {
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
if (message.direction === MessageDirection.L1_TO_L2) {
return this.contracts.l1.L1CrossDomainMessenger.populateTransaction.sendMessage(
message.target,
message.message,
opts?.l2GasLimit || (await this.estimateL2MessageGasLimit(message)),
opts?.overrides || {}
)
} else {
return this.contracts.l2.L2CrossDomainMessenger.populateTransaction.sendMessage(
message.target,
message.message,
0, // Gas limit goes unused when sending from L2 to L1
opts?.overrides || {}
)
}
},
/**
* Generates a transaction that resends a given cross chain message. Only applies to L1 to L2
* messages. This transaction can be signed and executed by a signer.
*
* @param message Cross chain message to resend.
* @param messageGasLimit New gas limit to use for the message.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to resend the message.
*/
resendMessage: async (
message: MessageLike,
messageGasLimit: NumberLike,
opts?: {
overrides?: Overrides
},
/**
* The index of the withdrawal if multiple are made with multicall
*/
messageIndex = 0
): Promise<TransactionRequest> => {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L2_TO_L1) {
throw new Error(`cannot resend L2 to L1 message`)
}
if (this.bedrock) {
return this.populateTransaction.finalizeMessage(
resolved,
{
...(opts || {}),
overrides: {
...opts?.overrides,
gasLimit: messageGasLimit,
},
},
messageIndex
)
} else {
const legacyL1XDM = new ethers.Contract(
this.contracts.l1.L1CrossDomainMessenger.address,
getContractInterface('L1CrossDomainMessenger'),
this.l1SignerOrProvider
)
return legacyL1XDM.populateTransaction.replayMessage(
resolved.target,
resolved.sender,
resolved.message,
resolved.messageNonce,
resolved.minGasLimit,
messageGasLimit,
opts?.overrides || {}
)
}
},
/**
* Generates a message proving transaction that can be signed and executed. Only
* applicable for L2 to L1 messages.
*
* @param message Message to generate the proving transaction for.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Transaction that can be signed and executed to prove the message.
*/
proveMessage: async (
message: MessageLike,
opts?: {
overrides?: PayableOverrides
},
messageIndex = 0
): Promise<TransactionRequest> => {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error('cannot finalize L1 to L2 message')
}
if (!this.bedrock) {
throw new Error(
'message proving only applies after the bedrock upgrade'
)
}
const withdrawal = await this.toLowLevelMessage(resolved, messageIndex)
const proof = await this.getBedrockMessageProof(resolved, messageIndex)
const args = [
[
withdrawal.messageNonce,
withdrawal.sender,
withdrawal.target,
withdrawal.value,
withdrawal.minGasLimit,
withdrawal.message,
],
proof.l2OutputIndex,
[
proof.outputRootProof.version,
proof.outputRootProof.stateRoot,
proof.outputRootProof.messagePasserStorageRoot,
proof.outputRootProof.latestBlockhash,
],
proof.withdrawalProof,
opts?.overrides || {},
] as const
return this.contracts.l1.OptimismPortal.populateTransaction.proveWithdrawalTransaction(
...args
)
},
/**
* Generates a message finalization transaction that can be signed and executed. Only
* applicable for L2 to L1 messages. Will throw an error if the message has not completed
* its challenge period yet.
*
* @param message Message to generate the finalization transaction for.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Transaction that can be signed and executed to finalize the message.
*/
finalizeMessage: async (
message: MessageLike,
opts?: {
overrides?: PayableOverrides
},
messageIndex = 0
): Promise<TransactionRequest> => {
const resolved = await this.toCrossChainMessage(message, messageIndex)
if (resolved.direction === MessageDirection.L1_TO_L2) {
throw new Error(`cannot finalize L1 to L2 message`)
}
if (this.bedrock) {
// get everything we need to finalize
const messageHashV1 = hashCrossDomainMessagev1(
resolved.messageNonce,
resolved.sender,
resolved.target,
resolved.value,
resolved.minGasLimit,
resolved.message
)
// fetch the following
// 1. Whether it needs to be replayed because it failed
// 2. The withdrawal as a low level message
const [isFailed, withdrawal] = await Promise.allSettled([
this.contracts.l1.L1CrossDomainMessenger.failedMessages(
messageHashV1
),
this.toLowLevelMessage(resolved, messageIndex),
])
// handle errors
if (
isFailed.status === 'rejected' ||
withdrawal.status === 'rejected'
) {
const rejections = [isFailed, withdrawal]
.filter((p) => p.status === 'rejected')
.map((p: PromiseRejectedResult) => p.reason)
throw rejections.length > 1
? new AggregateError(rejections)
: rejections[0]
}
if (isFailed.value === true) {
const xdmWithdrawal =
this.contracts.l1.L1CrossDomainMessenger.interface.decodeFunctionData(
'relayMessage',
withdrawal.value.message
)
return this.contracts.l1.L1CrossDomainMessenger.populateTransaction.relayMessage(
xdmWithdrawal._nonce,
xdmWithdrawal._sender,
xdmWithdrawal._target,
xdmWithdrawal._value,
xdmWithdrawal._minGasLimit,
xdmWithdrawal._message,
opts?.overrides || {}
)
}
return this.contracts.l1.OptimismPortal.populateTransaction.finalizeWithdrawalTransaction(
[
withdrawal.value.messageNonce,
withdrawal.value.sender,
withdrawal.value.target,
withdrawal.value.value,
withdrawal.value.minGasLimit,
withdrawal.value.message,
],
opts?.overrides || {}
)
} else {
// L1CrossDomainMessenger relayMessage is the only method that isn't fully backwards
// compatible, so we need to use the legacy interface. When we fully upgrade to Bedrock we
// should be able to remove this code.
const proof = await this.getMessageProof(resolved, messageIndex)
const legacyL1XDM = new ethers.Contract(
this.contracts.l1.L1CrossDomainMessenger.address,
getContractInterface('L1CrossDomainMessenger'),
this.l1SignerOrProvider
)
return legacyL1XDM.populateTransaction.relayMessage(
resolved.target,
resolved.sender,
resolved.message,
resolved.messageNonce,
proof,
opts?.overrides || {}
)
}
},
/**
* Generates a transaction for depositing some ETH into the L2 chain.
*
* @param amount Amount of ETH to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to deposit the ETH.
*/
depositETH: async (
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: PayableOverrides
},
isEstimatingGas: boolean = false
): Promise<TransactionRequest> => {
const getOpts = async () => {
if (isEstimatingGas) {
return opts
}
const gasEstimation = await this.estimateGas.depositETH(amount, opts)
return {
...opts,
overrides: {
...opts?.overrides,
gasLimit: gasEstimation.add(gasEstimation.div(2)),
},
}
}
return this.bridges.ETH.populateTransaction.deposit(
ethers.constants.AddressZero,
predeploys.OVM_ETH,
amount,
await getOpts()
)
},
/**
* Generates a transaction for withdrawing some ETH back to the L1 chain.
*
* @param amount Amount of ETH to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to withdraw the ETH.
*/
withdrawETH: async (
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
return this.bridges.ETH.populateTransaction.withdraw(
ethers.constants.AddressZero,
predeploys.OVM_ETH,
amount,
opts
)
},
/**
* Generates a transaction for approving some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the approval transaction.
*/
approveERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: Overrides
}
): Promise<TransactionRequest> => {
const bridge = await this.getBridgeForTokenPair(l1Token, l2Token)
return bridge.populateTransaction.approve(l1Token, l2Token, amount, opts)
},
/**
* Generates a transaction for depositing some ERC20 tokens into the L2 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to deposit the tokens.
*/
depositERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: CallOverrides
},
isEstimatingGas: boolean = false
): Promise<TransactionRequest> => {
const bridge = await this.getBridgeForTokenPair(l1Token, l2Token)
// we need extra buffer for gas limit
const getOpts = async () => {
if (isEstimatingGas) {
return opts
}
// if we don't include the users address the estimation will fail from lack of allowance
if (!ethers.Signer.isSigner(this.l1SignerOrProvider)) {
throw new Error('unable to deposit without an l1 signer')
}
const from = (this.l1SignerOrProvider as Signer).getAddress()
const gasEstimation = await this.estimateGas.depositERC20(
l1Token,
l2Token,
amount,
{
...opts,
overrides: {
...opts?.overrides,
from: opts?.overrides?.from ?? from,
},
}
)
return {
...opts,
overrides: {
...opts?.overrides,
gasLimit: gasEstimation.add(gasEstimation.div(2)),
from: opts?.overrides?.from ?? from,
},
}
}
return bridge.populateTransaction.deposit(
l1Token,
l2Token,
amount,
await getOpts()
)
},
/**
* Generates a transaction for withdrawing some ERC20 tokens back to the L1 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to withdraw the tokens.
*/
withdrawERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionRequest> => {
const bridge = await this.getBridgeForTokenPair(l1Token, l2Token)
return bridge.populateTransaction.withdraw(l1Token, l2Token, amount, opts)
},
}
/**
* Object that holds the functions that estimates the gas required for a given transaction.
* Follows the pattern used by ethers.js.
*/
estimateGas = {
/**
* Estimates gas required to send a cross chain message.
*
* @param message Cross chain message to send.
* @param opts Additional options.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
sendMessage: async (
message: CrossChainMessageRequest,
opts?: {
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
const tx = await this.populateTransaction.sendMessage(message, opts)
if (message.direction === MessageDirection.L1_TO_L2) {
return this.l1Provider.estimateGas(tx)
} else {
return this.l2Provider.estimateGas(tx)
}
},
/**
* Estimates gas required to resend a cross chain message. Only applies to L1 to L2 messages.
*
* @param message Cross chain message to resend.
* @param messageGasLimit New gas limit to use for the message.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
resendMessage: async (
message: MessageLike,
messageGasLimit: NumberLike,
opts?: {
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.resendMessage(
message,
messageGasLimit,
opts
)
)
},
/**
* Estimates gas required to prove a cross chain message. Only applies to L2 to L1 messages.
*
* @param message Message to generate the proving transaction for.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Gas estimate for the transaction.
*/
proveMessage: async (
message: MessageLike,
opts?: {
overrides?: CallOverrides
},
messageIndex = 0
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.proveMessage(message, opts, messageIndex)
)
},
/**
* Estimates gas required to finalize a cross chain message. Only applies to L2 to L1 messages.
*
* @param message Message to generate the finalization transaction for.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @param messageIndex The index of the message, if multiple exist from multicall
* @returns Gas estimate for the transaction.
*/
finalizeMessage: async (
message: MessageLike,
opts?: {
overrides?: CallOverrides
},
messageIndex = 0
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.finalizeMessage(
message,
opts,
messageIndex
)
)
},
/**
* Estimates gas required to deposit some ETH into the L2 chain.
*
* @param amount Amount of ETH to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
depositETH: async (
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.depositETH(amount, opts, true)
)
},
/**
* Estimates gas required to withdraw some ETH back to the L1 chain.
*
* @param amount Amount of ETH to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
withdrawETH: async (
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l2Provider.estimateGas(
await this.populateTransaction.withdrawETH(amount, opts)
)
},
/**
* Estimates gas required to approve some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the approval transaction.
*/
approveERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.approveERC20(
l1Token,
l2Token,
amount,
opts
)
)
},
/**
* Estimates gas required to deposit some ERC20 tokens into the L2 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
depositERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l1Provider.estimateGas(
await this.populateTransaction.depositERC20(
l1Token,
l2Token,
amount,
opts,
true
)
)
},
/**
* Estimates gas required to withdraw some ERC20 tokens back to the L1 chain.
*
* @param l1Token Address of the L1 token.
* @param l2Token Address of the L2 token.
* @param amount Amount to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
withdrawERC20: async (
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: CallOverrides
}
): Promise<BigNumber> => {
return this.l2Provider.estimateGas(
await this.populateTransaction.withdrawERC20(
l1Token,
l2Token,
amount,
opts
)
)
},
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"abi":[{"type":"function","name":"DEPOSITOR_ACCOUNT","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"baseFeeScalar","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"basefee","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"batcherHash","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"blobBaseFee","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"blobBaseFeeScalar","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"hash","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"l1FeeOverhead","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"l1FeeScalar","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"number","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"sequenceNumber","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"setL1BlockValues","inputs":[{"name":"_number","type":"uint64","internalType":"uint64"},{"name":"_timestamp","type":"uint64","internalType":"uint64"},{"name":"_basefee","type":"uint256","internalType":"uint256"},{"name":"_hash","type":"bytes32","internalType":"bytes32"},{"name":"_sequenceNumber","type":"uint64","internalType":"uint64"},{"name":"_batcherHash","type":"bytes32","internalType":"bytes32"},{"name":"_l1FeeOverhead","type":"uint256","internalType":"uint256"},{"name":"_l1FeeScalar","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setL1BlockValuesEcotone","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"timestamp","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"}],"bytecode":{"object":"0x608060405234801561001057600080fd5b5061053e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80638381f58a11610097578063c598591811610066578063c598591814610229578063e591b28214610249578063e81b2c6d14610289578063f82061401461029257600080fd5b80638381f58a146101e35780638b239f73146101f75780639e8c496614610200578063b80777ea1461020957600080fd5b806354fd4d50116100d357806354fd4d50146101335780635cf249691461017c57806364ca23ef1461018557806368d5dca6146101b257600080fd5b8063015d8eb9146100fa57806309bd5a601461010f578063440a5e201461012b575b600080fd5b61010d61010836600461044c565b61029b565b005b61011860025481565b6040519081526020015b60405180910390f35b61010d6103da565b61016f6040518060400160405280600581526020017f312e322e3000000000000000000000000000000000000000000000000000000081525081565b60405161012291906104be565b61011860015481565b6003546101999067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610122565b6003546101ce9068010000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610122565b6000546101999067ffffffffffffffff1681565b61011860055481565b61011860065481565b6000546101999068010000000000000000900467ffffffffffffffff1681565b6003546101ce906c01000000000000000000000000900463ffffffff1681565b61026473deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b61011860045481565b61011860075481565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff98891668010000000000000000027fffffffffffffffffffffffffffffffff00000000000000000000000000000000909116998916999099179890981790975560019490945560029290925560038054919094167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009190911617909255600491909155600555600655565b3373deaddeaddeaddeaddeaddeaddeaddeaddead00011461040357633cc50b456000526004601cfd5b60043560801c60035560143560801c600055602435600155604435600755606435600255608435600455565b803567ffffffffffffffff8116811461044757600080fd5b919050565b600080600080600080600080610100898b03121561046957600080fd5b6104728961042f565b975061048060208a0161042f565b9650604089013595506060890135945061049c60808a0161042f565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600060208083528351808285015260005b818110156104eb578581018301518582016040015282016104cf565b818111156104fd576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a","sourceMap":"588:4256:145:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80638381f58a11610097578063c598591811610066578063c598591814610229578063e591b28214610249578063e81b2c6d14610289578063f82061401461029257600080fd5b80638381f58a146101e35780638b239f73146101f75780639e8c496614610200578063b80777ea1461020957600080fd5b806354fd4d50116100d357806354fd4d50146101335780635cf249691461017c57806364ca23ef1461018557806368d5dca6146101b257600080fd5b8063015d8eb9146100fa57806309bd5a601461010f578063440a5e201461012b575b600080fd5b61010d61010836600461044c565b61029b565b005b61011860025481565b6040519081526020015b60405180910390f35b61010d6103da565b61016f6040518060400160405280600581526020017f312e322e3000000000000000000000000000000000000000000000000000000081525081565b60405161012291906104be565b61011860015481565b6003546101999067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610122565b6003546101ce9068010000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610122565b6000546101999067ffffffffffffffff1681565b61011860055481565b61011860065481565b6000546101999068010000000000000000900467ffffffffffffffff1681565b6003546101ce906c01000000000000000000000000900463ffffffff1681565b61026473deaddeaddeaddeaddeaddeaddeaddeaddead000181565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610122565b61011860045481565b61011860075481565b3373deaddeaddeaddeaddeaddeaddeaddeaddead000114610342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f60448201527f756e742063616e20736574204c3120626c6f636b2076616c7565730000000000606482015260840160405180910390fd5b6000805467ffffffffffffffff98891668010000000000000000027fffffffffffffffffffffffffffffffff00000000000000000000000000000000909116998916999099179890981790975560019490945560029290925560038054919094167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000009190911617909255600491909155600555600655565b3373deaddeaddeaddeaddeaddeaddeaddeaddead00011461040357633cc50b456000526004601cfd5b60043560801c60035560143560801c600055602435600155604435600755606435600255608435600455565b803567ffffffffffffffff8116811461044757600080fd5b919050565b600080600080600080600080610100898b03121561046957600080fd5b6104728961042f565b975061048060208a0161042f565b9650604089013595506060890135945061049c60808a0161042f565b979a969950949793969560a0850135955060c08501359460e001359350915050565b600060208083528351808285015260005b818110156104eb578581018301518582016040015282016104cf565b818111156104fd576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a","sourceMap":"588:4256:145:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2494:660;;;;;;:::i;:::-;;:::i;:::-;;1071:19;;;;;;;;;1014:25:357;;;1002:2;987:18;1071:19:145;;;;;;;;3886:956;;;:::i;1961:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1001:22::-;;;;;;1156:28;;;;;;;;;;;;2067:18:357;2055:31;;;2037:50;;2025:2;2010:18;1156:28:145;1893:200:357;1298:31:145;;;;;;;;;;;;;;;2272:10:357;2260:23;;;2242:42;;2230:2;2215:18;1298:31:145;2098:192:357;840:20:145;;;;;;;;;1680:28;;;;;;1821:26;;;;;;931:23;;;;;;;;;;;;1438:27;;;;;;;;;;;;680:86;;724:42;680:86;;;;;2471:42:357;2459:55;;;2441:74;;2429:2;2414:18;680:86:145;2295:226:357;1539:26:145;;;;;;1899;;;;;;2494:660;2789:10;724:42;2789:31;2781:103;;;;;;;2728:2:357;2781:103:145;;;2710:21:357;2767:2;2747:18;;;2740:30;2806:34;2786:18;;;2779:62;2877:29;2857:18;;;2850:57;2924:19;;2781:103:145;;;;;;;;2895:6;:16;;;2921:22;;;;;;;;;2895:16;;;2921:22;;;;;;;;;;;2895:16;2953:18;;;;2981:4;:12;;;;3003:14;:32;;;;;;2895:16;3003:32;;;;;;;;3045:11;:26;;;;3081:13;:30;3121:11;:26;2494:660::o;3886:956::-;4036:8;4046:17;4029:233;;;4096:10;4090:4;4083:24;4194:4;4188;4181:18;4029:233;4453:1;4440:15;4435:3;4431:25;4410:19;4403:54;4566:2;4553:16;4548:3;4544:26;4531:11;4524:47;4618:2;4605:16;4591:12;4584:38;4684:2;4671:16;4653;4646:42;4743:3;4730:17;4719:9;4712:36;4810:3;4797:17;4779:16;4772:43;3886:956::o;14:171:357:-;81:20;;141:18;130:30;;120:41;;110:69;;175:1;172;165:12;110:69;14:171;;;:::o;190:673::-;309:6;317;325;333;341;349;357;365;418:3;406:9;397:7;393:23;389:33;386:53;;;435:1;432;425:12;386:53;458:28;476:9;458:28;:::i;:::-;448:38;;505:37;538:2;527:9;523:18;505:37;:::i;:::-;495:47;;589:2;578:9;574:18;561:32;551:42;;640:2;629:9;625:18;612:32;602:42;;663:38;696:3;685:9;681:19;663:38;:::i;:::-;190:673;;;;-1:-1:-1;190:673:357;;;;653:48;748:3;733:19;;720:33;;-1:-1:-1;800:3:357;785:19;;772:33;;852:3;837:19;824:33;;-1:-1:-1;190:673:357;-1:-1:-1;;190:673:357:o;1050:656::-;1162:4;1191:2;1220;1209:9;1202:21;1252:6;1246:13;1295:6;1290:2;1279:9;1275:18;1268:34;1320:1;1330:140;1344:6;1341:1;1338:13;1330:140;;;1439:14;;;1435:23;;1429:30;1405:17;;;1424:2;1401:26;1394:66;1359:10;;1330:140;;;1488:6;1485:1;1482:13;1479:91;;;1558:1;1553:2;1544:6;1533:9;1529:22;1525:31;1518:42;1479:91;-1:-1:-1;1622:2:357;1610:15;1627:66;1606:88;1591:104;;;;1697:2;1587:113;;1050:656;-1:-1:-1;;;1050:656:357:o","linkReferences":{}},"methodIdentifiers":{"DEPOSITOR_ACCOUNT()":"e591b282","baseFeeScalar()":"c5985918","basefee()":"5cf24969","batcherHash()":"e81b2c6d","blobBaseFee()":"f8206140","blobBaseFeeScalar()":"68d5dca6","hash()":"09bd5a60","l1FeeOverhead()":"8b239f73","l1FeeScalar()":"9e8c4966","number()":"8381f58a","sequenceNumber()":"64ca23ef","setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256)":"015d8eb9","setL1BlockValuesEcotone()":"440a5e20","timestamp()":"b80777ea","version()":"54fd4d50"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"DEPOSITOR_ACCOUNT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseFeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"basefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batcherHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blobBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blobBaseFeeScalar\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1FeeOverhead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1FeeScalar\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"number\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequenceNumber\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_number\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"_timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_sequenceNumber\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"_batcherHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l1FeeOverhead\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l1FeeScalar\",\"type\":\"uint256\"}],\"name\":\"setL1BlockValues\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"setL1BlockValuesEcotone\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"custom:proxied\":\"@custom:predeploy 0x4200000000000000000000000000000000000015\",\"kind\":\"dev\",\"methods\":{\"setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256)\":{\"custom:legacy\":\"@notice Updates the L1 block values.\",\"params\":{\"_basefee\":\"L1 basefee.\",\"_batcherHash\":\"Versioned hash to authenticate batcher by.\",\"_hash\":\"L1 blockhash.\",\"_l1FeeOverhead\":\"L1 fee overhead.\",\"_l1FeeScalar\":\"L1 fee scalar.\",\"_number\":\"L1 blocknumber.\",\"_sequenceNumber\":\"Number of L2 blocks since epoch start.\",\"_timestamp\":\"L1 timestamp.\"}}},\"stateVariables\":{\"l1FeeOverhead\":{\"custom:legacy\":\"\"},\"l1FeeScalar\":{\"custom:legacy\":\"\"},\"version\":{\"custom:semver\":\"1.2.0\"}},\"title\":\"L1Block\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DEPOSITOR_ACCOUNT()\":{\"notice\":\"Address of the special depositor account.\"},\"baseFeeScalar()\":{\"notice\":\"The scalar value applied to the L1 base fee portion of the blob-capable L1 cost func.\"},\"basefee()\":{\"notice\":\"The latest L1 base fee.\"},\"batcherHash()\":{\"notice\":\"The versioned hash to authenticate the batcher by.\"},\"blobBaseFee()\":{\"notice\":\"The latest L1 blob base fee.\"},\"blobBaseFeeScalar()\":{\"notice\":\"The scalar value applied to the L1 blob base fee portion of the blob-capable L1 cost func.\"},\"hash()\":{\"notice\":\"The latest L1 blockhash.\"},\"l1FeeOverhead()\":{\"notice\":\"The overhead value applied to the L1 portion of the transaction fee.\"},\"l1FeeScalar()\":{\"notice\":\"The scalar value applied to the L1 portion of the transaction fee.\"},\"number()\":{\"notice\":\"The latest L1 block number known by the L2 system.\"},\"sequenceNumber()\":{\"notice\":\"The number of L2 blocks in the same epoch.\"},\"setL1BlockValuesEcotone()\":{\"notice\":\"Updates the L1 block values for an Ecotone upgraded chain. Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size. Params are expected to be in the following order: 1. _baseFeeScalar L1 base fee scalar 2. _blobBaseFeeScalar L1 blob base fee scalar 3. _sequenceNumber Number of L2 blocks since epoch start. 4. _timestamp L1 timestamp. 5. _number L1 blocknumber. 6. _basefee L1 base fee. 7. _blobBaseFee L1 blob base fee. 8. _hash L1 blockhash. 9. _batcherHash Versioned hash to authenticate batcher by.\"},\"timestamp()\":{\"notice\":\"The latest L1 timestamp known by the L2 system.\"}},\"notice\":\"The L1Block predeploy gives users access to information about the last known L1 block. Values within this contract are updated once per epoch (every L1 block) and can only be set by the \\\"depositor\\\" account, a special system address. Depositor account transactions are created by the protocol whenever we move to a new epoch.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/L2/L1Block.sol\":\"L1Block\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[\":@lib-keccak/=lib/lib-keccak/contracts/lib/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@rari-capital/solmate/=lib/solmate/\",\":@solady-test/=lib/lib-keccak/lib/solady/test/\",\":@solady/=lib/solady/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/\",\":lib-keccak/=lib/lib-keccak/contracts/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":safe-contracts/=lib/safe-contracts/contracts/\",\":solady/=lib/solady/\",\":solmate/=lib/solmate/src/\"]},\"sources\":{\"src/L2/L1Block.sol\":{\"keccak256\":\"0x5819beb85b23c31c5f5d639977bf5d5cf6768975d6d3eecde78299f37ba04cd6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://55cdc404753dcc0cd9d3fac3554a4a16abd7dc39f43f7ae0ebcb0990fa52f7e7\",\"dweb:/ipfs/QmNXMUmNBmNCmL5k8tC1jJ6CmY2hZKJ7owFwuvhMKXr5fv\"]},\"src/universal/ISemver.sol\":{\"keccak256\":\"0xba34562a8026f59886d2e07d1d58d90b9691d00e0788c6263cef6c22740cab44\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0826f998632f83c103c3085bf2e872db79a69022b6d2e0444c83a64ca5283c2a\",\"dweb:/ipfs/QmcJ7PNqkAfKqbjFGRordtAg1v9DvcBSKvdTkVvciLyvQR\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.15+commit.e14f2714"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"view","type":"function","name":"DEPOSITOR_ACCOUNT","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"baseFeeScalar","outputs":[{"internalType":"uint32","name":"","type":"uint32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"basefee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"batcherHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"blobBaseFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"blobBaseFeeScalar","outputs":[{"internalType":"uint32","name":"","type":"uint32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"l1FeeOverhead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"l1FeeScalar","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"number","outputs":[{"internalType":"uint64","name":"","type":"uint64"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"sequenceNumber","outputs":[{"internalType":"uint64","name":"","type":"uint64"}]},{"inputs":[{"internalType":"uint64","name":"_number","type":"uint64"},{"internalType":"uint64","name":"_timestamp","type":"uint64"},{"internalType":"uint256","name":"_basefee","type":"uint256"},{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"uint64","name":"_sequenceNumber","type":"uint64"},{"internalType":"bytes32","name":"_batcherHash","type":"bytes32"},{"internalType":"uint256","name":"_l1FeeOverhead","type":"uint256"},{"internalType":"uint256","name":"_l1FeeScalar","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"setL1BlockValues"},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"setL1BlockValuesEcotone"},{"inputs":[],"stateMutability":"view","type":"function","name":"timestamp","outputs":[{"internalType":"uint64","name":"","type":"uint64"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"version","outputs":[{"internalType":"string","name":"","type":"string"}]}],"devdoc":{"kind":"dev","methods":{"setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256)":{"custom:legacy":"@notice Updates the L1 block values.","params":{"_basefee":"L1 basefee.","_batcherHash":"Versioned hash to authenticate batcher by.","_hash":"L1 blockhash.","_l1FeeOverhead":"L1 fee overhead.","_l1FeeScalar":"L1 fee scalar.","_number":"L1 blocknumber.","_sequenceNumber":"Number of L2 blocks since epoch start.","_timestamp":"L1 timestamp."}}},"version":1},"userdoc":{"kind":"user","methods":{"DEPOSITOR_ACCOUNT()":{"notice":"Address of the special depositor account."},"baseFeeScalar()":{"notice":"The scalar value applied to the L1 base fee portion of the blob-capable L1 cost func."},"basefee()":{"notice":"The latest L1 base fee."},"batcherHash()":{"notice":"The versioned hash to authenticate the batcher by."},"blobBaseFee()":{"notice":"The latest L1 blob base fee."},"blobBaseFeeScalar()":{"notice":"The scalar value applied to the L1 blob base fee portion of the blob-capable L1 cost func."},"hash()":{"notice":"The latest L1 blockhash."},"l1FeeOverhead()":{"notice":"The overhead value applied to the L1 portion of the transaction fee."},"l1FeeScalar()":{"notice":"The scalar value applied to the L1 portion of the transaction fee."},"number()":{"notice":"The latest L1 block number known by the L2 system."},"sequenceNumber()":{"notice":"The number of L2 blocks in the same epoch."},"setL1BlockValuesEcotone()":{"notice":"Updates the L1 block values for an Ecotone upgraded chain. Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size. Params are expected to be in the following order: 1. _baseFeeScalar L1 base fee scalar 2. _blobBaseFeeScalar L1 blob base fee scalar 3. _sequenceNumber Number of L2 blocks since epoch start. 4. _timestamp L1 timestamp. 5. _number L1 blocknumber. 6. _basefee L1 base fee. 7. _blobBaseFee L1 blob base fee. 8. _hash L1 blockhash. 9. _batcherHash Versioned hash to authenticate batcher by."},"timestamp()":{"notice":"The latest L1 timestamp known by the L2 system."}},"version":1}},"settings":{"remappings":["@lib-keccak/=lib/lib-keccak/contracts/lib/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@rari-capital/solmate/=lib/solmate/","@solady-test/=lib/lib-keccak/lib/solady/test/","@solady/=lib/solady/src/","ds-test/=lib/forge-std/lib/ds-test/src/","forge-std/=lib/forge-std/src/","kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/","lib-keccak/=lib/lib-keccak/contracts/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","safe-contracts/=lib/safe-contracts/contracts/","solady/=lib/solady/","solmate/=lib/solmate/src/"],"optimizer":{"enabled":true,"runs":999999},"metadata":{"bytecodeHash":"none"},"compilationTarget":{"src/L2/L1Block.sol":"L1Block"},"evmVersion":"london","libraries":{}},"sources":{"src/L2/L1Block.sol":{"keccak256":"0x5819beb85b23c31c5f5d639977bf5d5cf6768975d6d3eecde78299f37ba04cd6","urls":["bzz-raw://55cdc404753dcc0cd9d3fac3554a4a16abd7dc39f43f7ae0ebcb0990fa52f7e7","dweb:/ipfs/QmNXMUmNBmNCmL5k8tC1jJ6CmY2hZKJ7owFwuvhMKXr5fv"],"license":"MIT"},"src/universal/ISemver.sol":{"keccak256":"0xba34562a8026f59886d2e07d1d58d90b9691d00e0788c6263cef6c22740cab44","urls":["bzz-raw://0826f998632f83c103c3085bf2e872db79a69022b6d2e0444c83a64ca5283c2a","dweb:/ipfs/QmcJ7PNqkAfKqbjFGRordtAg1v9DvcBSKvdTkVvciLyvQR"],"license":"MIT"}},"version":1},"storageLayout":{"storage":[{"astId":90216,"contract":"src/L2/L1Block.sol:L1Block","label":"number","offset":0,"slot":"0","type":"t_uint64"},{"astId":90219,"contract":"src/L2/L1Block.sol:L1Block","label":"timestamp","offset":8,"slot":"0","type":"t_uint64"},{"astId":90222,"contract":"src/L2/L1Block.sol:L1Block","label":"basefee","offset":0,"slot":"1","type":"t_uint256"},{"astId":90225,"contract":"src/L2/L1Block.sol:L1Block","label":"hash","offset":0,"slot":"2","type":"t_bytes32"},{"astId":90228,"contract":"src/L2/L1Block.sol:L1Block","label":"sequenceNumber","offset":0,"slot":"3","type":"t_uint64"},{"astId":90231,"contract":"src/L2/L1Block.sol:L1Block","label":"blobBaseFeeScalar","offset":8,"slot":"3","type":"t_uint32"},{"astId":90234,"contract":"src/L2/L1Block.sol:L1Block","label":"baseFeeScalar","offset":12,"slot":"3","type":"t_uint32"},{"astId":90237,"contract":"src/L2/L1Block.sol:L1Block","label":"batcherHash","offset":0,"slot":"4","type":"t_bytes32"},{"astId":90240,"contract":"src/L2/L1Block.sol:L1Block","label":"l1FeeOverhead","offset":0,"slot":"5","type":"t_uint256"},{"astId":90243,"contract":"src/L2/L1Block.sol:L1Block","label":"l1FeeScalar","offset":0,"slot":"6","type":"t_uint256"},{"astId":90246,"contract":"src/L2/L1Block.sol:L1Block","label":"blobBaseFee","offset":0,"slot":"7","type":"t_uint256"}],"types":{"t_bytes32":{"encoding":"inplace","label":"bytes32","numberOfBytes":"32"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"},"t_uint32":{"encoding":"inplace","label":"uint32","numberOfBytes":"4"},"t_uint64":{"encoding":"inplace","label":"uint64","numberOfBytes":"8"}}},"userdoc":{"version":1,"kind":"user","methods":{"DEPOSITOR_ACCOUNT()":{"notice":"Address of the special depositor account."},"baseFeeScalar()":{"notice":"The scalar value applied to the L1 base fee portion of the blob-capable L1 cost func."},"basefee()":{"notice":"The latest L1 base fee."},"batcherHash()":{"notice":"The versioned hash to authenticate the batcher by."},"blobBaseFee()":{"notice":"The latest L1 blob base fee."},"blobBaseFeeScalar()":{"notice":"The scalar value applied to the L1 blob base fee portion of the blob-capable L1 cost func."},"hash()":{"notice":"The latest L1 blockhash."},"l1FeeOverhead()":{"notice":"The overhead value applied to the L1 portion of the transaction fee."},"l1FeeScalar()":{"notice":"The scalar value applied to the L1 portion of the transaction fee."},"number()":{"notice":"The latest L1 block number known by the L2 system."},"sequenceNumber()":{"notice":"The number of L2 blocks in the same epoch."},"setL1BlockValuesEcotone()":{"notice":"Updates the L1 block values for an Ecotone upgraded chain. Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size. Params are expected to be in the following order: 1. _baseFeeScalar L1 base fee scalar 2. _blobBaseFeeScalar L1 blob base fee scalar 3. _sequenceNumber Number of L2 blocks since epoch start. 4. _timestamp L1 timestamp. 5. _number L1 blocknumber. 6. _basefee L1 base fee. 7. _blobBaseFee L1 blob base fee. 8. _hash L1 blockhash. 9. _batcherHash Versioned hash to authenticate batcher by."},"timestamp()":{"notice":"The latest L1 timestamp known by the L2 system."}},"notice":"The L1Block predeploy gives users access to information about the last known L1 block. Values within this contract are updated once per epoch (every L1 block) and can only be set by the \"depositor\" account, a special system address. Depositor account transactions are created by the protocol whenever we move to a new epoch."},"devdoc":{"version":1,"kind":"dev","methods":{"setL1BlockValues(uint64,uint64,uint256,bytes32,uint64,bytes32,uint256,uint256)":{"params":{"_basefee":"L1 basefee.","_batcherHash":"Versioned hash to authenticate batcher by.","_hash":"L1 blockhash.","_l1FeeOverhead":"L1 fee overhead.","_l1FeeScalar":"L1 fee scalar.","_number":"L1 blocknumber.","_sequenceNumber":"Number of L2 blocks since epoch start.","_timestamp":"L1 timestamp."}}},"title":"L1Block"},"ast":{"absolutePath":"src/L2/L1Block.sol","id":90319,"exportedSymbols":{"ISemver":[109417],"L1Block":[90318]},"nodeType":"SourceUnit","src":"32:4813:145","nodes":[{"id":90204,"nodeType":"PragmaDirective","src":"32:23:145","nodes":[],"literals":["solidity","0.8",".15"]},{"id":90206,"nodeType":"ImportDirective","src":"57:52:145","nodes":[],"absolutePath":"src/universal/ISemver.sol","file":"src/universal/ISemver.sol","nameLocation":"-1:-1:-1","scope":90319,"sourceUnit":109418,"symbolAliases":[{"foreign":{"id":90205,"name":"ISemver","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":109417,"src":"66:7:145","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":90318,"nodeType":"ContractDefinition","src":"588:4256:145","nodes":[{"id":90213,"nodeType":"VariableDeclaration","src":"680:86:145","nodes":[],"constant":true,"documentation":{"id":90210,"nodeType":"StructuredDocumentation","src":"622:53:145","text":"@notice Address of the special depositor account."},"functionSelector":"e591b282","mutability":"constant","name":"DEPOSITOR_ACCOUNT","nameLocation":"704:17:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":90211,"name":"address","nodeType":"ElementaryTypeName","src":"680:7:145","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":{"hexValue":"307844656144444561444465416444654164444541644445616464654164644541644445416430303031","id":90212,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"724:42:145","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"value":"0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001"},"visibility":"public"},{"id":90216,"nodeType":"VariableDeclaration","src":"840:20:145","nodes":[],"constant":false,"documentation":{"id":90214,"nodeType":"StructuredDocumentation","src":"773:62:145","text":"@notice The latest L1 block number known by the L2 system."},"functionSelector":"8381f58a","mutability":"mutable","name":"number","nameLocation":"854:6:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90215,"name":"uint64","nodeType":"ElementaryTypeName","src":"840:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"public"},{"id":90219,"nodeType":"VariableDeclaration","src":"931:23:145","nodes":[],"constant":false,"documentation":{"id":90217,"nodeType":"StructuredDocumentation","src":"867:59:145","text":"@notice The latest L1 timestamp known by the L2 system."},"functionSelector":"b80777ea","mutability":"mutable","name":"timestamp","nameLocation":"945:9:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90218,"name":"uint64","nodeType":"ElementaryTypeName","src":"931:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"public"},{"id":90222,"nodeType":"VariableDeclaration","src":"1001:22:145","nodes":[],"constant":false,"documentation":{"id":90220,"nodeType":"StructuredDocumentation","src":"961:35:145","text":"@notice The latest L1 base fee."},"functionSelector":"5cf24969","mutability":"mutable","name":"basefee","nameLocation":"1016:7:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90221,"name":"uint256","nodeType":"ElementaryTypeName","src":"1001:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"public"},{"id":90225,"nodeType":"VariableDeclaration","src":"1071:19:145","nodes":[],"constant":false,"documentation":{"id":90223,"nodeType":"StructuredDocumentation","src":"1030:36:145","text":"@notice The latest L1 blockhash."},"functionSelector":"09bd5a60","mutability":"mutable","name":"hash","nameLocation":"1086:4:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":90224,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1071:7:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"id":90228,"nodeType":"VariableDeclaration","src":"1156:28:145","nodes":[],"constant":false,"documentation":{"id":90226,"nodeType":"StructuredDocumentation","src":"1097:54:145","text":"@notice The number of L2 blocks in the same epoch."},"functionSelector":"64ca23ef","mutability":"mutable","name":"sequenceNumber","nameLocation":"1170:14:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90227,"name":"uint64","nodeType":"ElementaryTypeName","src":"1156:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"public"},{"id":90231,"nodeType":"VariableDeclaration","src":"1298:31:145","nodes":[],"constant":false,"documentation":{"id":90229,"nodeType":"StructuredDocumentation","src":"1191:102:145","text":"@notice The scalar value applied to the L1 blob base fee portion of the blob-capable L1 cost func."},"functionSelector":"68d5dca6","mutability":"mutable","name":"blobBaseFeeScalar","nameLocation":"1312:17:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":90230,"name":"uint32","nodeType":"ElementaryTypeName","src":"1298:6:145","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"public"},{"id":90234,"nodeType":"VariableDeclaration","src":"1438:27:145","nodes":[],"constant":false,"documentation":{"id":90232,"nodeType":"StructuredDocumentation","src":"1336:97:145","text":"@notice The scalar value applied to the L1 base fee portion of the blob-capable L1 cost func."},"functionSelector":"c5985918","mutability":"mutable","name":"baseFeeScalar","nameLocation":"1452:13:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":90233,"name":"uint32","nodeType":"ElementaryTypeName","src":"1438:6:145","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"public"},{"id":90237,"nodeType":"VariableDeclaration","src":"1539:26:145","nodes":[],"constant":false,"documentation":{"id":90235,"nodeType":"StructuredDocumentation","src":"1472:62:145","text":"@notice The versioned hash to authenticate the batcher by."},"functionSelector":"e81b2c6d","mutability":"mutable","name":"batcherHash","nameLocation":"1554:11:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":90236,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1539:7:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"public"},{"id":90240,"nodeType":"VariableDeclaration","src":"1680:28:145","nodes":[],"constant":false,"documentation":{"id":90238,"nodeType":"StructuredDocumentation","src":"1572:103:145","text":"@notice The overhead value applied to the L1 portion of the transaction fee.\n @custom:legacy"},"functionSelector":"8b239f73","mutability":"mutable","name":"l1FeeOverhead","nameLocation":"1695:13:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90239,"name":"uint256","nodeType":"ElementaryTypeName","src":"1680:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"public"},{"id":90243,"nodeType":"VariableDeclaration","src":"1821:26:145","nodes":[],"constant":false,"documentation":{"id":90241,"nodeType":"StructuredDocumentation","src":"1715:101:145","text":"@notice The scalar value applied to the L1 portion of the transaction fee.\n @custom:legacy"},"functionSelector":"9e8c4966","mutability":"mutable","name":"l1FeeScalar","nameLocation":"1836:11:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90242,"name":"uint256","nodeType":"ElementaryTypeName","src":"1821:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"public"},{"id":90246,"nodeType":"VariableDeclaration","src":"1899:26:145","nodes":[],"constant":false,"documentation":{"id":90244,"nodeType":"StructuredDocumentation","src":"1854:40:145","text":"@notice The latest L1 blob base fee."},"functionSelector":"f8206140","mutability":"mutable","name":"blobBaseFee","nameLocation":"1914:11:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90245,"name":"uint256","nodeType":"ElementaryTypeName","src":"1899:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"public"},{"id":90250,"nodeType":"VariableDeclaration","src":"1961:40:145","nodes":[],"baseFunctions":[109416],"constant":true,"documentation":{"id":90247,"nodeType":"StructuredDocumentation","src":"1932:24:145","text":"@custom:semver 1.2.0"},"functionSelector":"54fd4d50","mutability":"constant","name":"version","nameLocation":"1984:7:145","scope":90318,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":90248,"name":"string","nodeType":"ElementaryTypeName","src":"1961:6:145","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"hexValue":"312e322e30","id":90249,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"1994:7:145","typeDescriptions":{"typeIdentifier":"t_stringliteral_e374587661e69268352d25204d81b23ce801573f4b09f3545e69536dc085a37a","typeString":"literal_string \"1.2.0\""},"value":"1.2.0"},"visibility":"public"},{"id":90311,"nodeType":"FunctionDefinition","src":"2494:660:145","nodes":[],"body":{"id":90310,"nodeType":"Block","src":"2771:383:145","nodes":[],"statements":[{"expression":{"arguments":[{"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":90274,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"expression":{"id":90271,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"2789:3:145","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":90272,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","src":"2789:10:145","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"==","rightExpression":{"id":90273,"name":"DEPOSITOR_ACCOUNT","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90213,"src":"2803:17:145","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"src":"2789:31:145","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},{"hexValue":"4c31426c6f636b3a206f6e6c7920746865206465706f7369746f72206163636f756e742063616e20736574204c3120626c6f636b2076616c756573","id":90275,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"2822:61:145","typeDescriptions":{"typeIdentifier":"t_stringliteral_c3c76ba7c08c4e35ee9214a1ee03dd5f5eafa75e54f6dcd9b82029d1cceb0d7b","typeString":"literal_string \"L1Block: only the depositor account can set L1 block values\""},"value":"L1Block: only the depositor account can set L1 block values"}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"},{"typeIdentifier":"t_stringliteral_c3c76ba7c08c4e35ee9214a1ee03dd5f5eafa75e54f6dcd9b82029d1cceb0d7b","typeString":"literal_string \"L1Block: only the depositor account can set L1 block values\""}],"id":90270,"name":"require","nodeType":"Identifier","overloadedDeclarations":[-18,-18],"referencedDeclaration":-18,"src":"2781:7:145","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$","typeString":"function (bool,string memory) pure"}},"id":90276,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2781:103:145","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":90277,"nodeType":"ExpressionStatement","src":"2781:103:145"},{"expression":{"id":90280,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90278,"name":"number","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90216,"src":"2895:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90279,"name":"_number","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90253,"src":"2904:7:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"src":"2895:16:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"id":90281,"nodeType":"ExpressionStatement","src":"2895:16:145"},{"expression":{"id":90284,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90282,"name":"timestamp","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90219,"src":"2921:9:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90283,"name":"_timestamp","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90255,"src":"2933:10:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"src":"2921:22:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"id":90285,"nodeType":"ExpressionStatement","src":"2921:22:145"},{"expression":{"id":90288,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90286,"name":"basefee","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90222,"src":"2953:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90287,"name":"_basefee","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90257,"src":"2963:8:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2953:18:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":90289,"nodeType":"ExpressionStatement","src":"2953:18:145"},{"expression":{"id":90292,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90290,"name":"hash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90225,"src":"2981:4:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90291,"name":"_hash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90259,"src":"2988:5:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"2981:12:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":90293,"nodeType":"ExpressionStatement","src":"2981:12:145"},{"expression":{"id":90296,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90294,"name":"sequenceNumber","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90228,"src":"3003:14:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90295,"name":"_sequenceNumber","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90261,"src":"3020:15:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"src":"3003:32:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"id":90297,"nodeType":"ExpressionStatement","src":"3003:32:145"},{"expression":{"id":90300,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90298,"name":"batcherHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90237,"src":"3045:11:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90299,"name":"_batcherHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90263,"src":"3059:12:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"src":"3045:26:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"id":90301,"nodeType":"ExpressionStatement","src":"3045:26:145"},{"expression":{"id":90304,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90302,"name":"l1FeeOverhead","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90240,"src":"3081:13:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90303,"name":"_l1FeeOverhead","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90265,"src":"3097:14:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3081:30:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":90305,"nodeType":"ExpressionStatement","src":"3081:30:145"},{"expression":{"id":90308,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"id":90306,"name":"l1FeeScalar","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90243,"src":"3121:11:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"id":90307,"name":"_l1FeeScalar","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":90267,"src":"3135:12:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"3121:26:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":90309,"nodeType":"ExpressionStatement","src":"3121:26:145"}]},"documentation":{"id":90251,"nodeType":"StructuredDocumentation","src":"2008:481:145","text":"@custom:legacy\n @notice Updates the L1 block values.\n @param _number L1 blocknumber.\n @param _timestamp L1 timestamp.\n @param _basefee L1 basefee.\n @param _hash L1 blockhash.\n @param _sequenceNumber Number of L2 blocks since epoch start.\n @param _batcherHash Versioned hash to authenticate batcher by.\n @param _l1FeeOverhead L1 fee overhead.\n @param _l1FeeScalar L1 fee scalar."},"functionSelector":"015d8eb9","implemented":true,"kind":"function","modifiers":[],"name":"setL1BlockValues","nameLocation":"2503:16:145","parameters":{"id":90268,"nodeType":"ParameterList","parameters":[{"constant":false,"id":90253,"mutability":"mutable","name":"_number","nameLocation":"2536:7:145","nodeType":"VariableDeclaration","scope":90311,"src":"2529:14:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90252,"name":"uint64","nodeType":"ElementaryTypeName","src":"2529:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"},{"constant":false,"id":90255,"mutability":"mutable","name":"_timestamp","nameLocation":"2560:10:145","nodeType":"VariableDeclaration","scope":90311,"src":"2553:17:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90254,"name":"uint64","nodeType":"ElementaryTypeName","src":"2553:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"},{"constant":false,"id":90257,"mutability":"mutable","name":"_basefee","nameLocation":"2588:8:145","nodeType":"VariableDeclaration","scope":90311,"src":"2580:16:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90256,"name":"uint256","nodeType":"ElementaryTypeName","src":"2580:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":90259,"mutability":"mutable","name":"_hash","nameLocation":"2614:5:145","nodeType":"VariableDeclaration","scope":90311,"src":"2606:13:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":90258,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2606:7:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":90261,"mutability":"mutable","name":"_sequenceNumber","nameLocation":"2636:15:145","nodeType":"VariableDeclaration","scope":90311,"src":"2629:22:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"},"typeName":{"id":90260,"name":"uint64","nodeType":"ElementaryTypeName","src":"2629:6:145","typeDescriptions":{"typeIdentifier":"t_uint64","typeString":"uint64"}},"visibility":"internal"},{"constant":false,"id":90263,"mutability":"mutable","name":"_batcherHash","nameLocation":"2669:12:145","nodeType":"VariableDeclaration","scope":90311,"src":"2661:20:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":90262,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2661:7:145","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"},{"constant":false,"id":90265,"mutability":"mutable","name":"_l1FeeOverhead","nameLocation":"2699:14:145","nodeType":"VariableDeclaration","scope":90311,"src":"2691:22:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90264,"name":"uint256","nodeType":"ElementaryTypeName","src":"2691:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":90267,"mutability":"mutable","name":"_l1FeeScalar","nameLocation":"2731:12:145","nodeType":"VariableDeclaration","scope":90311,"src":"2723:20:145","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90266,"name":"uint256","nodeType":"ElementaryTypeName","src":"2723:7:145","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2519:230:145"},"returnParameters":{"id":90269,"nodeType":"ParameterList","parameters":[],"src":"2771:0:145"},"scope":90318,"stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"id":90317,"nodeType":"FunctionDefinition","src":"3886:956:145","nodes":[],"body":{"id":90316,"nodeType":"Block","src":"3930:912:145","nodes":[],"statements":[{"AST":{"nodeType":"YulBlock","src":"3949:887:145","statements":[{"body":{"nodeType":"YulBlock","src":"4065:197:145","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4090:4:145","type":"","value":"0x00"},{"kind":"number","nodeType":"YulLiteral","src":"4096:10:145","type":"","value":"0x3cc50b45"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"4083:6:145"},"nodeType":"YulFunctionCall","src":"4083:24:145"},"nodeType":"YulExpressionStatement","src":"4083:24:145"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4188:4:145","type":"","value":"0x1C"},{"kind":"number","nodeType":"YulLiteral","src":"4194:4:145","type":"","value":"0x04"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"4181:6:145"},"nodeType":"YulFunctionCall","src":"4181:18:145"},"nodeType":"YulExpressionStatement","src":"4181:18:145"}]},"condition":{"arguments":[{"arguments":[],"functionName":{"name":"caller","nodeType":"YulIdentifier","src":"4036:6:145"},"nodeType":"YulFunctionCall","src":"4036:8:145"},{"name":"DEPOSITOR_ACCOUNT","nodeType":"YulIdentifier","src":"4046:17:145"}],"functionName":{"name":"xor","nodeType":"YulIdentifier","src":"4032:3:145"},"nodeType":"YulFunctionCall","src":"4032:32:145"},"nodeType":"YulIf","src":"4029:233:145"},{"nodeType":"YulVariableDeclaration","src":"4275:27:145","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4300:1:145","type":"","value":"4"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4287:12:145"},"nodeType":"YulFunctionCall","src":"4287:15:145"},"variables":[{"name":"data","nodeType":"YulTypedName","src":"4279:4:145","type":""}]},{"expression":{"arguments":[{"name":"sequenceNumber.slot","nodeType":"YulIdentifier","src":"4410:19:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4435:3:145","type":"","value":"128"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4453:1:145","type":"","value":"4"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4440:12:145"},"nodeType":"YulFunctionCall","src":"4440:15:145"}],"functionName":{"name":"shr","nodeType":"YulIdentifier","src":"4431:3:145"},"nodeType":"YulFunctionCall","src":"4431:25:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4403:6:145"},"nodeType":"YulFunctionCall","src":"4403:54:145"},"nodeType":"YulExpressionStatement","src":"4403:54:145"},{"expression":{"arguments":[{"name":"number.slot","nodeType":"YulIdentifier","src":"4531:11:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4548:3:145","type":"","value":"128"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4566:2:145","type":"","value":"20"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4553:12:145"},"nodeType":"YulFunctionCall","src":"4553:16:145"}],"functionName":{"name":"shr","nodeType":"YulIdentifier","src":"4544:3:145"},"nodeType":"YulFunctionCall","src":"4544:26:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4524:6:145"},"nodeType":"YulFunctionCall","src":"4524:47:145"},"nodeType":"YulExpressionStatement","src":"4524:47:145"},{"expression":{"arguments":[{"name":"basefee.slot","nodeType":"YulIdentifier","src":"4591:12:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4618:2:145","type":"","value":"36"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4605:12:145"},"nodeType":"YulFunctionCall","src":"4605:16:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4584:6:145"},"nodeType":"YulFunctionCall","src":"4584:38:145"},"nodeType":"YulExpressionStatement","src":"4584:38:145"},{"expression":{"arguments":[{"name":"blobBaseFee.slot","nodeType":"YulIdentifier","src":"4653:16:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4684:2:145","type":"","value":"68"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4671:12:145"},"nodeType":"YulFunctionCall","src":"4671:16:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4646:6:145"},"nodeType":"YulFunctionCall","src":"4646:42:145"},"nodeType":"YulExpressionStatement","src":"4646:42:145"},{"expression":{"arguments":[{"name":"hash.slot","nodeType":"YulIdentifier","src":"4719:9:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4743:3:145","type":"","value":"100"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4730:12:145"},"nodeType":"YulFunctionCall","src":"4730:17:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4712:6:145"},"nodeType":"YulFunctionCall","src":"4712:36:145"},"nodeType":"YulExpressionStatement","src":"4712:36:145"},{"expression":{"arguments":[{"name":"batcherHash.slot","nodeType":"YulIdentifier","src":"4779:16:145"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"4810:3:145","type":"","value":"132"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"4797:12:145"},"nodeType":"YulFunctionCall","src":"4797:17:145"}],"functionName":{"name":"sstore","nodeType":"YulIdentifier","src":"4772:6:145"},"nodeType":"YulFunctionCall","src":"4772:43:145"},"nodeType":"YulExpressionStatement","src":"4772:43:145"}]},"evmVersion":"london","externalReferences":[{"declaration":90213,"isOffset":false,"isSlot":false,"src":"4046:17:145","valueSize":1},{"declaration":90222,"isOffset":false,"isSlot":true,"src":"4591:12:145","suffix":"slot","valueSize":1},{"declaration":90237,"isOffset":false,"isSlot":true,"src":"4779:16:145","suffix":"slot","valueSize":1},{"declaration":90246,"isOffset":false,"isSlot":true,"src":"4653:16:145","suffix":"slot","valueSize":1},{"declaration":90225,"isOffset":false,"isSlot":true,"src":"4719:9:145","suffix":"slot","valueSize":1},{"declaration":90216,"isOffset":false,"isSlot":true,"src":"4531:11:145","suffix":"slot","valueSize":1},{"declaration":90228,"isOffset":false,"isSlot":true,"src":"4410:19:145","suffix":"slot","valueSize":1}],"id":90315,"nodeType":"InlineAssembly","src":"3940:896:145"}]},"documentation":{"id":90312,"nodeType":"StructuredDocumentation","src":"3160:721:145","text":"@notice Updates the L1 block values for an Ecotone upgraded chain.\n Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size.\n Params are expected to be in the following order:\n 1. _baseFeeScalar L1 base fee scalar\n 2. _blobBaseFeeScalar L1 blob base fee scalar\n 3. _sequenceNumber Number of L2 blocks since epoch start.\n 4. _timestamp L1 timestamp.\n 5. _number L1 blocknumber.\n 6. _basefee L1 base fee.\n 7. _blobBaseFee L1 blob base fee.\n 8. _hash L1 blockhash.\n 9. _batcherHash Versioned hash to authenticate batcher by."},"functionSelector":"440a5e20","implemented":true,"kind":"function","modifiers":[],"name":"setL1BlockValuesEcotone","nameLocation":"3895:23:145","parameters":{"id":90313,"nodeType":"ParameterList","parameters":[],"src":"3918:2:145"},"returnParameters":{"id":90314,"nodeType":"ParameterList","parameters":[],"src":"3930:0:145"},"scope":90318,"stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"abstract":false,"baseContracts":[{"baseName":{"id":90208,"name":"ISemver","nodeType":"IdentifierPath","referencedDeclaration":109417,"src":"608:7:145"},"id":90209,"nodeType":"InheritanceSpecifier","src":"608:7:145"}],"canonicalName":"L1Block","contractDependencies":[],"contractKind":"contract","documentation":{"id":90207,"nodeType":"StructuredDocumentation","src":"111:477:145","text":"@custom:proxied\n @custom:predeploy 0x4200000000000000000000000000000000000015\n @title L1Block\n @notice The L1Block predeploy gives users access to information about the last known L1 block.\n Values within this contract are updated once per epoch (every L1 block) and can only be\n set by the \"depositor\" account, a special system address. Depositor account transactions\n are created by the protocol whenever we move to a new epoch."},"fullyImplemented":true,"linearizedBaseContracts":[90318,109417],"name":"L1Block","nameLocation":"597:7:145","scope":90319,"usedErrors":[]}],"license":"MIT"},"id":145}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"abi":[{"type":"receive","stateMutability":"payable"},{"type":"function","name":"MESSAGE_VERSION","inputs":[],"outputs":[{"name":"","type":"uint16","internalType":"uint16"}],"stateMutability":"view"},{"type":"function","name":"burn","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"initiateWithdrawal","inputs":[{"name":"_target","type":"address","internalType":"address"},{"name":"_gasLimit","type":"uint256","internalType":"uint256"},{"name":"_data","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"messageNonce","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"sentMessages","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"event","name":"MessagePassed","inputs":[{"name":"nonce","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"sender","type":"address","indexed":true,"internalType":"address"},{"name":"target","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"gasLimit","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"data","type":"bytes","indexed":false,"internalType":"bytes"},{"name":"withdrawalHash","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"WithdrawerBalanceBurnt","inputs":[{"name":"amount","type":"uint256","indexed":true,"internalType":"uint256"}],"anonymous":false}],"bytecode":{"object":"0x608060405234801561001057600080fd5b506106d3806100206000396000f3fe6080604052600436106100695760003560e01c806382e3702d1161004357806382e3702d1461012a578063c2b3e5ac1461016a578063ecc704281461017d57600080fd5b80633f827a5a1461009257806344df8e70146100bf57806354fd4d50146100d457600080fd5b3661008d5761008b33620186a0604051806020016040528060008152506101e2565b005b600080fd5b34801561009e57600080fd5b506100a7600181565b60405161ffff90911681526020015b60405180910390f35b3480156100cb57600080fd5b5061008b6103a6565b3480156100e057600080fd5b5061011d6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100b691906104d1565b34801561013657600080fd5b5061015a6101453660046104eb565b60006020819052908152604090205460ff1681565b60405190151581526020016100b6565b61008b610178366004610533565b6101e2565b34801561018957600080fd5b506101d46001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b6040519081526020016100b6565b60006102786040518060c0016040528061023c6001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b815233602082015273ffffffffffffffffffffffffffffffffffffffff871660408201523460608201526080810186905260a0018490526103de565b600081815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055905073ffffffffffffffffffffffffffffffffffffffff8416336103136001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b7f02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054348787876040516103489493929190610637565b60405180910390a45050600180547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082168301167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b476103b08161042b565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b80516020808301516040808501516060860151608087015160a0880151935160009761040e979096959101610667565b604051602081830303815290604052805190602001209050919050565b806040516104389061045a565b6040518091039082f0905080158015610455573d6000803e3d6000fd5b505050565b6008806106bf83390190565b6000815180845260005b8181101561048c57602081850181015186830182015201610470565b8181111561049e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104e46020830184610466565b9392505050565b6000602082840312156104fd57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561054857600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461056c57600080fd5b925060208401359150604084013567ffffffffffffffff8082111561059057600080fd5b818601915086601f8301126105a457600080fd5b8135818111156105b6576105b6610504565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105fc576105fc610504565b8160405282815289602084870101111561061557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b8481528360208201526080604082015260006106566080830185610466565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526106b260c0830184610466565b9897505050505050505056fe608060405230fffea164736f6c634300080f000a","sourceMap":"722:3696:150:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080604052600436106100695760003560e01c806382e3702d1161004357806382e3702d1461012a578063c2b3e5ac1461016a578063ecc704281461017d57600080fd5b80633f827a5a1461009257806344df8e70146100bf57806354fd4d50146100d457600080fd5b3661008d5761008b33620186a0604051806020016040528060008152506101e2565b005b600080fd5b34801561009e57600080fd5b506100a7600181565b60405161ffff90911681526020015b60405180910390f35b3480156100cb57600080fd5b5061008b6103a6565b3480156100e057600080fd5b5061011d6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516100b691906104d1565b34801561013657600080fd5b5061015a6101453660046104eb565b60006020819052908152604090205460ff1681565b60405190151581526020016100b6565b61008b610178366004610533565b6101e2565b34801561018957600080fd5b506101d46001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b6040519081526020016100b6565b60006102786040518060c0016040528061023c6001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b815233602082015273ffffffffffffffffffffffffffffffffffffffff871660408201523460608201526080810186905260a0018490526103de565b600081815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055905073ffffffffffffffffffffffffffffffffffffffff8416336103136001547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff167e010000000000000000000000000000000000000000000000000000000000001790565b7f02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054348787876040516103489493929190610637565b60405180910390a45050600180547dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8082168301167fffff0000000000000000000000000000000000000000000000000000000000009091161790555050565b476103b08161042b565b60405181907f7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f90600090a250565b80516020808301516040808501516060860151608087015160a0880151935160009761040e979096959101610667565b604051602081830303815290604052805190602001209050919050565b806040516104389061045a565b6040518091039082f0905080158015610455573d6000803e3d6000fd5b505050565b6008806106bf83390190565b6000815180845260005b8181101561048c57602081850181015186830182015201610470565b8181111561049e576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006104e46020830184610466565b9392505050565b6000602082840312156104fd57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060006060848603121561054857600080fd5b833573ffffffffffffffffffffffffffffffffffffffff8116811461056c57600080fd5b925060208401359150604084013567ffffffffffffffff8082111561059057600080fd5b818601915086601f8301126105a457600080fd5b8135818111156105b6576105b6610504565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156105fc576105fc610504565b8160405282815289602084870101111561061557600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b8481528360208201526080604082015260006106566080830185610466565b905082606083015295945050505050565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526106b260c0830184610466565b9897505050505050505056fe608060405230fffea164736f6c634300080f000a","sourceMap":"722:3696:150:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2474:68;2493:10;911:7;2532:9;;;;;;;;;;;;2474:18;:68::i;:::-;722:3696;;;;;981:42;;;;;;;;;;;;1022:1;981:42;;;;;188:6:357;176:19;;;158:38;;146:2;131:18;981:42:150;;;;;;;;2915:154;;;;;;;;;;;;;:::i;2307:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1094:44::-;;;;;;;;;;-1:-1:-1;1094:44:150;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;1318:14:357;;1311:22;1293:41;;1281:2;1266:18;1094:44:150;1153:187:357;3311:650:150;;;;;;:::i;:::-;;:::i;4282:134::-;;;;;;;;;;;;4383:8;;;;4855:18:195;4852:30;;4282:134:150;;;;2930:25:357;;;2918:2;2903:18;4282:134:150;2784:177:357;3311:650:150;3420:22;3445:297;3481:251;;;;;;;;3534:14;4383:8;;;;4855:18:195;4852:30;;4282:134:150;3534:14;3481:251;;3574:10;3481:251;;;;;;;;;;;3642:9;3481:251;;;;;;;;;;;;;;;3445:22;:297::i;:::-;3753:12;:28;;;;;;;;;;:35;;;;3784:4;3753:35;;;3420:322;-1:-1:-1;3804:95:150;;;3834:10;3818:14;4383:8;;;;4855:18:195;4852:30;;4282:134:150;3818:14;3804:95;3855:9;3866;3877:5;3884:14;3804:95;;;;;;;;;:::i;:::-;;;;;;;;-1:-1:-1;;3936:8:150;3934:10;;;;;;;;;;;;;;;;-1:-1:-1;;3311:650:150:o;2915:154::-;2968:21;2999:17;2968:21;2999:8;:17::i;:::-;3031:31;;3054:7;;3031:31;;;;;2940:129;2915:154::o;4456:211:196:-;4590:9;;4601:10;;;;;4613;;;;;4625:9;;;;4636:12;;;;4650:8;;;;4579:80;;4543:7;;4579:80;;4590:9;;4601:10;4650:8;4579:80;;:::i;:::-;;;;;;;;;;;;;4569:91;;;;;;4562:98;;4456:211;;;:::o;224:86:190:-;292:7;273:30;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;224:86;:::o;-1:-1:-1:-;;;;;;;;:::o;207:531:357:-;249:3;287:5;281:12;314:6;309:3;302:19;339:1;349:162;363:6;360:1;357:13;349:162;;;425:4;481:13;;;477:22;;471:29;453:11;;;449:20;;442:59;378:12;349:162;;;529:6;526:1;523:13;520:87;;;595:1;588:4;579:6;574:3;570:16;566:27;559:38;520:87;-1:-1:-1;652:2:357;640:15;657:66;636:88;627:98;;;;727:4;623:109;;207:531;-1:-1:-1;;207:531:357:o;743:220::-;892:2;881:9;874:21;855:4;912:45;953:2;942:9;938:18;930:6;912:45;:::i;:::-;904:53;743:220;-1:-1:-1;;;743:220:357:o;968:180::-;1027:6;1080:2;1068:9;1059:7;1055:23;1051:32;1048:52;;;1096:1;1093;1086:12;1048:52;-1:-1:-1;1119:23:357;;968:180;-1:-1:-1;968:180:357:o;1345:184::-;1397:77;1394:1;1387:88;1494:4;1491:1;1484:15;1518:4;1515:1;1508:15;1534:1245;1620:6;1628;1636;1689:2;1677:9;1668:7;1664:23;1660:32;1657:52;;;1705:1;1702;1695:12;1657:52;1744:9;1731:23;1794:42;1787:5;1783:54;1776:5;1773:65;1763:93;;1852:1;1849;1842:12;1763:93;1875:5;-1:-1:-1;1927:2:357;1912:18;;1899:32;;-1:-1:-1;1982:2:357;1967:18;;1954:32;2005:18;2035:14;;;2032:34;;;2062:1;2059;2052:12;2032:34;2100:6;2089:9;2085:22;2075:32;;2145:7;2138:4;2134:2;2130:13;2126:27;2116:55;;2167:1;2164;2157:12;2116:55;2203:2;2190:16;2225:2;2221;2218:10;2215:36;;;2231:18;;:::i;:::-;2365:2;2359:9;2427:4;2419:13;;2270:66;2415:22;;;2439:2;2411:31;2407:40;2395:53;;;2463:18;;;2483:22;;;2460:46;2457:72;;;2509:18;;:::i;:::-;2549:10;2545:2;2538:22;2584:2;2576:6;2569:18;2624:7;2619:2;2614;2610;2606:11;2602:20;2599:33;2596:53;;;2645:1;2642;2635:12;2596:53;2701:2;2696;2692;2688:11;2683:2;2675:6;2671:15;2658:46;2746:1;2741:2;2736;2728:6;2724:15;2720:24;2713:35;2767:6;2757:16;;;;;;;1534:1245;;;;;:::o;2966:433::-;3197:6;3186:9;3179:25;3240:6;3235:2;3224:9;3220:18;3213:34;3283:3;3278:2;3267:9;3263:18;3256:31;3160:4;3304:46;3345:3;3334:9;3330:19;3322:6;3304:46;:::i;:::-;3296:54;;3386:6;3381:2;3370:9;3366:18;3359:34;2966:433;;;;;;;:::o;3404:656::-;3691:6;3680:9;3673:25;3654:4;3717:42;3807:2;3799:6;3795:15;3790:2;3779:9;3775:18;3768:43;3859:2;3851:6;3847:15;3842:2;3831:9;3827:18;3820:43;;3899:6;3894:2;3883:9;3879:18;3872:34;3943:6;3937:3;3926:9;3922:19;3915:35;3987:3;3981;3970:9;3966:19;3959:32;4008:46;4049:3;4038:9;4034:19;4026:6;4008:46;:::i;:::-;4000:54;3404:656;-1:-1:-1;;;;;;;;3404:656:357:o","linkReferences":{}},"methodIdentifiers":{"MESSAGE_VERSION()":"3f827a5a","burn()":"44df8e70","initiateWithdrawal(address,uint256,bytes)":"c2b3e5ac","messageNonce()":"ecc70428","sentMessages(bytes32)":"82e3702d","version()":"54fd4d50"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"}],\"name\":\"MessagePassed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawerBalanceBurnt\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MESSAGE_VERSION\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"initiateWithdrawal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"sentMessages\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"custom:proxied\":\"@custom:predeploy 0x4200000000000000000000000000000000000016\",\"events\":{\"MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32)\":{\"params\":{\"data\":\"The data to be forwarded to the target on L1.\",\"gasLimit\":\"The minimum amount of gas that must be provided when withdrawing.\",\"nonce\":\"Unique value corresponding to each withdrawal.\",\"sender\":\"The L2 account address which initiated the withdrawal.\",\"target\":\"The L1 account address the call will be send to.\",\"value\":\"The ETH value submitted for withdrawal, to be forwarded to the target.\",\"withdrawalHash\":\"The hash of the withdrawal.\"}},\"WithdrawerBalanceBurnt(uint256)\":{\"params\":{\"amount\":\"Amount of ETh that was burned.\"}}},\"kind\":\"dev\",\"methods\":{\"initiateWithdrawal(address,uint256,bytes)\":{\"params\":{\"_data\":\"Data to forward to L1 target.\",\"_gasLimit\":\"Minimum gas limit for executing the message on L1.\",\"_target\":\"Address to call on L1 execution.\"}},\"messageNonce()\":{\"returns\":{\"_0\":\"Nonce of the next message to be sent, with added message version.\"}}},\"stateVariables\":{\"version\":{\"custom:semver\":\"1.1.0\"}},\"title\":\"L2ToL1MessagePasser\",\"version\":1},\"userdoc\":{\"events\":{\"MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32)\":{\"notice\":\"Emitted any time a withdrawal is initiated.\"},\"WithdrawerBalanceBurnt(uint256)\":{\"notice\":\"Emitted when the balance of this contract is burned.\"}},\"kind\":\"user\",\"methods\":{\"MESSAGE_VERSION()\":{\"notice\":\"The current message version identifier.\"},\"burn()\":{\"notice\":\"Removes all ETH held by this contract from the state. Used to prevent the amount of ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to create a contract and self-destruct it to itself. Anyone can call this function. Not incentivized since this function is very cheap.\"},\"initiateWithdrawal(address,uint256,bytes)\":{\"notice\":\"Sends a message from L2 to L1.\"},\"messageNonce()\":{\"notice\":\"Retrieves the next message nonce. Message version will be added to the upper two bytes of the message nonce. Message version allows us to treat messages as having different structures.\"},\"sentMessages(bytes32)\":{\"notice\":\"Includes the message hashes for all withdrawals\"}},\"notice\":\"The L2ToL1MessagePasser is a dedicated contract where messages that are being sent from L2 to L1 can be stored. The storage root of this contract is pulled up to the top level of the L2 output to reduce the cost of proving the existence of sent messages.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/L2/L2ToL1MessagePasser.sol\":\"L2ToL1MessagePasser\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[\":@lib-keccak/=lib/lib-keccak/contracts/lib/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@rari-capital/solmate/=lib/solmate/\",\":@solady-test/=lib/lib-keccak/lib/solady/test/\",\":@solady/=lib/solady/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/\",\":lib-keccak/=lib/lib-keccak/contracts/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":safe-contracts/=lib/safe-contracts/contracts/\",\":solady/=lib/solady/\",\":solmate/=lib/solmate/src/\"]},\"sources\":{\"src/L2/L2ToL1MessagePasser.sol\":{\"keccak256\":\"0x67f440defc45e97bf1494274a9061876cbdcb10625707c534a0cb04b1c057e21\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://47900ccfcd1e4506d50dd3b14069da285eeb5f783020a0c74f58181b4c011460\",\"dweb:/ipfs/QmNUtEAxiwXT8QDbCHsX3uT4h2fh6k9f8LvMrmRK2N7K61\"]},\"src/libraries/Burn.sol\":{\"keccak256\":\"0x90a795bcea3ef06d6d5011256c4bd63d1a4271f519246dbf1ee3e8f1c0e21010\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9f60c3aa77cf0c484ddda4754157cff4dc0e2eace4bea67990daff4c0612ab5f\",\"dweb:/ipfs/QmSYGanMFve9uBC17X7hFneSFnwnJxz86Jgh6MX9BRMweb\"]},\"src/libraries/Encoding.sol\":{\"keccak256\":\"0x1dafabcbd4877c7abe9698957b0a44b7e911cb8b11c1437a4ed897135669fa87\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6addfacefa26fdb44f56d73fa0172b97740de75629a962905ec2a20a28d40fff\",\"dweb:/ipfs/QmboHMouqU19Rnbqrfo1gkfnuDBFcPiC9wsKgGtF2W1cNA\"]},\"src/libraries/Hashing.sol\":{\"keccak256\":\"0x89c07a0ca102cbe57b4e082543f2dd6dae0e1fd4a87908a334bd076fc914e7b8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://69c83489c9544ab442dc244c2feb2c6811b726a5eb5a509b97fc5ccb90b98c12\",\"dweb:/ipfs/QmPGGJeLasc1HWHzd6odvWcNvFPQrbYtDubZcv8yp1HLtF\"]},\"src/libraries/Types.sol\":{\"keccak256\":\"0x75900d651301940d24c00d14f0b3b6cbd6dcf379173ceaa31d9bf5be934a9aa4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://99c2632c5bf4fa3982391c32110eec9fa07917b483b2442cbaf18bdde5bdb24e\",\"dweb:/ipfs/QmSUs6Amkeootf5gKGbKi4mJpvhN2U8i1ED6ef2dskV5xc\"]},\"src/libraries/rlp/RLPWriter.sol\":{\"keccak256\":\"0x60ac401490f321c9c55e996a2c65151cd5e60de5f8f297e7c94d541c29820bb6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://070f5814db07e4a89173d44a36d90e4261ce530f7336034c01635347f2c2d88b\",\"dweb:/ipfs/QmXqr9yW5Kc8MYgr5wSehU5AiqS9pZ4FKxv7vwiwpZCcyV\"]},\"src/universal/ISemver.sol\":{\"keccak256\":\"0xba34562a8026f59886d2e07d1d58d90b9691d00e0788c6263cef6c22740cab44\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0826f998632f83c103c3085bf2e872db79a69022b6d2e0444c83a64ca5283c2a\",\"dweb:/ipfs/QmcJ7PNqkAfKqbjFGRordtAg1v9DvcBSKvdTkVvciLyvQR\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.15+commit.e14f2714"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256","indexed":true},{"internalType":"address","name":"sender","type":"address","indexed":true},{"internalType":"address","name":"target","type":"address","indexed":true},{"internalType":"uint256","name":"value","type":"uint256","indexed":false},{"internalType":"uint256","name":"gasLimit","type":"uint256","indexed":false},{"internalType":"bytes","name":"data","type":"bytes","indexed":false},{"internalType":"bytes32","name":"withdrawalHash","type":"bytes32","indexed":false}],"type":"event","name":"MessagePassed","anonymous":false},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256","indexed":true}],"type":"event","name":"WithdrawerBalanceBurnt","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"MESSAGE_VERSION","outputs":[{"internalType":"uint16","name":"","type":"uint16"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"burn"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"function","name":"initiateWithdrawal"},{"inputs":[],"stateMutability":"view","type":"function","name":"messageNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function","name":"sentMessages","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"version","outputs":[{"internalType":"string","name":"","type":"string"}]},{"inputs":[],"stateMutability":"payable","type":"receive"}],"devdoc":{"kind":"dev","methods":{"initiateWithdrawal(address,uint256,bytes)":{"params":{"_data":"Data to forward to L1 target.","_gasLimit":"Minimum gas limit for executing the message on L1.","_target":"Address to call on L1 execution."}},"messageNonce()":{"returns":{"_0":"Nonce of the next message to be sent, with added message version."}}},"version":1},"userdoc":{"kind":"user","methods":{"MESSAGE_VERSION()":{"notice":"The current message version identifier."},"burn()":{"notice":"Removes all ETH held by this contract from the state. Used to prevent the amount of ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to create a contract and self-destruct it to itself. Anyone can call this function. Not incentivized since this function is very cheap."},"initiateWithdrawal(address,uint256,bytes)":{"notice":"Sends a message from L2 to L1."},"messageNonce()":{"notice":"Retrieves the next message nonce. Message version will be added to the upper two bytes of the message nonce. Message version allows us to treat messages as having different structures."},"sentMessages(bytes32)":{"notice":"Includes the message hashes for all withdrawals"}},"version":1}},"settings":{"remappings":["@lib-keccak/=lib/lib-keccak/contracts/lib/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@rari-capital/solmate/=lib/solmate/","@solady-test/=lib/lib-keccak/lib/solady/test/","@solady/=lib/solady/src/","ds-test/=lib/forge-std/lib/ds-test/src/","forge-std/=lib/forge-std/src/","kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/","lib-keccak/=lib/lib-keccak/contracts/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","safe-contracts/=lib/safe-contracts/contracts/","solady/=lib/solady/","solmate/=lib/solmate/src/"],"optimizer":{"enabled":true,"runs":999999},"metadata":{"bytecodeHash":"none"},"compilationTarget":{"src/L2/L2ToL1MessagePasser.sol":"L2ToL1MessagePasser"},"evmVersion":"london","libraries":{}},"sources":{"src/L2/L2ToL1MessagePasser.sol":{"keccak256":"0x67f440defc45e97bf1494274a9061876cbdcb10625707c534a0cb04b1c057e21","urls":["bzz-raw://47900ccfcd1e4506d50dd3b14069da285eeb5f783020a0c74f58181b4c011460","dweb:/ipfs/QmNUtEAxiwXT8QDbCHsX3uT4h2fh6k9f8LvMrmRK2N7K61"],"license":"MIT"},"src/libraries/Burn.sol":{"keccak256":"0x90a795bcea3ef06d6d5011256c4bd63d1a4271f519246dbf1ee3e8f1c0e21010","urls":["bzz-raw://9f60c3aa77cf0c484ddda4754157cff4dc0e2eace4bea67990daff4c0612ab5f","dweb:/ipfs/QmSYGanMFve9uBC17X7hFneSFnwnJxz86Jgh6MX9BRMweb"],"license":"MIT"},"src/libraries/Encoding.sol":{"keccak256":"0x1dafabcbd4877c7abe9698957b0a44b7e911cb8b11c1437a4ed897135669fa87","urls":["bzz-raw://6addfacefa26fdb44f56d73fa0172b97740de75629a962905ec2a20a28d40fff","dweb:/ipfs/QmboHMouqU19Rnbqrfo1gkfnuDBFcPiC9wsKgGtF2W1cNA"],"license":"MIT"},"src/libraries/Hashing.sol":{"keccak256":"0x89c07a0ca102cbe57b4e082543f2dd6dae0e1fd4a87908a334bd076fc914e7b8","urls":["bzz-raw://69c83489c9544ab442dc244c2feb2c6811b726a5eb5a509b97fc5ccb90b98c12","dweb:/ipfs/QmPGGJeLasc1HWHzd6odvWcNvFPQrbYtDubZcv8yp1HLtF"],"license":"MIT"},"src/libraries/Types.sol":{"keccak256":"0x75900d651301940d24c00d14f0b3b6cbd6dcf379173ceaa31d9bf5be934a9aa4","urls":["bzz-raw://99c2632c5bf4fa3982391c32110eec9fa07917b483b2442cbaf18bdde5bdb24e","dweb:/ipfs/QmSUs6Amkeootf5gKGbKi4mJpvhN2U8i1ED6ef2dskV5xc"],"license":"MIT"},"src/libraries/rlp/RLPWriter.sol":{"keccak256":"0x60ac401490f321c9c55e996a2c65151cd5e60de5f8f297e7c94d541c29820bb6","urls":["bzz-raw://070f5814db07e4a89173d44a36d90e4261ce530f7336034c01635347f2c2d88b","dweb:/ipfs/QmXqr9yW5Kc8MYgr5wSehU5AiqS9pZ4FKxv7vwiwpZCcyV"],"license":"MIT"},"src/universal/ISemver.sol":{"keccak256":"0xba34562a8026f59886d2e07d1d58d90b9691d00e0788c6263cef6c22740cab44","urls":["bzz-raw://0826f998632f83c103c3085bf2e872db79a69022b6d2e0444c83a64ca5283c2a","dweb:/ipfs/QmcJ7PNqkAfKqbjFGRordtAg1v9DvcBSKvdTkVvciLyvQR"],"license":"MIT"}},"version":1},"storageLayout":{"storage":[{"astId":91174,"contract":"src/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser","label":"sentMessages","offset":0,"slot":"0","type":"t_mapping(t_bytes32,t_bool)"},{"astId":91177,"contract":"src/L2/L2ToL1MessagePasser.sol:L2ToL1MessagePasser","label":"msgNonce","offset":0,"slot":"1","type":"t_uint240"}],"types":{"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_bytes32":{"encoding":"inplace","label":"bytes32","numberOfBytes":"32"},"t_mapping(t_bytes32,t_bool)":{"encoding":"mapping","key":"t_bytes32","label":"mapping(bytes32 => bool)","numberOfBytes":"32","value":"t_bool"},"t_uint240":{"encoding":"inplace","label":"uint240","numberOfBytes":"30"}}},"userdoc":{"version":1,"kind":"user","methods":{"MESSAGE_VERSION()":{"notice":"The current message version identifier."},"burn()":{"notice":"Removes all ETH held by this contract from the state. Used to prevent the amount of ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to create a contract and self-destruct it to itself. Anyone can call this function. Not incentivized since this function is very cheap."},"initiateWithdrawal(address,uint256,bytes)":{"notice":"Sends a message from L2 to L1."},"messageNonce()":{"notice":"Retrieves the next message nonce. Message version will be added to the upper two bytes of the message nonce. Message version allows us to treat messages as having different structures."},"sentMessages(bytes32)":{"notice":"Includes the message hashes for all withdrawals"}},"events":{"MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32)":{"notice":"Emitted any time a withdrawal is initiated."},"WithdrawerBalanceBurnt(uint256)":{"notice":"Emitted when the balance of this contract is burned."}},"notice":"The L2ToL1MessagePasser is a dedicated contract where messages that are being sent from L2 to L1 can be stored. The storage root of this contract is pulled up to the top level of the L2 output to reduce the cost of proving the existence of sent messages."},"devdoc":{"version":1,"kind":"dev","methods":{"initiateWithdrawal(address,uint256,bytes)":{"params":{"_data":"Data to forward to L1 target.","_gasLimit":"Minimum gas limit for executing the message on L1.","_target":"Address to call on L1 execution."}},"messageNonce()":{"returns":{"_0":"Nonce of the next message to be sent, with added message version."}}},"events":{"MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32)":{"params":{"data":"The data to be forwarded to the target on L1.","gasLimit":"The minimum amount of gas that must be provided when withdrawing.","nonce":"Unique value corresponding to each withdrawal.","sender":"The L2 account address which initiated the withdrawal.","target":"The L1 account address the call will be send to.","value":"The ETH value submitted for withdrawal, to be forwarded to the target.","withdrawalHash":"The hash of the withdrawal."}},"WithdrawerBalanceBurnt(uint256)":{"params":{"amount":"Amount of ETh that was burned."}}},"title":"L2ToL1MessagePasser"},"ast":{"absolutePath":"src/L2/L2ToL1MessagePasser.sol","id":91308,"exportedSymbols":{"Burn":[102909],"Encoding":[103714],"Hashing":[103936],"ISemver":[109417],"L2ToL1MessagePasser":[91307],"Types":[104349]},"nodeType":"SourceUnit","src":"32:4387:150","nodes":[{"id":91148,"nodeType":"PragmaDirective","src":"32:23:150","nodes":[],"literals":["solidity","0.8",".15"]},{"id":91150,"nodeType":"ImportDirective","src":"57:48:150","nodes":[],"absolutePath":"src/libraries/Types.sol","file":"src/libraries/Types.sol","nameLocation":"-1:-1:-1","scope":91308,"sourceUnit":104350,"symbolAliases":[{"foreign":{"id":91149,"name":"Types","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":104349,"src":"66:5:150","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":91152,"nodeType":"ImportDirective","src":"106:52:150","nodes":[],"absolutePath":"src/libraries/Hashing.sol","file":"src/libraries/Hashing.sol","nameLocation":"-1:-1:-1","scope":91308,"sourceUnit":103937,"symbolAliases":[{"foreign":{"id":91151,"name":"Hashing","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103936,"src":"115:7:150","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":91154,"nodeType":"ImportDirective","src":"159:54:150","nodes":[],"absolutePath":"src/libraries/Encoding.sol","file":"src/libraries/Encoding.sol","nameLocation":"-1:-1:-1","scope":91308,"sourceUnit":103715,"symbolAliases":[{"foreign":{"id":91153,"name":"Encoding","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103714,"src":"168:8:150","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":91156,"nodeType":"ImportDirective","src":"214:46:150","nodes":[],"absolutePath":"src/libraries/Burn.sol","file":"src/libraries/Burn.sol","nameLocation":"-1:-1:-1","scope":91308,"sourceUnit":102926,"symbolAliases":[{"foreign":{"id":91155,"name":"Burn","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":102909,"src":"223:4:150","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":91158,"nodeType":"ImportDirective","src":"261:52:150","nodes":[],"absolutePath":"src/universal/ISemver.sol","file":"src/universal/ISemver.sol","nameLocation":"-1:-1:-1","scope":91308,"sourceUnit":109418,"symbolAliases":[{"foreign":{"id":91157,"name":"ISemver","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":109417,"src":"270:7:150","typeDescriptions":{}},"nameLocation":"-1:-1:-1"}],"unitAlias":""},{"id":91307,"nodeType":"ContractDefinition","src":"722:3696:150","nodes":[{"id":91165,"nodeType":"VariableDeclaration","src":"857:61:150","nodes":[],"constant":true,"documentation":{"id":91162,"nodeType":"StructuredDocumentation","src":"768:84:150","text":"@notice The L1 gas limit set when eth is withdrawn using the receive() function."},"mutability":"constant","name":"RECEIVE_DEFAULT_GAS_LIMIT","nameLocation":"883:25:150","scope":91307,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91163,"name":"uint256","nodeType":"ElementaryTypeName","src":"857:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":{"hexValue":"3130305f303030","id":91164,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"911:7:150","typeDescriptions":{"typeIdentifier":"t_rational_100000_by_1","typeString":"int_const 100000"},"value":"100_000"},"visibility":"internal"},{"id":91169,"nodeType":"VariableDeclaration","src":"981:42:150","nodes":[],"constant":true,"documentation":{"id":91166,"nodeType":"StructuredDocumentation","src":"925:51:150","text":"@notice The current message version identifier."},"functionSelector":"3f827a5a","mutability":"constant","name":"MESSAGE_VERSION","nameLocation":"1004:15:150","scope":91307,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint16","typeString":"uint16"},"typeName":{"id":91167,"name":"uint16","nodeType":"ElementaryTypeName","src":"981:6:150","typeDescriptions":{"typeIdentifier":"t_uint16","typeString":"uint16"}},"value":{"hexValue":"31","id":91168,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"1022:1:150","typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"visibility":"public"},{"id":91174,"nodeType":"VariableDeclaration","src":"1094:44:150","nodes":[],"constant":false,"documentation":{"id":91170,"nodeType":"StructuredDocumentation","src":"1030:59:150","text":"@notice Includes the message hashes for all withdrawals"},"functionSelector":"82e3702d","mutability":"mutable","name":"sentMessages","nameLocation":"1126:12:150","scope":91307,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"},"typeName":{"id":91173,"keyType":{"id":91171,"name":"bytes32","nodeType":"ElementaryTypeName","src":"1102:7:150","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"Mapping","src":"1094:24:150","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"},"valueType":{"id":91172,"name":"bool","nodeType":"ElementaryTypeName","src":"1113:4:150","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}},"visibility":"public"},{"id":91177,"nodeType":"VariableDeclaration","src":"1205:25:150","nodes":[],"constant":false,"documentation":{"id":91175,"nodeType":"StructuredDocumentation","src":"1145:55:150","text":"@notice A unique value hashed with each withdrawal."},"mutability":"mutable","name":"msgNonce","nameLocation":"1222:8:150","scope":91307,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint240","typeString":"uint240"},"typeName":{"id":91176,"name":"uint240","nodeType":"ElementaryTypeName","src":"1205:7:150","typeDescriptions":{"typeIdentifier":"t_uint240","typeString":"uint240"}},"visibility":"internal"},{"id":91194,"nodeType":"EventDefinition","src":"1869:222:150","nodes":[],"anonymous":false,"documentation":{"id":91178,"nodeType":"StructuredDocumentation","src":"1237:627:150","text":"@notice Emitted any time a withdrawal is initiated.\n @param nonce Unique value corresponding to each withdrawal.\n @param sender The L2 account address which initiated the withdrawal.\n @param target The L1 account address the call will be send to.\n @param value The ETH value submitted for withdrawal, to be forwarded to the target.\n @param gasLimit The minimum amount of gas that must be provided when withdrawing.\n @param data The data to be forwarded to the target on L1.\n @param withdrawalHash The hash of the withdrawal."},"eventSelector":"02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054","name":"MessagePassed","nameLocation":"1875:13:150","parameters":{"id":91193,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91180,"indexed":true,"mutability":"mutable","name":"nonce","nameLocation":"1914:5:150","nodeType":"VariableDeclaration","scope":91194,"src":"1898:21:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91179,"name":"uint256","nodeType":"ElementaryTypeName","src":"1898:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":91182,"indexed":true,"mutability":"mutable","name":"sender","nameLocation":"1945:6:150","nodeType":"VariableDeclaration","scope":91194,"src":"1929:22:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":91181,"name":"address","nodeType":"ElementaryTypeName","src":"1929:7:150","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":91184,"indexed":true,"mutability":"mutable","name":"target","nameLocation":"1977:6:150","nodeType":"VariableDeclaration","scope":91194,"src":"1961:22:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":91183,"name":"address","nodeType":"ElementaryTypeName","src":"1961:7:150","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":91186,"indexed":false,"mutability":"mutable","name":"value","nameLocation":"2001:5:150","nodeType":"VariableDeclaration","scope":91194,"src":"1993:13:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91185,"name":"uint256","nodeType":"ElementaryTypeName","src":"1993:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":91188,"indexed":false,"mutability":"mutable","name":"gasLimit","nameLocation":"2024:8:150","nodeType":"VariableDeclaration","scope":91194,"src":"2016:16:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91187,"name":"uint256","nodeType":"ElementaryTypeName","src":"2016:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":91190,"indexed":false,"mutability":"mutable","name":"data","nameLocation":"2048:4:150","nodeType":"VariableDeclaration","scope":91194,"src":"2042:10:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":91189,"name":"bytes","nodeType":"ElementaryTypeName","src":"2042:5:150","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"},{"constant":false,"id":91192,"indexed":false,"mutability":"mutable","name":"withdrawalHash","nameLocation":"2070:14:150","nodeType":"VariableDeclaration","scope":91194,"src":"2062:22:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":91191,"name":"bytes32","nodeType":"ElementaryTypeName","src":"2062:7:150","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"src":"1888:202:150"}},{"id":91199,"nodeType":"EventDefinition","src":"2219:53:150","nodes":[],"anonymous":false,"documentation":{"id":91195,"nodeType":"StructuredDocumentation","src":"2097:117:150","text":"@notice Emitted when the balance of this contract is burned.\n @param amount Amount of ETh that was burned."},"eventSelector":"7967de617a5ac1cc7eba2d6f37570a0135afa950d8bb77cdd35f0d0b4e85a16f","name":"WithdrawerBalanceBurnt","nameLocation":"2225:22:150","parameters":{"id":91198,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91197,"indexed":true,"mutability":"mutable","name":"amount","nameLocation":"2264:6:150","nodeType":"VariableDeclaration","scope":91199,"src":"2248:22:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91196,"name":"uint256","nodeType":"ElementaryTypeName","src":"2248:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2247:24:150"}},{"id":91203,"nodeType":"VariableDeclaration","src":"2307:40:150","nodes":[],"baseFunctions":[109416],"constant":true,"documentation":{"id":91200,"nodeType":"StructuredDocumentation","src":"2278:24:150","text":"@custom:semver 1.1.0"},"functionSelector":"54fd4d50","mutability":"constant","name":"version","nameLocation":"2330:7:150","scope":91307,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":91201,"name":"string","nodeType":"ElementaryTypeName","src":"2307:6:150","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"hexValue":"312e312e30","id":91202,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"2340:7:150","typeDescriptions":{"typeIdentifier":"t_stringliteral_6815ba53416ba06aff1932cc76b3832272bafab9bc8e066be382e32b06ba5546","typeString":"literal_string \"1.1.0\""},"value":"1.1.0"},"visibility":"public"},{"id":91218,"nodeType":"FunctionDefinition","src":"2437:112:150","nodes":[],"body":{"id":91217,"nodeType":"Block","src":"2464:85:150","nodes":[],"statements":[{"expression":{"arguments":[{"expression":{"id":91208,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"2493:3:150","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":91209,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","src":"2493:10:150","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":91210,"name":"RECEIVE_DEFAULT_GAS_LIMIT","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91165,"src":"2505:25:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"arguments":[{"hexValue":"","id":91213,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"2538:2:150","typeDescriptions":{"typeIdentifier":"t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","typeString":"literal_string \"\""},"value":""}],"expression":{"argumentTypes":[{"typeIdentifier":"t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","typeString":"literal_string \"\""}],"id":91212,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2532:5:150","typeDescriptions":{"typeIdentifier":"t_type$_t_bytes_storage_ptr_$","typeString":"type(bytes storage pointer)"},"typeName":{"id":91211,"name":"bytes","nodeType":"ElementaryTypeName","src":"2532:5:150","typeDescriptions":{}}},"id":91214,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2532:9:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"id":91207,"name":"initiateWithdrawal","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91293,"src":"2474:18:150","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$","typeString":"function (address,uint256,bytes memory)"}},"id":91215,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2474:68:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":91216,"nodeType":"ExpressionStatement","src":"2474:68:150"}]},"documentation":{"id":91204,"nodeType":"StructuredDocumentation","src":"2354:78:150","text":"@notice Allows users to withdraw ETH by sending directly to this contract."},"implemented":true,"kind":"receive","modifiers":[],"name":"","nameLocation":"-1:-1:-1","parameters":{"id":91205,"nodeType":"ParameterList","parameters":[],"src":"2444:2:150"},"returnParameters":{"id":91206,"nodeType":"ParameterList","parameters":[],"src":"2464:0:150"},"scope":91307,"stateMutability":"payable","virtual":false,"visibility":"external"},{"id":91241,"nodeType":"FunctionDefinition","src":"2915:154:150","nodes":[],"body":{"id":91240,"nodeType":"Block","src":"2940:129:150","nodes":[],"statements":[{"assignments":[91223],"declarations":[{"constant":false,"id":91223,"mutability":"mutable","name":"balance","nameLocation":"2958:7:150","nodeType":"VariableDeclaration","scope":91240,"src":"2950:15:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91222,"name":"uint256","nodeType":"ElementaryTypeName","src":"2950:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"id":91229,"initialValue":{"expression":{"arguments":[{"id":91226,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-28,"src":"2976:4:150","typeDescriptions":{"typeIdentifier":"t_contract$_L2ToL1MessagePasser_$91307","typeString":"contract L2ToL1MessagePasser"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_L2ToL1MessagePasser_$91307","typeString":"contract L2ToL1MessagePasser"}],"id":91225,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2968:7:150","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":{"id":91224,"name":"address","nodeType":"ElementaryTypeName","src":"2968:7:150","typeDescriptions":{}}},"id":91227,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2968:13:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":91228,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"balance","nodeType":"MemberAccess","src":"2968:21:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"VariableDeclarationStatement","src":"2950:39:150"},{"expression":{"arguments":[{"id":91233,"name":"balance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91223,"src":"3008:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"id":91230,"name":"Burn","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":102909,"src":"2999:4:150","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_Burn_$102909_$","typeString":"type(library Burn)"}},"id":91232,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"eth","nodeType":"MemberAccess","referencedDeclaration":102881,"src":"2999:8:150","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_uint256_$returns$__$","typeString":"function (uint256)"}},"id":91234,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2999:17:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":91235,"nodeType":"ExpressionStatement","src":"2999:17:150"},{"eventCall":{"arguments":[{"id":91237,"name":"balance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91223,"src":"3054:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":91236,"name":"WithdrawerBalanceBurnt","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91199,"src":"3031:22:150","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_uint256_$returns$__$","typeString":"function (uint256)"}},"id":91238,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3031:31:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":91239,"nodeType":"EmitStatement","src":"3026:36:150"}]},"documentation":{"id":91219,"nodeType":"StructuredDocumentation","src":"2555:355:150","text":"@notice Removes all ETH held by this contract from the state. Used to prevent the amount of\n ETH on L2 inflating when ETH is withdrawn. Currently only way to do this is to\n create a contract and self-destruct it to itself. Anyone can call this function. Not\n incentivized since this function is very cheap."},"functionSelector":"44df8e70","implemented":true,"kind":"function","modifiers":[],"name":"burn","nameLocation":"2924:4:150","parameters":{"id":91220,"nodeType":"ParameterList","parameters":[],"src":"2928:2:150"},"returnParameters":{"id":91221,"nodeType":"ParameterList","parameters":[],"src":"2940:0:150"},"scope":91307,"stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"id":91293,"nodeType":"FunctionDefinition","src":"3311:650:150","nodes":[],"body":{"id":91292,"nodeType":"Block","src":"3410:551:150","nodes":[],"statements":[{"assignments":[91252],"declarations":[{"constant":false,"id":91252,"mutability":"mutable","name":"withdrawalHash","nameLocation":"3428:14:150","nodeType":"VariableDeclaration","scope":91292,"src":"3420:22:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"},"typeName":{"id":91251,"name":"bytes32","nodeType":"ElementaryTypeName","src":"3420:7:150","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"visibility":"internal"}],"id":91268,"initialValue":{"arguments":[{"arguments":[{"arguments":[],"expression":{"argumentTypes":[],"id":91257,"name":"messageNonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91306,"src":"3534:12:150","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_uint256_$","typeString":"function () view returns (uint256)"}},"id":91258,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3534:14:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"id":91259,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"3574:3:150","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":91260,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","src":"3574:10:150","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":91261,"name":"_target","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91244,"src":"3610:7:150","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"expression":{"id":91262,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"3642:3:150","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":91263,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"value","nodeType":"MemberAccess","src":"3642:9:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":91264,"name":"_gasLimit","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91246,"src":"3679:9:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":91265,"name":"_data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91248,"src":"3712:5:150","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}],"expression":{"id":91255,"name":"Types","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":104349,"src":"3481:5:150","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_Types_$104349_$","typeString":"type(library Types)"}},"id":91256,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"WithdrawalTransaction","nodeType":"MemberAccess","referencedDeclaration":104348,"src":"3481:27:150","typeDescriptions":{"typeIdentifier":"t_type$_t_struct$_WithdrawalTransaction_$104348_storage_ptr_$","typeString":"type(struct Types.WithdrawalTransaction storage pointer)"}},"id":91266,"isConstant":false,"isLValue":false,"isPure":false,"kind":"structConstructorCall","lValueRequested":false,"names":["nonce","sender","target","value","gasLimit","data"],"nodeType":"FunctionCall","src":"3481:251:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_struct$_WithdrawalTransaction_$104348_memory_ptr","typeString":"struct Types.WithdrawalTransaction memory"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_struct$_WithdrawalTransaction_$104348_memory_ptr","typeString":"struct Types.WithdrawalTransaction memory"}],"expression":{"id":91253,"name":"Hashing","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103936,"src":"3445:7:150","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_Hashing_$103936_$","typeString":"type(library Hashing)"}},"id":91254,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"hashWithdrawal","nodeType":"MemberAccess","referencedDeclaration":103911,"src":"3445:22:150","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_struct$_WithdrawalTransaction_$104348_memory_ptr_$returns$_t_bytes32_$","typeString":"function (struct Types.WithdrawalTransaction memory) pure returns (bytes32)"}},"id":91267,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3445:297:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"nodeType":"VariableDeclarationStatement","src":"3420:322:150"},{"expression":{"id":91273,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"baseExpression":{"id":91269,"name":"sentMessages","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91174,"src":"3753:12:150","typeDescriptions":{"typeIdentifier":"t_mapping$_t_bytes32_$_t_bool_$","typeString":"mapping(bytes32 => bool)"}},"id":91271,"indexExpression":{"id":91270,"name":"withdrawalHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91252,"src":"3766:14:150","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"3753:28:150","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"hexValue":"74727565","id":91272,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"3784:4:150","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"src":"3753:35:150","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"id":91274,"nodeType":"ExpressionStatement","src":"3753:35:150"},{"eventCall":{"arguments":[{"arguments":[],"expression":{"argumentTypes":[],"id":91276,"name":"messageNonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91306,"src":"3818:12:150","typeDescriptions":{"typeIdentifier":"t_function_internal_view$__$returns$_t_uint256_$","typeString":"function () view returns (uint256)"}},"id":91277,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3818:14:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"expression":{"id":91278,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"3834:3:150","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":91279,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","src":"3834:10:150","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"id":91280,"name":"_target","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91244,"src":"3846:7:150","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"expression":{"id":91281,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":-15,"src":"3855:3:150","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":91282,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"value","nodeType":"MemberAccess","src":"3855:9:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":91283,"name":"_gasLimit","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91246,"src":"3866:9:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},{"id":91284,"name":"_data","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91248,"src":"3877:5:150","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"}},{"id":91285,"name":"withdrawalHash","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91252,"src":"3884:14:150","typeDescriptions":{"typeIdentifier":"t_bytes32","typeString":"bytes32"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_uint256","typeString":"uint256"},{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes memory"},{"typeIdentifier":"t_bytes32","typeString":"bytes32"}],"id":91275,"name":"MessagePassed","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91194,"src":"3804:13:150","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_uint256_$_t_uint256_$_t_bytes_memory_ptr_$_t_bytes32_$returns$__$","typeString":"function (uint256,address,address,uint256,uint256,bytes memory,bytes32)"}},"id":91286,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"3804:95:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":91287,"nodeType":"EmitStatement","src":"3799:100:150"},{"id":91291,"nodeType":"UncheckedBlock","src":"3910:45:150","statements":[{"expression":{"id":91289,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"++","prefix":true,"src":"3934:10:150","subExpression":{"id":91288,"name":"msgNonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91177,"src":"3936:8:150","typeDescriptions":{"typeIdentifier":"t_uint240","typeString":"uint240"}},"typeDescriptions":{"typeIdentifier":"t_uint240","typeString":"uint240"}},"id":91290,"nodeType":"ExpressionStatement","src":"3934:10:150"}]}]},"documentation":{"id":91242,"nodeType":"StructuredDocumentation","src":"3075:231:150","text":"@notice Sends a message from L2 to L1.\n @param _target Address to call on L1 execution.\n @param _gasLimit Minimum gas limit for executing the message on L1.\n @param _data Data to forward to L1 target."},"functionSelector":"c2b3e5ac","implemented":true,"kind":"function","modifiers":[],"name":"initiateWithdrawal","nameLocation":"3320:18:150","parameters":{"id":91249,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91244,"mutability":"mutable","name":"_target","nameLocation":"3347:7:150","nodeType":"VariableDeclaration","scope":91293,"src":"3339:15:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":91243,"name":"address","nodeType":"ElementaryTypeName","src":"3339:7:150","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":91246,"mutability":"mutable","name":"_gasLimit","nameLocation":"3364:9:150","nodeType":"VariableDeclaration","scope":91293,"src":"3356:17:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91245,"name":"uint256","nodeType":"ElementaryTypeName","src":"3356:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":91248,"mutability":"mutable","name":"_data","nameLocation":"3388:5:150","nodeType":"VariableDeclaration","scope":91293,"src":"3375:18:150","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":91247,"name":"bytes","nodeType":"ElementaryTypeName","src":"3375:5:150","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"3338:56:150"},"returnParameters":{"id":91250,"nodeType":"ParameterList","parameters":[],"src":"3410:0:150"},"scope":91307,"stateMutability":"payable","virtual":false,"visibility":"public"},{"id":91306,"nodeType":"FunctionDefinition","src":"4282:134:150","nodes":[],"body":{"id":91305,"nodeType":"Block","src":"4336:80:150","nodes":[],"statements":[{"expression":{"arguments":[{"id":91301,"name":"msgNonce","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91177,"src":"4383:8:150","typeDescriptions":{"typeIdentifier":"t_uint240","typeString":"uint240"}},{"id":91302,"name":"MESSAGE_VERSION","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":91169,"src":"4393:15:150","typeDescriptions":{"typeIdentifier":"t_uint16","typeString":"uint16"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint240","typeString":"uint240"},{"typeIdentifier":"t_uint16","typeString":"uint16"}],"expression":{"id":91299,"name":"Encoding","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":103714,"src":"4353:8:150","typeDescriptions":{"typeIdentifier":"t_type$_t_contract$_Encoding_$103714_$","typeString":"type(library Encoding)"}},"id":91300,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"encodeVersionedNonce","nodeType":"MemberAccess","referencedDeclaration":103643,"src":"4353:29:150","typeDescriptions":{"typeIdentifier":"t_function_internal_pure$_t_uint240_$_t_uint16_$returns$_t_uint256_$","typeString":"function (uint240,uint16) pure returns (uint256)"}},"id":91303,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"4353:56:150","tryCall":false,"typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"functionReturnParameters":91298,"id":91304,"nodeType":"Return","src":"4346:63:150"}]},"documentation":{"id":91294,"nodeType":"StructuredDocumentation","src":"3967:310:150","text":"@notice Retrieves the next message nonce. Message version will be added to the upper two\n bytes of the message nonce. Message version allows us to treat messages as having\n different structures.\n @return Nonce of the next message to be sent, with added message version."},"functionSelector":"ecc70428","implemented":true,"kind":"function","modifiers":[],"name":"messageNonce","nameLocation":"4291:12:150","parameters":{"id":91295,"nodeType":"ParameterList","parameters":[],"src":"4303:2:150"},"returnParameters":{"id":91298,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91297,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":91306,"src":"4327:7:150","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":91296,"name":"uint256","nodeType":"ElementaryTypeName","src":"4327:7:150","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"4326:9:150"},"scope":91307,"stateMutability":"view","virtual":false,"visibility":"public"}],"abstract":false,"baseContracts":[{"baseName":{"id":91160,"name":"ISemver","nodeType":"IdentifierPath","referencedDeclaration":109417,"src":"754:7:150"},"id":91161,"nodeType":"InheritanceSpecifier","src":"754:7:150"}],"canonicalName":"L2ToL1MessagePasser","contractDependencies":[102925],"contractKind":"contract","documentation":{"id":91159,"nodeType":"StructuredDocumentation","src":"315:407:150","text":"@custom:proxied\n @custom:predeploy 0x4200000000000000000000000000000000000016\n @title L2ToL1MessagePasser\n @notice The L2ToL1MessagePasser is a dedicated contract where messages that are being sent from\n L2 to L1 can be stored. The storage root of this contract is pulled up to the top level\n of the L2 output to reduce the cost of proving the existence of sent messages."},"fullyImplemented":true,"linearizedBaseContracts":[91307,109417],"name":"L2ToL1MessagePasser","nameLocation":"731:19:150","scope":91308,"usedErrors":[]}],"license":"MIT"},"id":150}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"abi":[{"type":"fallback","stateMutability":"payable"},{"type":"function","name":"allowance","inputs":[{"name":"","type":"address","internalType":"address"},{"name":"","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"approve","inputs":[{"name":"guy","type":"address","internalType":"address"},{"name":"wad","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"balanceOf","inputs":[{"name":"","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint8","internalType":"uint8"}],"stateMutability":"view"},{"type":"function","name":"deposit","inputs":[],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"view"},{"type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"transfer","inputs":[{"name":"dst","type":"address","internalType":"address"},{"name":"wad","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"transferFrom","inputs":[{"name":"src","type":"address","internalType":"address"},{"name":"dst","type":"address","internalType":"address"},{"name":"wad","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"nonpayable"},{"type":"function","name":"withdraw","inputs":[{"name":"wad","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"Approval","inputs":[{"name":"src","type":"address","indexed":true,"internalType":"address"},{"name":"guy","type":"address","indexed":true,"internalType":"address"},{"name":"wad","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"name":"dst","type":"address","indexed":true,"internalType":"address"},{"name":"wad","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"name":"src","type":"address","indexed":true,"internalType":"address"},{"name":"dst","type":"address","indexed":true,"internalType":"address"},{"name":"wad","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Withdrawal","inputs":[{"name":"src","type":"address","indexed":true,"internalType":"address"},{"name":"wad","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false}],"bytecode":{"object":"0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b50610115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b61011291905b808211156100f457600081556001016100fe565b90565b6107f9806101246000396000f3fe6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a72315820d9a21886186e04516cbdaa611a54950fabc4d47164691bf70de28f6c54060de964736f6c63430005110032","sourceMap":"739:40:0:-;718:1809;739:40;;718:1809;739:40;;;-1:-1:-1;;;739:40:0;;;;;;-1:-1:-1;;739:40:0;;:::i;:::-;-1:-1:-1;785:31:0;;;;;;;;;;;;;-1:-1:-1;;;785:31:0;;;;;;;;;;;;:::i;:::-;-1:-1:-1;822:27:0;;;-1:-1:-1;;822:27:0;847:2;822:27;;;718:1809;5:2:-1;;;;30:1;27;20:12;5:2;718:1809:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;718:1809:0;;;-1:-1:-1;718:1809:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a72315820d9a21886186e04516cbdaa611a54950fabc4d47164691bf70de28f6c54060de964736f6c63430005110032","sourceMap":"718:1809:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1289:9;:7;:9::i;:::-;718:1809;739:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;739:40:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;739:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1755:177;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1755:177:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1755:177:0;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1654:95;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1654:95:0;;;:::i;:::-;;;;;;;;;;;;;;;;2065:460;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2065:460:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2065:460:0;;;;;;;;;;;;;;;;;;:::i;1445:203::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1445:203:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1445:203:0;;:::i;822:27::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;822:27:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1108:65;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1108:65:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1108:65:0;;;;:::i;785:31::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;785:31:0;;;:::i;1938:121::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1938:121:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1938:121:0;;;;;;;;;:::i;1179:65::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1179:65:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1179:65:0;;;;;;;;;;;:::i;1310:130::-;1364:10;1354:21;;;;:9;:21;;;;;;;;;:34;;1379:9;1354:34;;;;;;1403:30;;;;;;;;;;;;;;;;;1310:130::o;739:40::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1755:177::-;1837:10;1811:4;1827:21;;;:9;:21;;;;;;;;;:26;;;;;;;;;;;:32;;;1874:30;;;;;;;1811:4;;1827:26;;1837:10;;1874:30;;;;;;;;-1:-1:-1;1921:4:0;1755:177;;;;:::o;1654:95::-;1721:21;1654:95;:::o;2065:460::-;2183:14;;;2155:4;2183:14;;;:9;:14;;;;;;:21;-1:-1:-1;2183:21:0;2175:30;;;;;;2220:17;;;2227:10;2220:17;;;;:59;;-1:-1:-1;2241:14:0;;;;;;;:9;:14;;;;;;;;2256:10;2241:26;;;;;;;;2276:2;2241:38;;2220:59;2216:179;;;2303:14;;;;;;;:9;:14;;;;;;;;2318:10;2303:26;;;;;;;;:33;-1:-1:-1;2303:33:0;2295:42;;;;;;2351:14;;;;;;;:9;:14;;;;;;;;2366:10;2351:26;;;;;;;:33;;;;;;;2216:179;2405:14;;;;;;;;:9;:14;;;;;;;;:21;;;;;;;2436:14;;;;;;;;;;:21;;;;;;2473:23;;;;;;;2436:14;;2473:23;;;;;;;;;;;-1:-1:-1;2514:4:0;2065:460;;;;;:::o;1445:203::-;1508:10;1498:21;;;;:9;:21;;;;;;:28;-1:-1:-1;1498:28:0;1490:37;;;;;;1547:10;1537:21;;;;:9;:21;;;;;;:28;;;;;;;1575:24;;;;;;1562:3;;1575:24;;1537:21;1575:24;1562:3;1547:10;1575:24;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1614:27:0;;;;;;;;1625:10;;1614:27;;;;;;;;;;1445:203;:::o;822:27::-;;;;;;:::o;1108:65::-;;;;;;;;;;;;;:::o;785:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1938:121;1995:4;2018:34;2031:10;2043:3;2048;2018:12;:34::i;:::-;2011:41;1938:121;-1:-1:-1;;;1938:121:0:o;1179:65::-;;;;;;;;;;;;;;;;;;;;;;;;:::o","linkReferences":{}},"methodIdentifiers":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","decimals()":"313ce567","deposit()":"d0e30db0","name()":"06fdde03","symbol()":"95d89b41","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd","withdraw(uint256)":"2e1a7d4d"},"rawMetadata":"{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"src/vendor/WETH9.sol\":\"WETH9\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[\":@lib-keccak/=lib/lib-keccak/contracts/lib/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@rari-capital/solmate/=lib/solmate/\",\":@solady-test/=lib/lib-keccak/lib/solady/test/\",\":@solady/=lib/solady/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/\",\":lib-keccak/=lib/lib-keccak/contracts/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":safe-contracts/=lib/safe-contracts/contracts/\",\":solady/=lib/solady/\",\":solmate/=lib/solmate/src/\"]},\"sources\":{\"src/vendor/WETH9.sol\":{\"keccak256\":\"0x5cf72b1d2b0f0a758d5540c663352aa757c80a975c2e2d9b22cc6bc9f1ada1a1\",\"urls\":[\"bzz-raw://aba380794ab2878afe942d0c093cb41820afa854182668af91bffa3f26492244\",\"dweb:/ipfs/QmTW9EWupsNX3DgoJc13uu2V3P4UPRErvaVCPmLyCbDnM1\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.5.17+commit.d19bba13"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"src","type":"address","indexed":true},{"internalType":"address","name":"guy","type":"address","indexed":true},{"internalType":"uint256","name":"wad","type":"uint256","indexed":false}],"type":"event","name":"Approval","anonymous":false},{"inputs":[{"internalType":"address","name":"dst","type":"address","indexed":true},{"internalType":"uint256","name":"wad","type":"uint256","indexed":false}],"type":"event","name":"Deposit","anonymous":false},{"inputs":[{"internalType":"address","name":"src","type":"address","indexed":true},{"internalType":"address","name":"dst","type":"address","indexed":true},{"internalType":"uint256","name":"wad","type":"uint256","indexed":false}],"type":"event","name":"Transfer","anonymous":false},{"inputs":[{"internalType":"address","name":"src","type":"address","indexed":true},{"internalType":"uint256","name":"wad","type":"uint256","indexed":false}],"type":"event","name":"Withdrawal","anonymous":false},{"inputs":[],"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"address","name":"guy","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}]},{"inputs":[],"stateMutability":"payable","type":"function","name":"deposit"},{"inputs":[],"stateMutability":"view","type":"function","name":"name","outputs":[{"internalType":"string","name":"","type":"string"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"uint256","name":"wad","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"withdraw"}],"devdoc":{"methods":{}},"userdoc":{"methods":{}}},"settings":{"remappings":["@lib-keccak/=lib/lib-keccak/contracts/lib/","@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","@rari-capital/solmate/=lib/solmate/","@solady-test/=lib/lib-keccak/lib/solady/test/","@solady/=lib/solady/src/","ds-test/=lib/forge-std/lib/ds-test/src/","forge-std/=lib/forge-std/src/","kontrol-cheatcodes/=lib/kontrol-cheatcodes/src/","lib-keccak/=lib/lib-keccak/contracts/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","safe-contracts/=lib/safe-contracts/contracts/","solady/=lib/solady/","solmate/=lib/solmate/src/"],"optimizer":{"enabled":true,"runs":999999},"compilationTarget":{"src/vendor/WETH9.sol":"WETH9"},"evmVersion":"istanbul","libraries":{}},"sources":{"src/vendor/WETH9.sol":{"keccak256":"0x5cf72b1d2b0f0a758d5540c663352aa757c80a975c2e2d9b22cc6bc9f1ada1a1","urls":["bzz-raw://aba380794ab2878afe942d0c093cb41820afa854182668af91bffa3f26492244","dweb:/ipfs/QmTW9EWupsNX3DgoJc13uu2V3P4UPRErvaVCPmLyCbDnM1"],"license":null}},"version":1},"storageLayout":{"storage":[{"astId":4,"contract":"src/vendor/WETH9.sol:WETH9","label":"name","offset":0,"slot":"0","type":"t_string_storage"},{"astId":7,"contract":"src/vendor/WETH9.sol:WETH9","label":"symbol","offset":0,"slot":"1","type":"t_string_storage"},{"astId":10,"contract":"src/vendor/WETH9.sol:WETH9","label":"decimals","offset":0,"slot":"2","type":"t_uint8"},{"astId":42,"contract":"src/vendor/WETH9.sol:WETH9","label":"balanceOf","offset":0,"slot":"3","type":"t_mapping(t_address,t_uint256)"},{"astId":48,"contract":"src/vendor/WETH9.sol:WETH9","label":"allowance","offset":0,"slot":"4","type":"t_mapping(t_address,t_mapping(t_address,t_uint256))"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_mapping(t_address,t_mapping(t_address,t_uint256))":{"encoding":"mapping","key":"t_address","label":"mapping(address => mapping(address => uint256))","numberOfBytes":"32","value":"t_mapping(t_address,t_uint256)"},"t_mapping(t_address,t_uint256)":{"encoding":"mapping","key":"t_address","label":"mapping(address => uint256)","numberOfBytes":"32","value":"t_uint256"},"t_string_storage":{"encoding":"bytes","label":"string","numberOfBytes":"32"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"},"t_uint8":{"encoding":"inplace","label":"uint8","numberOfBytes":"1"}}},"userdoc":{},"devdoc":{},"ast":{"absolutePath":"src/vendor/WETH9.sol","id":246,"exportedSymbols":{"WETH9":[245]},"nodeType":"SourceUnit","src":"686:36998:0","nodes":[{"id":1,"nodeType":"PragmaDirective","src":"686:30:0","nodes":[],"literals":["solidity",">=","0.4",".22","<","0.6"]},{"id":245,"nodeType":"ContractDefinition","src":"718:1809:0","nodes":[{"id":4,"nodeType":"VariableDeclaration","src":"739:40:0","nodes":[],"constant":false,"name":"name","scope":245,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage","typeString":"string"},"typeName":{"id":2,"name":"string","nodeType":"ElementaryTypeName","src":"739:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"argumentTypes":null,"hexValue":"57726170706564204574686572","id":3,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"764:15:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_00cd3d46df44f2cbb950cf84eb2e92aa2ddd23195b1a009173ea59a063357ed3","typeString":"literal_string \"Wrapped Ether\""},"value":"Wrapped Ether"},"visibility":"public"},{"id":7,"nodeType":"VariableDeclaration","src":"785:31:0","nodes":[],"constant":false,"name":"symbol","scope":245,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage","typeString":"string"},"typeName":{"id":5,"name":"string","nodeType":"ElementaryTypeName","src":"785:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"value":{"argumentTypes":null,"hexValue":"57455448","id":6,"isConstant":false,"isLValue":false,"isPure":true,"kind":"string","lValueRequested":false,"nodeType":"Literal","src":"810:6:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_stringliteral_0f8a193ff464434486c0daf7db2a895884365d2bc84ba47a68fcf89c1b14b5b8","typeString":"literal_string \"WETH\""},"value":"WETH"},"visibility":"public"},{"id":10,"nodeType":"VariableDeclaration","src":"822:27:0","nodes":[],"constant":false,"name":"decimals","scope":245,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"},"typeName":{"id":8,"name":"uint8","nodeType":"ElementaryTypeName","src":"822:5:0","typeDescriptions":{"typeIdentifier":"t_uint8","typeString":"uint8"}},"value":{"argumentTypes":null,"hexValue":"3138","id":9,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"847:2:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_18_by_1","typeString":"int_const 18"},"value":"18"},"visibility":"public"},{"id":18,"nodeType":"EventDefinition","src":"856:68:0","nodes":[],"anonymous":false,"documentation":null,"name":"Approval","parameters":{"id":17,"nodeType":"ParameterList","parameters":[{"constant":false,"id":12,"indexed":true,"name":"src","nodeType":"VariableDeclaration","scope":18,"src":"872:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":11,"name":"address","nodeType":"ElementaryTypeName","src":"872:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":14,"indexed":true,"name":"guy","nodeType":"VariableDeclaration","scope":18,"src":"893:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":13,"name":"address","nodeType":"ElementaryTypeName","src":"893:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":16,"indexed":false,"name":"wad","nodeType":"VariableDeclaration","scope":18,"src":"914:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":15,"name":"uint","nodeType":"ElementaryTypeName","src":"914:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"871:52:0"}},{"id":26,"nodeType":"EventDefinition","src":"929:68:0","nodes":[],"anonymous":false,"documentation":null,"name":"Transfer","parameters":{"id":25,"nodeType":"ParameterList","parameters":[{"constant":false,"id":20,"indexed":true,"name":"src","nodeType":"VariableDeclaration","scope":26,"src":"945:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":19,"name":"address","nodeType":"ElementaryTypeName","src":"945:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":22,"indexed":true,"name":"dst","nodeType":"VariableDeclaration","scope":26,"src":"966:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":21,"name":"address","nodeType":"ElementaryTypeName","src":"966:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":24,"indexed":false,"name":"wad","nodeType":"VariableDeclaration","scope":26,"src":"987:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":23,"name":"uint","nodeType":"ElementaryTypeName","src":"987:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"944:52:0"}},{"id":32,"nodeType":"EventDefinition","src":"1002:46:0","nodes":[],"anonymous":false,"documentation":null,"name":"Deposit","parameters":{"id":31,"nodeType":"ParameterList","parameters":[{"constant":false,"id":28,"indexed":true,"name":"dst","nodeType":"VariableDeclaration","scope":32,"src":"1017:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":27,"name":"address","nodeType":"ElementaryTypeName","src":"1017:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":30,"indexed":false,"name":"wad","nodeType":"VariableDeclaration","scope":32,"src":"1038:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":29,"name":"uint","nodeType":"ElementaryTypeName","src":"1038:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1016:31:0"}},{"id":38,"nodeType":"EventDefinition","src":"1053:49:0","nodes":[],"anonymous":false,"documentation":null,"name":"Withdrawal","parameters":{"id":37,"nodeType":"ParameterList","parameters":[{"constant":false,"id":34,"indexed":true,"name":"src","nodeType":"VariableDeclaration","scope":38,"src":"1071:19:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":33,"name":"address","nodeType":"ElementaryTypeName","src":"1071:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":36,"indexed":false,"name":"wad","nodeType":"VariableDeclaration","scope":38,"src":"1092:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":35,"name":"uint","nodeType":"ElementaryTypeName","src":"1092:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1070:31:0"}},{"id":42,"nodeType":"VariableDeclaration","src":"1108:65:0","nodes":[],"constant":false,"name":"balanceOf","scope":245,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"},"typeName":{"id":41,"keyType":{"id":39,"name":"address","nodeType":"ElementaryTypeName","src":"1117:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1108:25:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"},"valueType":{"id":40,"name":"uint","nodeType":"ElementaryTypeName","src":"1128:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}},"value":null,"visibility":"public"},{"id":48,"nodeType":"VariableDeclaration","src":"1179:65:0","nodes":[],"constant":false,"name":"allowance","scope":245,"stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"},"typeName":{"id":47,"keyType":{"id":43,"name":"address","nodeType":"ElementaryTypeName","src":"1188:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1179:46:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"},"valueType":{"id":46,"keyType":{"id":44,"name":"address","nodeType":"ElementaryTypeName","src":"1208:7:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"Mapping","src":"1199:25:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"},"valueType":{"id":45,"name":"uint","nodeType":"ElementaryTypeName","src":"1219:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}}},"value":null,"visibility":"public"},{"id":55,"nodeType":"FunctionDefinition","src":"1251:54:0","nodes":[],"body":{"id":54,"nodeType":"Block","src":"1279:26:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"arguments":[],"expression":{"argumentTypes":[],"id":51,"name":"deposit","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":74,"src":"1289:7:0","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$__$returns$__$","typeString":"function ()"}},"id":52,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1289:9:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":53,"nodeType":"ExpressionStatement","src":"1289:9:0"}]},"documentation":null,"implemented":true,"kind":"fallback","modifiers":[],"name":"","parameters":{"id":49,"nodeType":"ParameterList","parameters":[],"src":"1259:2:0"},"returnParameters":{"id":50,"nodeType":"ParameterList","parameters":[],"src":"1279:0:0"},"scope":245,"stateMutability":"payable","superFunction":null,"visibility":"external"},{"id":74,"nodeType":"FunctionDefinition","src":"1310:130:0","nodes":[],"body":{"id":73,"nodeType":"Block","src":"1344:96:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"id":64,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":58,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"1354:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":61,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":59,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1364:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":60,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1364:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"1354:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":62,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1379:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":63,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"value","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1379:9:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1354:34:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":65,"nodeType":"ExpressionStatement","src":"1354:34:0"},{"eventCall":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":67,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1411:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":68,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1411:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},{"argumentTypes":null,"expression":{"argumentTypes":null,"id":69,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1423:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":70,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"value","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1423:9:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address_payable","typeString":"address payable"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":66,"name":"Deposit","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":32,"src":"1403:7:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$","typeString":"function (address,uint256)"}},"id":71,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1403:30:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":72,"nodeType":"EmitStatement","src":"1398:35:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"deposit","parameters":{"id":56,"nodeType":"ParameterList","parameters":[],"src":"1326:2:0"},"returnParameters":{"id":57,"nodeType":"ParameterList","parameters":[],"src":"1344:0:0"},"scope":245,"stateMutability":"payable","superFunction":null,"visibility":"public"},{"id":110,"nodeType":"FunctionDefinition","src":"1445:203:0","nodes":[],"body":{"id":109,"nodeType":"Block","src":"1480:168:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":85,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":80,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"1498:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":83,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":81,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1508:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":82,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1508:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"1498:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"id":84,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1523:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1498:28:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":79,"name":"require","nodeType":"Identifier","overloadedDeclarations":[263,264],"referencedDeclaration":263,"src":"1490:7:0","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":86,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1490:37:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":87,"nodeType":"ExpressionStatement","src":"1490:37:0"},{"expression":{"argumentTypes":null,"id":93,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":88,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"1537:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":91,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":89,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1547:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":90,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1547:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"1537:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"-=","rightHandSide":{"argumentTypes":null,"id":92,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1562:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1537:28:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":94,"nodeType":"ExpressionStatement","src":"1537:28:0"},{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":100,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1595:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_uint256","typeString":"uint256"}],"expression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":95,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1575:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":98,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1575:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"id":99,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"transfer","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1575:19:0","typeDescriptions":{"typeIdentifier":"t_function_transfer_nonpayable$_t_uint256_$returns$__$","typeString":"function (uint256)"}},"id":101,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1575:24:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":102,"nodeType":"ExpressionStatement","src":"1575:24:0"},{"eventCall":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":104,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1625:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":105,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1625:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},{"argumentTypes":null,"id":106,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":76,"src":"1637:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address_payable","typeString":"address payable"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":103,"name":"Withdrawal","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":38,"src":"1614:10:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$","typeString":"function (address,uint256)"}},"id":107,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1614:27:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":108,"nodeType":"EmitStatement","src":"1609:32:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"withdraw","parameters":{"id":77,"nodeType":"ParameterList","parameters":[{"constant":false,"id":76,"name":"wad","nodeType":"VariableDeclaration","scope":110,"src":"1463:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":75,"name":"uint","nodeType":"ElementaryTypeName","src":"1463:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1462:10:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[],"src":"1480:0:0"},"scope":245,"stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"id":121,"nodeType":"FunctionDefinition","src":"1654:95:0","nodes":[],"body":{"id":120,"nodeType":"Block","src":"1704:45:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":116,"name":"this","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":274,"src":"1729:4:0","typeDescriptions":{"typeIdentifier":"t_contract$_WETH9_$245","typeString":"contract WETH9"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_contract$_WETH9_$245","typeString":"contract WETH9"}],"id":115,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"1721:7:0","typeDescriptions":{"typeIdentifier":"t_type$_t_address_$","typeString":"type(address)"},"typeName":"address"},"id":117,"isConstant":false,"isLValue":false,"isPure":false,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1721:13:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"id":118,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"balance","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1721:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"functionReturnParameters":114,"id":119,"nodeType":"Return","src":"1714:28:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"totalSupply","parameters":{"id":111,"nodeType":"ParameterList","parameters":[],"src":"1674:2:0"},"returnParameters":{"id":114,"nodeType":"ParameterList","parameters":[{"constant":false,"id":113,"name":"","nodeType":"VariableDeclaration","scope":121,"src":"1698:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":112,"name":"uint","nodeType":"ElementaryTypeName","src":"1698:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1697:6:0"},"scope":245,"stateMutability":"view","superFunction":null,"visibility":"public"},{"id":149,"nodeType":"FunctionDefinition","src":"1755:177:0","nodes":[],"body":{"id":148,"nodeType":"Block","src":"1817:115:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"id":137,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":130,"name":"allowance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":48,"src":"1827:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"}},"id":134,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":131,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1837:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":132,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1837:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"1827:21:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":135,"indexExpression":{"argumentTypes":null,"id":133,"name":"guy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":123,"src":"1849:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"1827:26:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"=","rightHandSide":{"argumentTypes":null,"id":136,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":125,"src":"1856:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"1827:32:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":138,"nodeType":"ExpressionStatement","src":"1827:32:0"},{"eventCall":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":140,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"1883:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":141,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"1883:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},{"argumentTypes":null,"id":142,"name":"guy","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":123,"src":"1895:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":143,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":125,"src":"1900:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address_payable","typeString":"address payable"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":139,"name":"Approval","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":18,"src":"1874:8:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$","typeString":"function (address,address,uint256)"}},"id":144,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"1874:30:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":145,"nodeType":"EmitStatement","src":"1869:35:0"},{"expression":{"argumentTypes":null,"hexValue":"74727565","id":146,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"1921:4:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"functionReturnParameters":129,"id":147,"nodeType":"Return","src":"1914:11:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"approve","parameters":{"id":126,"nodeType":"ParameterList","parameters":[{"constant":false,"id":123,"name":"guy","nodeType":"VariableDeclaration","scope":149,"src":"1772:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":122,"name":"address","nodeType":"ElementaryTypeName","src":"1772:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":125,"name":"wad","nodeType":"VariableDeclaration","scope":149,"src":"1785:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":124,"name":"uint","nodeType":"ElementaryTypeName","src":"1785:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1771:23:0"},"returnParameters":{"id":129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":128,"name":"","nodeType":"VariableDeclaration","scope":149,"src":"1811:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":127,"name":"bool","nodeType":"ElementaryTypeName","src":"1811:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"1810:6:0"},"scope":245,"stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"id":166,"nodeType":"FunctionDefinition","src":"1938:121:0","nodes":[],"body":{"id":165,"nodeType":"Block","src":"2001:58:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"expression":{"argumentTypes":null,"id":159,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"2031:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":160,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2031:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},{"argumentTypes":null,"id":161,"name":"dst","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":151,"src":"2043:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":162,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":153,"src":"2048:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address_payable","typeString":"address payable"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":158,"name":"transferFrom","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":244,"src":"2018:12:0","typeDescriptions":{"typeIdentifier":"t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$","typeString":"function (address,address,uint256) returns (bool)"}},"id":163,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2018:34:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"functionReturnParameters":157,"id":164,"nodeType":"Return","src":"2011:41:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"transfer","parameters":{"id":154,"nodeType":"ParameterList","parameters":[{"constant":false,"id":151,"name":"dst","nodeType":"VariableDeclaration","scope":166,"src":"1956:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":150,"name":"address","nodeType":"ElementaryTypeName","src":"1956:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":153,"name":"wad","nodeType":"VariableDeclaration","scope":166,"src":"1969:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":152,"name":"uint","nodeType":"ElementaryTypeName","src":"1969:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"1955:23:0"},"returnParameters":{"id":157,"nodeType":"ParameterList","parameters":[{"constant":false,"id":156,"name":"","nodeType":"VariableDeclaration","scope":166,"src":"1995:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":155,"name":"bool","nodeType":"ElementaryTypeName","src":"1995:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"1994:6:0"},"scope":245,"stateMutability":"nonpayable","superFunction":null,"visibility":"public"},{"id":244,"nodeType":"FunctionDefinition","src":"2065:460:0","nodes":[],"body":{"id":243,"nodeType":"Block","src":"2165:360:0","nodes":[],"statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":182,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":178,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"2183:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":180,"indexExpression":{"argumentTypes":null,"id":179,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2193:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2183:14:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"id":181,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2201:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2183:21:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":177,"name":"require","nodeType":"Identifier","overloadedDeclarations":[263,264],"referencedDeclaration":263,"src":"2175:7:0","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":183,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2175:30:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":184,"nodeType":"ExpressionStatement","src":"2175:30:0"},{"condition":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_bool","typeString":"bool"},"id":200,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_address","typeString":"address"},"id":188,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"id":185,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2220:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":186,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"2227:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":187,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2227:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"src":"2220:17:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"nodeType":"BinaryOperation","operator":"&&","rightExpression":{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":199,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":189,"name":"allowance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":48,"src":"2241:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"}},"id":191,"indexExpression":{"argumentTypes":null,"id":190,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2251:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2241:14:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":194,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":192,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"2256:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":193,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2256:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2241:26:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":"!=","rightExpression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":197,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"UnaryOperation","operator":"-","prefix":true,"src":"2276:2:0","subExpression":{"argumentTypes":null,"hexValue":"31","id":196,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"2277:1:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_rational_1_by_1","typeString":"int_const 1"},"value":"1"},"typeDescriptions":{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_rational_minus_1_by_1","typeString":"int_const -1"}],"id":195,"isConstant":false,"isLValue":false,"isPure":true,"lValueRequested":false,"nodeType":"ElementaryTypeNameExpression","src":"2271:4:0","typeDescriptions":{"typeIdentifier":"t_type$_t_uint256_$","typeString":"type(uint256)"},"typeName":"uint"},"id":198,"isConstant":false,"isLValue":false,"isPure":true,"kind":"typeConversion","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2271:8:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2241:38:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"src":"2220:59:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"falseBody":null,"id":222,"nodeType":"IfStatement","src":"2216:179:0","trueBody":{"id":221,"nodeType":"Block","src":"2281:114:0","statements":[{"expression":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"commonType":{"typeIdentifier":"t_uint256","typeString":"uint256"},"id":209,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":202,"name":"allowance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":48,"src":"2303:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"}},"id":204,"indexExpression":{"argumentTypes":null,"id":203,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2313:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2303:14:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":207,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":205,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"2318:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":206,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2318:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2303:26:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"BinaryOperation","operator":">=","rightExpression":{"argumentTypes":null,"id":208,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2333:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2303:33:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_bool","typeString":"bool"}],"id":201,"name":"require","nodeType":"Identifier","overloadedDeclarations":[263,264],"referencedDeclaration":263,"src":"2295:7:0","typeDescriptions":{"typeIdentifier":"t_function_require_pure$_t_bool_$returns$__$","typeString":"function (bool) pure"}},"id":210,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2295:42:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":211,"nodeType":"ExpressionStatement","src":"2295:42:0"},{"expression":{"argumentTypes":null,"id":219,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":212,"name":"allowance","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":48,"src":"2351:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$","typeString":"mapping(address => mapping(address => uint256))"}},"id":216,"indexExpression":{"argumentTypes":null,"id":213,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2361:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":false,"nodeType":"IndexAccess","src":"2351:14:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":217,"indexExpression":{"argumentTypes":null,"expression":{"argumentTypes":null,"id":214,"name":"msg","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":260,"src":"2366:3:0","typeDescriptions":{"typeIdentifier":"t_magic_message","typeString":"msg"}},"id":215,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"memberName":"sender","nodeType":"MemberAccess","referencedDeclaration":null,"src":"2366:10:0","typeDescriptions":{"typeIdentifier":"t_address_payable","typeString":"address payable"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2351:26:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"-=","rightHandSide":{"argumentTypes":null,"id":218,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2381:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2351:33:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":220,"nodeType":"ExpressionStatement","src":"2351:33:0"}]}},{"expression":{"argumentTypes":null,"id":227,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":223,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"2405:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":225,"indexExpression":{"argumentTypes":null,"id":224,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2415:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2405:14:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"-=","rightHandSide":{"argumentTypes":null,"id":226,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2423:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2405:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":228,"nodeType":"ExpressionStatement","src":"2405:21:0"},{"expression":{"argumentTypes":null,"id":233,"isConstant":false,"isLValue":false,"isPure":false,"lValueRequested":false,"leftHandSide":{"argumentTypes":null,"baseExpression":{"argumentTypes":null,"id":229,"name":"balanceOf","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":42,"src":"2436:9:0","typeDescriptions":{"typeIdentifier":"t_mapping$_t_address_$_t_uint256_$","typeString":"mapping(address => uint256)"}},"id":231,"indexExpression":{"argumentTypes":null,"id":230,"name":"dst","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":170,"src":"2446:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"isConstant":false,"isLValue":true,"isPure":false,"lValueRequested":true,"nodeType":"IndexAccess","src":"2436:14:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"nodeType":"Assignment","operator":"+=","rightHandSide":{"argumentTypes":null,"id":232,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2454:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"src":"2436:21:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":234,"nodeType":"ExpressionStatement","src":"2436:21:0"},{"eventCall":{"argumentTypes":null,"arguments":[{"argumentTypes":null,"id":236,"name":"src","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":168,"src":"2482:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":237,"name":"dst","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":170,"src":"2487:3:0","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},{"argumentTypes":null,"id":238,"name":"wad","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":172,"src":"2492:3:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}}],"expression":{"argumentTypes":[{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_address","typeString":"address"},{"typeIdentifier":"t_uint256","typeString":"uint256"}],"id":235,"name":"Transfer","nodeType":"Identifier","overloadedDeclarations":[],"referencedDeclaration":26,"src":"2473:8:0","typeDescriptions":{"typeIdentifier":"t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$","typeString":"function (address,address,uint256)"}},"id":239,"isConstant":false,"isLValue":false,"isPure":false,"kind":"functionCall","lValueRequested":false,"names":[],"nodeType":"FunctionCall","src":"2473:23:0","typeDescriptions":{"typeIdentifier":"t_tuple$__$","typeString":"tuple()"}},"id":240,"nodeType":"EmitStatement","src":"2468:28:0"},{"expression":{"argumentTypes":null,"hexValue":"74727565","id":241,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"2514:4:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"functionReturnParameters":176,"id":242,"nodeType":"Return","src":"2507:11:0"}]},"documentation":null,"implemented":true,"kind":"function","modifiers":[],"name":"transferFrom","parameters":{"id":173,"nodeType":"ParameterList","parameters":[{"constant":false,"id":168,"name":"src","nodeType":"VariableDeclaration","scope":244,"src":"2087:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":167,"name":"address","nodeType":"ElementaryTypeName","src":"2087:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":170,"name":"dst","nodeType":"VariableDeclaration","scope":244,"src":"2100:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":169,"name":"address","nodeType":"ElementaryTypeName","src":"2100:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"},{"constant":false,"id":172,"name":"wad","nodeType":"VariableDeclaration","scope":244,"src":"2113:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":171,"name":"uint","nodeType":"ElementaryTypeName","src":"2113:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"2086:36:0"},"returnParameters":{"id":176,"nodeType":"ParameterList","parameters":[{"constant":false,"id":175,"name":"","nodeType":"VariableDeclaration","scope":244,"src":"2155:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":174,"name":"bool","nodeType":"ElementaryTypeName","src":"2155:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":null,"visibility":"internal"}],"src":"2154:6:0"},"scope":245,"stateMutability":"nonpayable","superFunction":null,"visibility":"public"}],"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":true,"linearizedBaseContracts":[245],"name":"WETH9","scope":246}]},"id":0}
\ No newline at end of file
export * from './interfaces'
export * from './utils'
export * from './cross-chain-messenger'
export * from './adapters'
export * from './l2-provider'
import {
Contract,
Overrides,
Signer,
BigNumber,
CallOverrides,
PayableOverrides,
} from 'ethers'
import {
TransactionRequest,
TransactionResponse,
BlockTag,
} from '@ethersproject/abstract-provider'
import { NumberLike, AddressLike, TokenBridgeMessage } from './types'
import { CrossChainMessenger } from '../cross-chain-messenger'
/**
* Represents an adapter for an L1<>L2 token bridge. Each custom bridge currently needs its own
* adapter because the bridge interface is not standardized. This may change in the future.
*/
export interface IBridgeAdapter {
/**
* Provider used to make queries related to cross-chain interactions.
*/
messenger: CrossChainMessenger
/**
* L1 bridge contract.
*/
l1Bridge: Contract
/**
* L2 bridge contract.
*/
l2Bridge: Contract
/**
* Gets all deposits for a given address.
*
* @param address Address to search for messages from.
* @param opts Options object.
* @param opts.fromBlock Block to start searching for messages from. If not provided, will start
* from the first block (block #0).
* @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
* latest known block ("latest").
* @returns All deposit token bridge messages sent by the given address.
*/
getDepositsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]>
/**
* Gets all withdrawals for a given address.
*
* @param address Address to search for messages from.
* @param opts Options object.
* @param opts.fromBlock Block to start searching for messages from. If not provided, will start
* from the first block (block #0).
* @param opts.toBlock Block to stop searching for messages at. If not provided, will stop at the
* latest known block ("latest").
* @returns All withdrawal token bridge messages sent by the given address.
*/
getWithdrawalsByAddress(
address: AddressLike,
opts?: {
fromBlock?: BlockTag
toBlock?: BlockTag
}
): Promise<TokenBridgeMessage[]>
/**
* Checks whether the given token pair is supported by the bridge.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @returns Whether the given token pair is supported by the bridge.
*/
supportsTokenPair(
l1Token: AddressLike,
l2Token: AddressLike
): Promise<boolean>
/**
* Queries the account's approval amount for a given L1 token.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param signer Signer to query the approval for.
* @returns Amount of tokens approved for deposits from the account.
*/
approval(
l1Token: AddressLike,
l2Token: AddressLike,
signer: Signer
): Promise<BigNumber>
/**
* Approves a deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param signer Signer used to sign and send the transaction.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the approval transaction.
*/
approve(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
overrides?: Overrides
}
): Promise<TransactionResponse>
/**
* Deposits some tokens into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to deposit.
* @param signer Signer used to sign and send the transaction.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the deposit transaction.
*/
deposit(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: Overrides
}
): Promise<TransactionResponse>
/**
* Withdraws some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to withdraw.
* @param signer Signer used to sign and send the transaction.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction response for the withdraw transaction.
*/
withdraw(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
signer: Signer,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionResponse>
/**
* Object that holds the functions that generate transactions to be signed by the user.
* Follows the pattern used by ethers.js.
*/
populateTransaction: {
/**
* Generates a transaction for approving some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to deposit the tokens.
*/
approve(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: Overrides
}
): Promise<TransactionRequest>
/**
* Generates a transaction for depositing some tokens into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to deposit the tokens.
*/
deposit(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: PayableOverrides
}
): Promise<TransactionRequest>
/**
* Generates a transaction for withdrawing some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Transaction that can be signed and executed to withdraw the tokens.
*/
withdraw(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: Overrides
}
): Promise<TransactionRequest>
}
/**
* Object that holds the functions that estimates the gas required for a given transaction.
* Follows the pattern used by ethers.js.
*/
estimateGas: {
/**
* Estimates gas required to approve some tokens to deposit into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to approve.
* @param opts Additional options.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
approve(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
overrides?: CallOverrides
}
): Promise<BigNumber>
/**
* Estimates gas required to deposit some tokens into the L2 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to deposit.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L2. Defaults to sender.
* @param opts.l2GasLimit Optional gas limit to use for the transaction on L2.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
deposit(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
l2GasLimit?: NumberLike
overrides?: CallOverrides
}
): Promise<BigNumber>
/**
* Estimates gas required to withdraw some tokens back to the L1 chain.
*
* @param l1Token The L1 token address.
* @param l2Token The L2 token address.
* @param amount Amount of the token to withdraw.
* @param opts Additional options.
* @param opts.recipient Optional address to receive the funds on L1. Defaults to sender.
* @param opts.overrides Optional transaction overrides.
* @returns Gas estimate for the transaction.
*/
withdraw(
l1Token: AddressLike,
l2Token: AddressLike,
amount: NumberLike,
opts?: {
recipient?: AddressLike
overrides?: CallOverrides
}
): Promise<BigNumber>
}
}
export * from './bridge-adapter'
export * from './l2-provider'
export * from './types'
import {
Provider,
TransactionRequest,
TransactionResponse,
Block,
BlockWithTransactions,
} from '@ethersproject/abstract-provider'
import { BigNumber } from 'ethers'
/**
* JSON transaction representation when returned by L2Geth nodes. This is simply an extension to
* the standard transaction response type. You do NOT need to use this type unless you care about
* having typed access to L2-specific fields.
*/
export interface L2Transaction extends TransactionResponse {
l1BlockNumber: number
l1TxOrigin: string
queueOrigin: string
rawTransaction: string
}
/**
* JSON block representation when returned by L2Geth nodes. Just a normal block but with
* an added stateRoot field.
*/
export interface L2Block extends Block {
stateRoot: string
}
/**
* JSON block representation when returned by L2Geth nodes. Just a normal block but with
* L2Transaction objects instead of the standard transaction response object.
*/
export interface L2BlockWithTransactions extends BlockWithTransactions {
stateRoot: string
transactions: [L2Transaction]
}
/**
* Represents an extended version of an normal ethers Provider that returns additional L2 info and
* has special functions for L2-specific interactions.
*/
export type L2Provider<TProvider extends Provider> = TProvider & {
/**
* Gets the current L1 (data) gas price.
*
* @returns Current L1 data gas price in wei.
*/
getL1GasPrice(): Promise<BigNumber>
/**
* Estimates the L1 (data) gas required for a transaction.
*
* @param tx Transaction to estimate L1 gas for.
* @returns Estimated L1 gas.
*/
estimateL1Gas(tx: TransactionRequest): Promise<BigNumber>
/**
* Estimates the L1 (data) gas cost for a transaction in wei by multiplying the estimated L1 gas
* cost by the current L1 gas price.
*
* @param tx Transaction to estimate L1 gas cost for.
* @returns Estimated L1 gas cost.
*/
estimateL1GasCost(tx: TransactionRequest): Promise<BigNumber>
/**
* Estimates the L2 (execution) gas cost for a transaction in wei by multiplying the estimated L1
* gas cost by the current L2 gas price. This is a simple multiplication of the result of
* getGasPrice and estimateGas for the given transaction request.
*
* @param tx Transaction to estimate L2 gas cost for.
* @returns Estimated L2 gas cost.
*/
estimateL2GasCost(tx: TransactionRequest): Promise<BigNumber>
/**
* Estimates the total gas cost for a transaction in wei by adding the estimated the L1 gas cost
* and the estimated L2 gas cost.
*
* @param tx Transaction to estimate total gas cost for.
* @returns Estimated total gas cost.
*/
estimateTotalGasCost(tx: TransactionRequest): Promise<BigNumber>
/**
* Internal property to determine if a provider is a L2Provider
* You are likely looking for the isL2Provider function
*/
_isL2Provider: true
}
import {
Provider,
TransactionReceipt,
TransactionResponse,
} from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer'
import { Contract, BigNumber } from 'ethers'
import { CrossChainMessenger } from '../cross-chain-messenger'
import { IBridgeAdapter } from './bridge-adapter'
/**
* L1 network chain IDs
*/
export enum L1ChainID {
MAINNET = 1,
GOERLI = 5,
SEPOLIA = 11155111,
HARDHAT_LOCAL = 31337,
BEDROCK_LOCAL_DEVNET = 900,
}
/**
* L2 network chain IDs
*/
export enum L2ChainID {
OPTIMISM = 10,
OPTIMISM_GOERLI = 420,
OPTIMISM_SEPOLIA = 11155420,
OPTIMISM_HARDHAT_LOCAL = 31337,
OPTIMISM_HARDHAT_DEVNET = 17,
OPTIMISM_BEDROCK_ALPHA_TESTNET = 28528,
BASE_GOERLI = 84531,
BASE_SEPOLIA = 84532,
BASE_MAINNET = 8453,
ZORA_GOERLI = 999,
ZORA_MAINNET = 7777777,
MODE_SEPOLIA = 919,
MODE_MAINNET = 34443,
}
/**
* L1 contract references.
*/
export interface OEL1Contracts {
AddressManager: Contract
L1CrossDomainMessenger: Contract
L1StandardBridge: Contract
StateCommitmentChain: Contract
CanonicalTransactionChain: Contract
BondManager: Contract
// Bedrock
OptimismPortal: Contract
L2OutputOracle: Contract
// FPAC
OptimismPortal2?: Contract
DisputeGameFactory?: Contract
FaultDisputeGame?: Contract
}
/**
* L2 contract references.
*/
export interface OEL2Contracts {
L2CrossDomainMessenger: Contract
L2StandardBridge: Contract
L2ToL1MessagePasser: Contract
OVM_L1BlockNumber: Contract
OVM_L2ToL1MessagePasser: Contract
OVM_DeployerWhitelist: Contract
OVM_ETH: Contract
OVM_GasPriceOracle: Contract
OVM_SequencerFeeVault: Contract
WETH: Contract
BedrockMessagePasser: Contract
}
/**
* Represents Optimism contracts, assumed to be connected to their appropriate
* providers and addresses.
*/
export interface OEContracts {
l1: OEL1Contracts
l2: OEL2Contracts
}
/**
* Convenience type for something that looks like the L1 OE contract interface but could be
* addresses instead of actual contract objects.
*/
export type OEL1ContractsLike = {
[K in keyof OEL1Contracts]: AddressLike
}
/**
* Convenience type for something that looks like the L2 OE contract interface but could be
* addresses instead of actual contract objects.
*/
export type OEL2ContractsLike = {
[K in keyof OEL2Contracts]: AddressLike
}
/**
* Convenience type for something that looks like the OE contract interface but could be
* addresses instead of actual contract objects.
*/
export interface OEContractsLike {
l1: OEL1ContractsLike
l2: OEL2ContractsLike
}
/**
* Something that looks like the list of custom bridges.
*/
export interface BridgeAdapterData {
[name: string]: {
Adapter: new (opts: {
messenger: CrossChainMessenger
l1Bridge: AddressLike
l2Bridge: AddressLike
}) => IBridgeAdapter
l1Bridge: AddressLike
l2Bridge: AddressLike
}
}
/**
* Something that looks like the list of custom bridges.
*/
export interface BridgeAdapters {
[name: string]: IBridgeAdapter
}
/**
* Enum describing the status of a message.
*/
export enum MessageStatus {
/**
* Message is an L1 to L2 message and has not been processed by the L2.
*/
UNCONFIRMED_L1_TO_L2_MESSAGE,
/**
* Message is an L1 to L2 message and the transaction to execute the message failed.
* When this status is returned, you will need to resend the L1 to L2 message, probably with a
* higher gas limit.
*/
FAILED_L1_TO_L2_MESSAGE,
/**
* Message is an L2 to L1 message and no state root has been published yet.
*/
STATE_ROOT_NOT_PUBLISHED,
/**
* Message is ready to be proved on L1 to initiate the challenge period.
*/
READY_TO_PROVE,
/**
* Message is a proved L2 to L1 message and is undergoing the challenge period.
*/
IN_CHALLENGE_PERIOD,
/**
* Message is ready to be relayed.
*/
READY_FOR_RELAY,
/**
* Message has been relayed.
*/
RELAYED,
}
/**
* Enum describing the direction of a message.
*/
export enum MessageDirection {
L1_TO_L2,
L2_TO_L1,
}
/**
* Partial message that needs to be signed and executed by a specific signer.
*/
export interface CrossChainMessageRequest {
direction: MessageDirection
target: string
message: string
}
/**
* Core components of a cross chain message.
*/
export interface CoreCrossChainMessage {
sender: string
target: string
message: string
messageNonce: BigNumber
value: BigNumber
minGasLimit: BigNumber
}
/**
* Describes a message that is sent between L1 and L2. Direction determines where the message was
* sent from and where it's being sent to.
*/
export interface CrossChainMessage extends CoreCrossChainMessage {
direction: MessageDirection
logIndex: number
blockNumber: number
transactionHash: string
}
/**
* Describes messages sent inside the L2ToL1MessagePasser on L2. Happens to be the same structure
* as the CoreCrossChainMessage so we'll reuse the type for now.
*/
export type LowLevelMessage = CoreCrossChainMessage
/**
* Describes a token withdrawal or deposit, along with the underlying raw cross chain message
* behind the deposit or withdrawal.
*/
export interface TokenBridgeMessage {
direction: MessageDirection
from: string
to: string
l1Token: string
l2Token: string
amount: BigNumber
data: string
logIndex: number
blockNumber: number
transactionHash: string
}
/**
* Represents a withdrawal entry within the logs of a L2 to L1
* CrossChainMessage
*/
export interface WithdrawalEntry {
MessagePassed: any
}
/**
* Enum describing the status of a CrossDomainMessage message receipt.
*/
export enum MessageReceiptStatus {
RELAYED_FAILED,
RELAYED_SUCCEEDED,
}
/**
* CrossDomainMessage receipt.
*/
export interface MessageReceipt {
receiptStatus: MessageReceiptStatus
transactionReceipt: TransactionReceipt
}
/**
* ProvenWithdrawal in OptimismPortal.
*/
export interface LegacyProvenWithdrawal {
outputRoot: string
timestamp: BigNumber
l2BlockNumber: BigNumber
}
/**
* ProvenWithdrawal in OptimismPortal (FPAC).
*/
export interface FPACProvenWithdrawal {
proofSubmitter: string
disputeGameProxy: string
timestamp: BigNumber
}
/**
* ProvenWithdrawal in OptimismPortal (FPAC or Legacy).
*/
export type ProvenWithdrawal = LegacyProvenWithdrawal | FPACProvenWithdrawal
/**
* Header for a state root batch.
*/
export interface StateRootBatchHeader {
batchIndex: BigNumber
batchRoot: string
batchSize: BigNumber
prevTotalElements: BigNumber
extraData: string
}
/**
* Information about a state root, including header, block number, and root iself.
*/
export interface StateRoot {
stateRoot: string
stateRootIndexInBatch: number
batch: StateRootBatch
}
/**
* Information about a batch of state roots.
*/
export interface StateRootBatch {
blockNumber: number
header: StateRootBatchHeader
stateRoots: string[]
}
/**
* Proof data required to finalize an L2 to L1 message.
*/
export interface CrossChainMessageProof {
stateRoot: string
stateRootBatchHeader: StateRootBatchHeader
stateRootProof: {
index: number
siblings: string[]
}
stateTrieWitness: string
storageTrieWitness: string
}
/**
* Stuff that can be coerced into a transaction.
*/
export type TransactionLike = string | TransactionReceipt | TransactionResponse
/**
* Stuff that can be coerced into a CrossChainMessage.
*/
export type MessageLike =
| CrossChainMessage
| TransactionLike
| TokenBridgeMessage
/**
* Stuff that can be coerced into a CrossChainMessageRequest.
*/
export type MessageRequestLike =
| CrossChainMessageRequest
| CrossChainMessage
| TransactionLike
| TokenBridgeMessage
/**
* Stuff that can be coerced into a provider.
*/
export type ProviderLike = string | Provider
/**
* Stuff that can be coerced into a signer.
*/
export type SignerLike = string | Signer
/**
* Stuff that can be coerced into a signer or provider.
*/
export type SignerOrProviderLike = SignerLike | ProviderLike
/**
* Stuff that can be coerced into an address.
*/
export type AddressLike = string | Contract
/**
* Stuff that can be coerced into a number.
*/
export type NumberLike = string | number | BigNumber
import { Provider, TransactionRequest } from '@ethersproject/abstract-provider'
import { serialize } from '@ethersproject/transactions'
import { Contract, BigNumber } from 'ethers'
import { predeploys, getContractInterface } from '@eth-optimism/contracts'
import cloneDeep from 'lodash/cloneDeep'
import { assert } from './utils/assert'
import { L2Provider, ProviderLike, NumberLike } from './interfaces'
import { toProvider, toNumber, toBigNumber } from './utils'
type ProviderTypeIsWrong = any
/**
* Gets a reasonable nonce for the transaction.
*
* @param provider Provider to get the nonce from.
* @param tx Requested transaction.
* @returns A reasonable nonce for the transaction.
*/
const getNonceForTx = async (
provider: ProviderLike,
tx: TransactionRequest
): Promise<number> => {
if (tx.nonce !== undefined) {
return toNumber(tx.nonce as NumberLike)
} else if (tx.from !== undefined) {
return toProvider(provider).getTransactionCount(tx.from)
} else {
// Large nonce with lots of non-zero bytes
return 0xffffffff
}
}
/**
* Returns a Contract object for the GasPriceOracle.
*
* @param provider Provider to attach the contract to.
* @returns Contract object for the GasPriceOracle.
*/
const connectGasPriceOracle = (provider: ProviderLike): Contract => {
return new Contract(
predeploys.OVM_GasPriceOracle,
getContractInterface('OVM_GasPriceOracle'),
toProvider(provider)
)
}
/**
* Gets the current L1 gas price as seen on L2.
*
* @param l2Provider L2 provider to query the L1 gas price from.
* @returns Current L1 gas price as seen on L2.
*/
export const getL1GasPrice = async (
l2Provider: ProviderLike
): Promise<BigNumber> => {
const gpo = connectGasPriceOracle(l2Provider)
return gpo.l1BaseFee()
}
/**
* Estimates the amount of L1 gas required for a given L2 transaction.
*
* @param l2Provider L2 provider to query the gas usage from.
* @param tx Transaction to estimate L1 gas for.
* @returns Estimated L1 gas.
*/
export const estimateL1Gas = async (
l2Provider: ProviderLike,
tx: TransactionRequest
): Promise<BigNumber> => {
const gpo = connectGasPriceOracle(l2Provider)
return gpo.getL1GasUsed(
serialize({
to: tx.to,
gasLimit: tx.gasLimit,
gasPrice: tx.gasPrice,
maxFeePerGas: tx.maxFeePerGas,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
data: tx.data,
value: tx.value,
chainId: tx.chainId,
type: tx.type,
accessList: tx.accessList,
nonce: tx.nonce
? BigNumber.from(tx.nonce).toNumber()
: await getNonceForTx(l2Provider, tx),
})
)
}
/**
* Estimates the amount of L1 gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.
* @param tx Transaction to estimate L1 gas cost for.
* @returns Estimated L1 gas cost.
*/
export const estimateL1GasCost = async (
l2Provider: ProviderLike,
tx: TransactionRequest
): Promise<BigNumber> => {
const gpo = connectGasPriceOracle(l2Provider)
return gpo.getL1Fee(
serialize({
to: tx.to,
gasLimit: tx.gasLimit,
gasPrice: tx.gasPrice,
maxFeePerGas: tx.maxFeePerGas,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
data: tx.data,
value: tx.value,
chainId: tx.chainId,
type: tx.type,
accessList: tx.accessList,
nonce: tx.nonce
? BigNumber.from(tx.nonce).toNumber()
: await getNonceForTx(l2Provider, tx),
})
)
}
/**
* Estimates the L2 gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.
* @param tx Transaction to estimate L2 gas cost for.
* @returns Estimated L2 gas cost.
*/
export const estimateL2GasCost = async (
l2Provider: ProviderLike,
tx: TransactionRequest
): Promise<BigNumber> => {
const parsed = toProvider(l2Provider)
const l2GasPrice = await parsed.getGasPrice()
const l2GasCost = await parsed.estimateGas(tx)
return l2GasPrice.mul(l2GasCost)
}
/**
* Estimates the total gas cost for a given L2 transaction in wei.
*
* @param l2Provider L2 provider to query the gas usage from.
* @param tx Transaction to estimate total gas cost for.
* @returns Estimated total gas cost.
*/
export const estimateTotalGasCost = async (
l2Provider: ProviderLike,
tx: TransactionRequest
): Promise<BigNumber> => {
const l1GasCost = await estimateL1GasCost(l2Provider, tx)
const l2GasCost = await estimateL2GasCost(l2Provider, tx)
return l1GasCost.add(l2GasCost)
}
/**
* Determines if a given Provider is an L2Provider. Will coerce type
* if true
*
* @param provider The provider to check
* @returns Boolean
* @example
* if (isL2Provider(provider)) {
* // typescript now knows it is of type L2Provider
* const gasPrice = await provider.estimateL2GasPrice(tx)
* }
*/
export const isL2Provider = <TProvider extends Provider>(
provider: TProvider
): provider is L2Provider<TProvider> => {
return Boolean((provider as L2Provider<TProvider>)._isL2Provider)
}
/**
* Returns an provider wrapped as an Optimism L2 provider. Adds a few extra helper functions to
* simplify the process of estimating the gas usage for a transaction on Optimism. Returns a COPY
* of the original provider.
*
* @param provider Provider to wrap into an L2 provider.
* @returns Provider wrapped as an L2 provider.
*/
export const asL2Provider = <TProvider extends Provider>(
provider: TProvider
): L2Provider<TProvider> => {
// Skip if we've already wrapped this provider.
if (isL2Provider(provider)) {
return provider
}
// Make a copy of the provider since we'll be modifying some internals and don't want to mess
// with the original object.
const l2Provider = cloneDeep(provider) as L2Provider<TProvider>
// Not exactly sure when the provider wouldn't have a formatter function, but throw an error if
// it doesn't have one. The Provider type doesn't define it but every provider I've dealt with
// seems to have it.
// TODO this may be fixed if library has gotten updated since
const formatter = (l2Provider as ProviderTypeIsWrong).formatter
assert(formatter, `provider.formatter must be defined`)
// Modify the block formatter to return the state root. Not strictly related to Optimism, just a
// generally useful thing that really should've been on the Ethers block object to begin with.
// TODO: Maybe we should make a PR to add this to the Ethers library?
const ogBlockFormatter = formatter.block.bind(formatter)
formatter.block = (block: any) => {
const parsed = ogBlockFormatter(block)
parsed.stateRoot = block.stateRoot
return parsed
}
// Modify the block formatter to include all the L2 fields for transactions.
const ogBlockWithTxFormatter = formatter.blockWithTransactions.bind(formatter)
formatter.blockWithTransactions = (block: any) => {
const parsed = ogBlockWithTxFormatter(block)
parsed.stateRoot = block.stateRoot
parsed.transactions = parsed.transactions.map((tx: any, idx: number) => {
const ogTx = block.transactions[idx]
tx.l1BlockNumber = ogTx.l1BlockNumber
? toNumber(ogTx.l1BlockNumber)
: ogTx.l1BlockNumber
tx.l1Timestamp = ogTx.l1Timestamp
? toNumber(ogTx.l1Timestamp)
: ogTx.l1Timestamp
tx.l1TxOrigin = ogTx.l1TxOrigin
tx.queueOrigin = ogTx.queueOrigin
tx.rawTransaction = ogTx.rawTransaction
return tx
})
return parsed
}
// Modify the transaction formatter to include all the L2 fields for transactions.
const ogTxResponseFormatter = formatter.transactionResponse.bind(formatter)
formatter.transactionResponse = (tx: any) => {
const parsed = ogTxResponseFormatter(tx)
parsed.txType = tx.txType
parsed.queueOrigin = tx.queueOrigin
parsed.rawTransaction = tx.rawTransaction
parsed.l1TxOrigin = tx.l1TxOrigin
parsed.l1BlockNumber = tx.l1BlockNumber
? parseInt(tx.l1BlockNumber, 16)
: tx.l1BlockNumbers
return parsed
}
// Modify the receipt formatter to include all the L2 fields.
const ogReceiptFormatter = formatter.receipt.bind(formatter)
formatter.receipt = (receipt: any) => {
const parsed = ogReceiptFormatter(receipt)
parsed.l1GasPrice = toBigNumber(receipt.l1GasPrice)
parsed.l1GasUsed = toBigNumber(receipt.l1GasUsed)
parsed.l1Fee = toBigNumber(receipt.l1Fee)
parsed.l1FeeScalar = parseFloat(receipt.l1FeeScalar)
return parsed
}
// Connect extra functions.
l2Provider.getL1GasPrice = async () => {
return getL1GasPrice(l2Provider)
}
l2Provider.estimateL1Gas = async (tx: TransactionRequest) => {
return estimateL1Gas(l2Provider, tx)
}
l2Provider.estimateL1GasCost = async (tx: TransactionRequest) => {
return estimateL1GasCost(l2Provider, tx)
}
l2Provider.estimateL2GasCost = async (tx: TransactionRequest) => {
return estimateL2GasCost(l2Provider, tx)
}
l2Provider.estimateTotalGasCost = async (tx: TransactionRequest) => {
return estimateTotalGasCost(l2Provider, tx)
}
l2Provider._isL2Provider = true
return l2Provider
}
export const assert = (condition: boolean, message: string): void => {
if (!condition) {
throw new Error(message)
}
}
import { predeploys } from '@eth-optimism/core-utils'
import { ethers } from 'ethers'
// The addresses below should be for the proxy if it is a proxied contract.
const portalAddresses = {
mainnet: '0xbEb5Fc579115071764c7423A4f12eDde41f106Ed',
goerli: '0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383',
sepolia: '0x16Fc5058F25648194471939df75CF27A2fdC48BC',
}
const l2OutputOracleAddresses = {
mainnet: '0xdfe97868233d1aa22e815a266982f2cf17685a27',
goerli: '0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0',
sepolia: '0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F',
}
const addressManagerAddresses = {
mainnet: '0xdE1FCfB0851916CA5101820A69b13a4E276bd81F',
goerli: '0xa6f73589243a6A7a9023b1Fa0651b1d89c177111',
sepolia: '0x9bFE9c5609311DF1c011c47642253B78a4f33F4B',
}
const l1StandardBridgeAddresses = {
mainnet: '0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1',
goerli: '0x636Af16bf2f682dD3109e60102b8E1A089FedAa8',
sepolia: '0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1',
}
const l1CrossDomainMessengerAddresses = {
mainnet: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1',
goerli: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294',
sepolia: '0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef',
}
const disputeGameFactoryAddresses = {
mainnet: ethers.constants.AddressZero,
goerli: ethers.constants.AddressZero,
sepolia: '0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1',
}
// legacy
const stateCommitmentChainAddresses = {
mainnet: '0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19',
goerli: '0x9c945aC97Baf48cB784AbBB61399beB71aF7A378',
sepolia: ethers.constants.AddressZero,
}
// legacy
const canonicalTransactionChainAddresses = {
mainnet: '0x5E4e65926BA27467555EB562121fac00D24E9dD2',
goerli: '0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D',
sepolia: ethers.constants.AddressZero,
}
import {
L1ChainID,
L2ChainID,
OEContractsLike,
OEL1ContractsLike,
OEL2ContractsLike,
BridgeAdapterData,
} from '../interfaces'
import {
StandardBridgeAdapter,
DAIBridgeAdapter,
ECOBridgeAdapter,
} from '../adapters'
export const DEPOSIT_CONFIRMATION_BLOCKS: {
[ChainID in L2ChainID]: number
} = {
[L2ChainID.OPTIMISM]: 50 as const,
[L2ChainID.OPTIMISM_GOERLI]: 12 as const,
[L2ChainID.OPTIMISM_SEPOLIA]: 12 as const,
[L2ChainID.OPTIMISM_HARDHAT_LOCAL]: 2 as const,
[L2ChainID.OPTIMISM_HARDHAT_DEVNET]: 2 as const,
[L2ChainID.OPTIMISM_BEDROCK_ALPHA_TESTNET]: 12 as const,
[L2ChainID.BASE_GOERLI]: 25 as const,
[L2ChainID.BASE_SEPOLIA]: 25 as const,
[L2ChainID.BASE_MAINNET]: 10 as const,
[L2ChainID.ZORA_GOERLI]: 12 as const,
[L2ChainID.ZORA_MAINNET]: 50 as const,
[L2ChainID.MODE_SEPOLIA]: 25 as const,
[L2ChainID.MODE_MAINNET]: 50 as const,
}
export const CHAIN_BLOCK_TIMES: {
[ChainID in L1ChainID]: number
} = {
[L1ChainID.MAINNET]: 13 as const,
[L1ChainID.GOERLI]: 15 as const,
[L1ChainID.SEPOLIA]: 15 as const,
[L1ChainID.HARDHAT_LOCAL]: 1 as const,
[L1ChainID.BEDROCK_LOCAL_DEVNET]: 15 as const,
}
/**
* Full list of default L2 contract addresses.
*/
export const DEFAULT_L2_CONTRACT_ADDRESSES: OEL2ContractsLike = {
L2CrossDomainMessenger: predeploys.L2CrossDomainMessenger,
L2ToL1MessagePasser: predeploys.L2ToL1MessagePasser,
L2StandardBridge: predeploys.L2StandardBridge,
OVM_L1BlockNumber: predeploys.L1BlockNumber,
OVM_L2ToL1MessagePasser: predeploys.L2ToL1MessagePasser,
OVM_DeployerWhitelist: predeploys.DeployerWhitelist,
OVM_ETH: predeploys.LegacyERC20ETH,
OVM_GasPriceOracle: predeploys.GasPriceOracle,
OVM_SequencerFeeVault: predeploys.SequencerFeeVault,
WETH: predeploys.WETH9,
BedrockMessagePasser: predeploys.L2ToL1MessagePasser,
}
/**
* Loads the L1 contracts for a given network by the network name.
*
* @param network The name of the network to load the contracts for.
* @returns The L1 contracts for the given network.
*/
const getL1ContractsByNetworkName = (network: string): OEL1ContractsLike => {
return {
AddressManager: addressManagerAddresses[network],
L1CrossDomainMessenger: l1CrossDomainMessengerAddresses[network],
L1StandardBridge: l1StandardBridgeAddresses[network],
StateCommitmentChain: stateCommitmentChainAddresses[network],
CanonicalTransactionChain: canonicalTransactionChainAddresses[network],
BondManager: ethers.constants.AddressZero,
OptimismPortal: portalAddresses[network],
L2OutputOracle: l2OutputOracleAddresses[network],
OptimismPortal2: portalAddresses[network],
DisputeGameFactory: disputeGameFactoryAddresses[network],
}
}
/**
* List of contracts that are ignorable when checking for contracts on a given network.
*/
export const IGNORABLE_CONTRACTS = ['OptimismPortal2', 'DisputeGameFactory']
/**
* Mapping of L1 chain IDs to the appropriate contract addresses for the OE deployments to the
* given network. Simplifies the process of getting the correct contract addresses for a given
* contract name.
*/
export const CONTRACT_ADDRESSES: {
[ChainID in L2ChainID]: OEContractsLike
} = {
[L2ChainID.OPTIMISM]: {
l1: getL1ContractsByNetworkName('mainnet'),
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.OPTIMISM_GOERLI]: {
l1: getL1ContractsByNetworkName('goerli'),
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.OPTIMISM_SEPOLIA]: {
l1: getL1ContractsByNetworkName('sepolia'),
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.OPTIMISM_HARDHAT_LOCAL]: {
l1: {
AddressManager: '0x5FbDB2315678afecb367f032d93F642f64180aa3' as const,
L1CrossDomainMessenger:
'0x8A791620dd6260079BF849Dc5567aDC3F2FdC318' as const,
L1StandardBridge: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788' as const,
StateCommitmentChain:
'0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9' as const,
CanonicalTransactionChain:
'0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' as const,
BondManager: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707' as const,
// FIXME
OptimismPortal: '0x0000000000000000000000000000000000000000' as const,
L2OutputOracle: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.OPTIMISM_HARDHAT_DEVNET]: {
l1: {
AddressManager: '0x5FbDB2315678afecb367f032d93F642f64180aa3' as const,
L1CrossDomainMessenger:
'0x8A791620dd6260079BF849Dc5567aDC3F2FdC318' as const,
L1StandardBridge: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788' as const,
StateCommitmentChain:
'0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9' as const,
CanonicalTransactionChain:
'0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' as const,
BondManager: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707' as const,
OptimismPortal: '0x0000000000000000000000000000000000000000' as const,
L2OutputOracle: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.OPTIMISM_BEDROCK_ALPHA_TESTNET]: {
l1: {
AddressManager: '0xb4e08DcE1F323608229265c9d4125E22a4B9dbAF' as const,
L1CrossDomainMessenger:
'0x838a6DC4E37CA45D4Ef05bb776bf05eEf50798De' as const,
L1StandardBridge: '0xFf94B6C486350aD92561Ba09bad3a59df764Da92' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0xA581Ca3353DB73115C4625FFC7aDF5dB379434A8' as const,
L2OutputOracle: '0x3A234299a14De50027eA65dCdf1c0DaC729e04A6' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.BASE_GOERLI]: {
l1: {
AddressManager: '0x4Cf6b56b14c6CFcB72A75611080514F94624c54e' as const,
L1CrossDomainMessenger:
'0x8e5693140eA606bcEB98761d9beB1BC87383706D' as const,
L1StandardBridge: '0xfA6D8Ee5BE770F84FC001D098C4bD604Fe01284a' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA' as const,
L2OutputOracle: '0x2A35891ff30313CcFa6CE88dcf3858bb075A2298' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.BASE_SEPOLIA]: {
l1: {
AddressManager: '0x709c2B8ef4A9feFc629A8a2C1AF424Dc5BD6ad1B' as const,
L1CrossDomainMessenger:
'0xC34855F4De64F1840e5686e64278da901e261f20' as const,
L1StandardBridge: '0xfd0Bf71F60660E2f608ed56e1659C450eB113120' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0x49f53e41452C74589E85cA1677426Ba426459e85' as const,
L2OutputOracle: '0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.BASE_MAINNET]: {
l1: {
AddressManager: '0x8EfB6B5c4767B09Dc9AA6Af4eAA89F749522BaE2' as const,
L1CrossDomainMessenger:
'0x866E82a600A1414e583f7F13623F1aC5d58b0Afa' as const,
L1StandardBridge: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e' as const,
L2OutputOracle: '0x56315b90c40730925ec5485cf004d835058518A0' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
// Zora Goerli
[L2ChainID.ZORA_GOERLI]: {
l1: {
AddressManager: '0x54f4676203dEDA6C08E0D40557A119c602bFA246' as const,
L1CrossDomainMessenger:
'0xD87342e16352D33170557A7dA1e5fB966a60FafC' as const,
L1StandardBridge: '0x7CC09AC2452D6555d5e0C213Ab9E2d44eFbFc956' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0xDb9F51790365e7dc196e7D072728df39Be958ACe' as const,
L2OutputOracle: '0xdD292C9eEd00f6A32Ff5245d0BCd7f2a15f24e00' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.ZORA_MAINNET]: {
l1: {
AddressManager: '0xEF8115F2733fb2033a7c756402Fc1deaa56550Ef' as const,
L1CrossDomainMessenger:
'0xdC40a14d9abd6F410226f1E6de71aE03441ca506' as const,
L1StandardBridge: '0x3e2Ea9B92B7E48A52296fD261dc26fd995284631' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0x1a0ad011913A150f69f6A19DF447A0CfD9551054' as const,
L2OutputOracle: '0x9E6204F750cD866b299594e2aC9eA824E2e5f95c' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.MODE_SEPOLIA]: {
l1: {
AddressManager: '0x83D45725d6562d8CD717673D6bb4c67C07dC1905' as const,
L1CrossDomainMessenger:
'0xc19a60d9E8C27B9A43527c3283B4dd8eDC8bE15C' as const,
L1StandardBridge: '0xbC5C679879B2965296756CD959C3C739769995E2' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0x320e1580effF37E008F1C92700d1eBa47c1B23fD' as const,
L2OutputOracle: '0x2634BD65ba27AB63811c74A63118ACb312701Bfa' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
[L2ChainID.MODE_MAINNET]: {
l1: {
AddressManager: '0x50eF494573f28Cad6B64C31b7a00Cdaa48306e15' as const,
L1CrossDomainMessenger:
'0x95bDCA6c8EdEB69C98Bd5bd17660BaCef1298A6f' as const,
L1StandardBridge: '0x735aDBbE72226BD52e818E7181953f42E3b0FF21' as const,
StateCommitmentChain:
'0x0000000000000000000000000000000000000000' as const,
CanonicalTransactionChain:
'0x0000000000000000000000000000000000000000' as const,
BondManager: '0x0000000000000000000000000000000000000000' as const,
OptimismPortal: '0x8B34b14c7c7123459Cf3076b8Cb929BE097d0C07' as const,
L2OutputOracle: '0x4317ba146D4933D889518a3e5E11Fe7a53199b04' as const,
OptimismPortal2: '0x0000000000000000000000000000000000000000' as const,
DisputeGameFactory: '0x0000000000000000000000000000000000000000' as const,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
},
}
/**
* Mapping of L1 chain IDs to the list of custom bridge addresses for each chain.
*/
export const BRIDGE_ADAPTER_DATA: {
[ChainID in L2ChainID]?: BridgeAdapterData
} = {
[L2ChainID.OPTIMISM]: {
wstETH: {
Adapter: DAIBridgeAdapter,
l1Bridge: '0x76943C0D61395d8F2edF9060e1533529cAe05dE6' as const,
l2Bridge: '0x8E01013243a96601a86eb3153F0d9Fa4fbFb6957' as const,
},
BitBTC: {
Adapter: StandardBridgeAdapter,
l1Bridge: '0xaBA2c5F108F7E820C049D5Af70B16ac266c8f128' as const,
l2Bridge: '0x158F513096923fF2d3aab2BcF4478536de6725e2' as const,
},
DAI: {
Adapter: DAIBridgeAdapter,
l1Bridge: '0x10E6593CDda8c58a1d0f14C5164B376352a55f2F' as const,
l2Bridge: '0x467194771dAe2967Aef3ECbEDD3Bf9a310C76C65' as const,
},
ECO: {
Adapter: ECOBridgeAdapter,
l1Bridge: '0xAa029BbdC947F5205fBa0F3C11b592420B58f824' as const,
l2Bridge: '0xAa029BbdC947F5205fBa0F3C11b592420B58f824' as const,
},
},
[L2ChainID.OPTIMISM_GOERLI]: {
DAI: {
Adapter: DAIBridgeAdapter,
l1Bridge: '0x05a388Db09C2D44ec0b00Ee188cD42365c42Df23' as const,
l2Bridge: '0x467194771dAe2967Aef3ECbEDD3Bf9a310C76C65' as const,
},
ECO: {
Adapter: ECOBridgeAdapter,
l1Bridge: '0x9A4464D6bFE006715382D39D183AAf66c952a3e0' as const,
l2Bridge: '0x6aA809bAeA2e4C057b3994127cB165119c6fc3B2' as const,
},
},
}
import {
Provider,
TransactionReceipt,
TransactionResponse,
} from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer'
import { ethers, BigNumber } from 'ethers'
import { assert } from './assert'
import {
SignerOrProviderLike,
ProviderLike,
TransactionLike,
NumberLike,
AddressLike,
} from '../interfaces'
/**
* Converts a SignerOrProviderLike into a Signer or a Provider. Assumes that if the input is a
* string then it is a JSON-RPC url.
*
* @param signerOrProvider SignerOrProviderLike to turn into a Signer or Provider.
* @returns Input as a Signer or Provider.
*/
export const toSignerOrProvider = (
signerOrProvider: SignerOrProviderLike
): Signer | Provider => {
if (typeof signerOrProvider === 'string') {
return new ethers.providers.JsonRpcProvider(signerOrProvider)
} else if (Provider.isProvider(signerOrProvider)) {
return signerOrProvider
} else if (Signer.isSigner(signerOrProvider)) {
return signerOrProvider
} else {
throw new Error('Invalid provider')
}
}
/**
* Converts a ProviderLike into a Provider. Assumes that if the input is a string then it is a
* JSON-RPC url.
*
* @param provider ProviderLike to turn into a Provider.
* @returns Input as a Provider.
*/
export const toProvider = (provider: ProviderLike): Provider => {
if (typeof provider === 'string') {
return new ethers.providers.JsonRpcProvider(provider)
} else if (Provider.isProvider(provider)) {
return provider
} else {
throw new Error('Invalid provider')
}
}
/**
* Converts a ProviderLike into a JsonRpcProvider.
*
* @param provider ProviderLike to turn into a JsonRpcProvider.
* @returns Input as a JsonRpcProvider.
*/
export const toJsonRpcProvider = (
provider: ProviderLike
): ethers.providers.JsonRpcProvider => {
const coerced = toProvider(provider)
if ('send' in coerced) {
// Existence of "send" is basically the only function that matters for determining if we can
// use this provider as a JsonRpcProvider, because "send" is the function that we usually want
// access to when we specifically care about having a JsonRpcProvider.
return coerced as ethers.providers.JsonRpcProvider
} else {
throw new Error('Invalid JsonRpcProvider, does not have "send" function')
}
}
/**
* Pulls a transaction hash out of a TransactionLike object.
*
* @param transaction TransactionLike to convert into a transaction hash.
* @returns Transaction hash corresponding to the TransactionLike input.
*/
export const toTransactionHash = (transaction: TransactionLike): string => {
if (typeof transaction === 'string') {
assert(
ethers.utils.isHexString(transaction, 32),
'Invalid transaction hash'
)
return transaction
} else if ((transaction as TransactionReceipt).transactionHash) {
return (transaction as TransactionReceipt).transactionHash
} else if ((transaction as TransactionResponse).hash) {
return (transaction as TransactionResponse).hash
} else {
throw new Error('Invalid transaction')
}
}
/**
* Converts a number-like into an ethers BigNumber.
*
* @param num Number-like to convert into a BigNumber.
* @returns Number-like as a BigNumber.
*/
export const toBigNumber = (num: NumberLike): BigNumber => {
return ethers.BigNumber.from(num)
}
/**
* Converts a number-like into a number.
*
* @param num Number-like to convert into a number.
* @returns Number-like as a number.
*/
export const toNumber = (num: NumberLike): number => {
return toBigNumber(num).toNumber()
}
/**
* Converts an address-like into a 0x-prefixed address string.
*
* @param addr Address-like to convert into an address.
* @returns Address-like as an address.
*/
export const toAddress = (addr: AddressLike): string => {
if (typeof addr === 'string') {
assert(ethers.utils.isAddress(addr), 'Invalid address')
return ethers.utils.getAddress(addr)
} else {
assert(ethers.utils.isAddress(addr.address), 'Invalid address')
return ethers.utils.getAddress(addr.address)
}
}
import { getContractInterface, predeploys } from '@eth-optimism/contracts'
import { ethers, Contract } from 'ethers'
import l1StandardBridge from '../forge-artifacts/L1StandardBridge.json'
import l2StandardBridge from '../forge-artifacts/L2StandardBridge.json'
import optimismMintableERC20 from '../forge-artifacts/OptimismMintableERC20.json'
import optimismPortal from '../forge-artifacts/OptimismPortal.json'
import l1CrossDomainMessenger from '../forge-artifacts/L1CrossDomainMessenger.json'
import l2CrossDomainMessenger from '../forge-artifacts/L2CrossDomainMessenger.json'
import optimismMintableERC20Factory from '../forge-artifacts/OptimismMintableERC20Factory.json'
import proxyAdmin from '../forge-artifacts/ProxyAdmin.json'
import l2OutputOracle from '../forge-artifacts/L2OutputOracle.json'
import l1ERC721Bridge from '../forge-artifacts/L1ERC721Bridge.json'
import l2ERC721Bridge from '../forge-artifacts/L2ERC721Bridge.json'
import l1Block from '../forge-artifacts/L1Block.json'
import l2ToL1MessagePasser from '../forge-artifacts/L2ToL1MessagePasser.json'
import gasPriceOracle from '../forge-artifacts/GasPriceOracle.json'
import disputeGameFactory from '../forge-artifacts/DisputeGameFactory.json'
import optimismPortal2 from '../forge-artifacts/OptimismPortal2.json'
import faultDisputeGame from '../forge-artifacts/FaultDisputeGame.json'
import { toAddress } from './coercion'
import { DeepPartial } from './type-utils'
import { CrossChainMessenger } from '../cross-chain-messenger'
import { StandardBridgeAdapter, ETHBridgeAdapter } from '../adapters'
import {
CONTRACT_ADDRESSES,
DEFAULT_L2_CONTRACT_ADDRESSES,
BRIDGE_ADAPTER_DATA,
IGNORABLE_CONTRACTS,
} from './chain-constants'
import {
OEContracts,
OEL1Contracts,
OEL2Contracts,
OEContractsLike,
AddressLike,
BridgeAdapters,
BridgeAdapterData,
} from '../interfaces'
/**
* We've changed some contract names in this SDK to be a bit nicer. Here we remap these nicer names
* back to the original contract names so we can look them up.
*/
const NAME_REMAPPING = {
AddressManager: 'Lib_AddressManager' as const,
OVM_L1BlockNumber: 'iOVM_L1BlockNumber' as const,
WETH: 'WETH9' as const,
BedrockMessagePasser: 'L2ToL1MessagePasser' as const,
}
export const getContractInterfaceBedrock = (
name: string
): ethers.utils.Interface => {
let artifact: any = ''
switch (name) {
case 'Lib_AddressManager':
case 'AddressManager':
artifact = ''
break
case 'L1CrossDomainMessenger':
artifact = l1CrossDomainMessenger
break
case 'L1ERC721Bridge':
artifact = l1ERC721Bridge
break
case 'L2OutputOracle':
artifact = l2OutputOracle
break
case 'OptimismMintableERC20Factory':
artifact = optimismMintableERC20Factory
break
case 'ProxyAdmin':
artifact = proxyAdmin
break
case 'L1StandardBridge':
artifact = l1StandardBridge
break
case 'L2StandardBridge':
artifact = l2StandardBridge
break
case 'OptimismPortal':
artifact = optimismPortal
break
case 'L2CrossDomainMessenger':
artifact = l2CrossDomainMessenger
break
case 'OptimismMintableERC20':
artifact = optimismMintableERC20
break
case 'L2ERC721Bridge':
artifact = l2ERC721Bridge
break
case 'L1Block':
artifact = l1Block
break
case 'L2ToL1MessagePasser':
artifact = l2ToL1MessagePasser
break
case 'GasPriceOracle':
artifact = gasPriceOracle
break
case 'DisputeGameFactory':
artifact = disputeGameFactory
break
case 'OptimismPortal2':
artifact = optimismPortal2
break
case 'FaultDisputeGame':
artifact = faultDisputeGame
break
}
return new ethers.utils.Interface(artifact.abi)
}
/**
* Returns an ethers.Contract object for the given name, connected to the appropriate address for
* the given L2 chain ID. Users can also provide a custom address to connect the contract to
* instead. If the chain ID is not known then the user MUST provide a custom address or this
* function will throw an error.
*
* @param contractName Name of the contract to connect to.
* @param l2ChainId Chain ID for the L2 network.
* @param opts Additional options for connecting to the contract.
* @param opts.address Custom address to connect to the contract.
* @param opts.signerOrProvider Signer or provider to connect to the contract.
* @returns An ethers.Contract object connected to the appropriate address and interface.
*/
export const getOEContract = (
contractName: keyof OEL1Contracts | keyof OEL2Contracts,
l2ChainId: number,
opts: {
address?: AddressLike
signerOrProvider?: ethers.Signer | ethers.providers.Provider
} = {}
): Contract => {
// Generally we want to throw an error if a contract address is not provided but there are some
// exceptions, particularly for contracts that are part of an upgrade that has not yet been
// deployed. It's OK to not provide an address for these contracts with the caveat that this may
// cause a runtime error if the contract does actually need to be used.
const addresses = CONTRACT_ADDRESSES[l2ChainId]
if (addresses === undefined && opts.address === undefined) {
if (IGNORABLE_CONTRACTS.includes(contractName)) {
return undefined
} else {
throw new Error(
`cannot get contract ${contractName} for unknown L2 chain ID ${l2ChainId}, you must provide an address`
)
}
}
// Bedrock interfaces are backwards compatible. We can prefer Bedrock interfaces over legacy
// interfaces if they exist.
const name = NAME_REMAPPING[contractName] || contractName
let iface: ethers.utils.Interface
try {
iface = getContractInterfaceBedrock(name)
} catch (err) {
iface = getContractInterface(name)
}
return new Contract(
toAddress(
opts.address || addresses.l1[contractName] || addresses.l2[contractName]
),
iface,
opts.signerOrProvider
)
}
/**
* Automatically connects to all contract addresses, both L1 and L2, for the given L2 chain ID. The
* user can provide custom contract address overrides for L1 or L2 contracts. If the given chain ID
* is not known then the user MUST provide custom contract addresses for ALL L1 contracts or this
* function will throw an error.
*
* @param l2ChainId Chain ID for the L2 network.
* @param opts Additional options for connecting to the contracts.
* @param opts.l1SignerOrProvider: Signer or provider to connect to the L1 contracts.
* @param opts.l2SignerOrProvider: Signer or provider to connect to the L2 contracts.
* @param opts.overrides Custom contract address overrides for L1 or L2 contracts.
* @returns An object containing ethers.Contract objects connected to the appropriate addresses on
* both L1 and L2.
*/
export const getAllOEContracts = (
l2ChainId: number,
opts: {
l1SignerOrProvider?: ethers.Signer | ethers.providers.Provider
l2SignerOrProvider?: ethers.Signer | ethers.providers.Provider
overrides?: DeepPartial<OEContractsLike>
} = {}
): OEContracts => {
const addresses = CONTRACT_ADDRESSES[l2ChainId] || {
l1: {
AddressManager: undefined,
L1CrossDomainMessenger: undefined,
L1StandardBridge: undefined,
StateCommitmentChain: undefined,
CanonicalTransactionChain: undefined,
BondManager: undefined,
OptimismPortal: undefined,
L2OutputOracle: undefined,
DisputeGameFactory: undefined,
OptimismPortal2: undefined,
},
l2: DEFAULT_L2_CONTRACT_ADDRESSES,
}
// Attach all L1 contracts.
const l1Contracts = {} as OEL1Contracts
for (const [contractName, contractAddress] of Object.entries(addresses.l1)) {
l1Contracts[contractName] = getOEContract(
contractName as keyof OEL1Contracts,
l2ChainId,
{
address: opts.overrides?.l1?.[contractName] || contractAddress,
signerOrProvider: opts.l1SignerOrProvider,
}
)
}
// Attach all L2 contracts.
const l2Contracts = {} as OEL2Contracts
for (const [contractName, contractAddress] of Object.entries(addresses.l2)) {
l2Contracts[contractName] = getOEContract(
contractName as keyof OEL2Contracts,
l2ChainId,
{
address: opts.overrides?.l2?.[contractName] || contractAddress,
signerOrProvider: opts.l2SignerOrProvider,
}
)
}
return {
l1: l1Contracts,
l2: l2Contracts,
}
}
/**
* Gets a series of bridge adapters for the given L2 chain ID.
*
* @param l2ChainId Chain ID for the L2 network.
* @param messenger Cross chain messenger to connect to the bridge adapters
* @param opts Additional options for connecting to the custom bridges.
* @param opts.overrides Custom bridge adapters.
* @returns An object containing all bridge adapters
*/
export const getBridgeAdapters = (
l2ChainId: number,
messenger: CrossChainMessenger,
opts?: {
overrides?: BridgeAdapterData
contracts?: DeepPartial<OEContractsLike>
}
): BridgeAdapters => {
const adapterData: BridgeAdapterData = {
...(CONTRACT_ADDRESSES[l2ChainId] || opts?.contracts?.l1?.L1StandardBridge
? {
Standard: {
Adapter: StandardBridgeAdapter,
l1Bridge:
opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge,
},
ETH: {
Adapter: ETHBridgeAdapter,
l1Bridge:
opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge,
},
}
: {}),
...(BRIDGE_ADAPTER_DATA[l2ChainId] || {}),
...(opts?.overrides || {}),
}
const adapters: BridgeAdapters = {}
for (const [bridgeName, bridgeData] of Object.entries(adapterData)) {
adapters[bridgeName] = new bridgeData.Adapter({
messenger,
l1Bridge: bridgeData.l1Bridge,
l2Bridge: bridgeData.l2Bridge,
})
}
return adapters
}
export * from './coercion'
export * from './contracts'
export * from './type-utils'
export * from './misc-utils'
export * from './merkle-utils'
export * from './chain-constants'
export * from './message-utils'
/* Imports: External */
import { ethers, BigNumber } from 'ethers'
import {
fromHexString,
toHexString,
toRpcHexString,
} from '@eth-optimism/core-utils'
import { MerkleTree } from 'merkletreejs'
import * as rlp from 'rlp'
/**
* Generates a Merkle proof (using the particular scheme we use within Lib_MerkleTree).
*
* @param leaves Leaves of the merkle tree.
* @param index Index to generate a proof for.
* @returns Merkle proof sibling leaves, as hex strings.
*/
export const makeMerkleTreeProof = (
leaves: string[],
index: number
): string[] => {
// Our specific Merkle tree implementation requires that the number of leaves is a power of 2.
// If the number of given leaves is less than a power of 2, we need to round up to the next
// available power of 2. We fill the remaining space with the hash of bytes32(0).
const correctedTreeSize = Math.pow(2, Math.ceil(Math.log2(leaves.length)))
const parsedLeaves = []
for (let i = 0; i < correctedTreeSize; i++) {
if (i < leaves.length) {
parsedLeaves.push(leaves[i])
} else {
parsedLeaves.push(ethers.utils.keccak256('0x' + '00'.repeat(32)))
}
}
// merkletreejs prefers things to be Buffers.
const bufLeaves = parsedLeaves.map(fromHexString)
const tree = new MerkleTree(bufLeaves, (el: Buffer | string): Buffer => {
return fromHexString(ethers.utils.keccak256(el))
})
const proof = tree.getProof(bufLeaves[index], index).map((element: any) => {
return toHexString(element.data)
})
return proof
}
/**
* Fix for the case where the final proof element is less than 32 bytes and the element exists
* inside of a branch node. Current implementation of the onchain MPT contract can't handle this
* natively so we instead append an extra proof element to handle it instead.
*
* @param key Key that the proof is for.
* @param proof Proof to potentially modify.
* @returns Modified proof.
*/
export const maybeAddProofNode = (key: string, proof: string[]) => {
const modifiedProof = [...proof]
const finalProofEl = modifiedProof[modifiedProof.length - 1]
const finalProofElDecoded = rlp.decode(finalProofEl) as any
if (finalProofElDecoded.length === 17) {
for (const item of finalProofElDecoded) {
// Find any nodes located inside of the branch node.
if (Array.isArray(item)) {
// Check if the key inside the node matches the key we're looking for. We remove the first
// two characters (0x) and then we remove one more character (the first nibble) since this
// is the identifier for the type of node we're looking at. In this case we don't actually
// care what type of node it is because a branch node would only ever be the final proof
// element if (1) it includes the leaf node we're looking for or (2) it stores the value
// within itself. If (1) then this logic will work, if (2) then this won't find anything
// and we won't append any proof elements, which is exactly what we would want.
const suffix = toHexString(item[0]).slice(3)
if (key.endsWith(suffix)) {
modifiedProof.push(toHexString(rlp.encode(item)))
}
}
}
}
// Return the modified proof.
return modifiedProof
}
/**
* Generates a Merkle-Patricia trie proof for a given account and storage slot.
*
* @param provider RPC provider attached to an EVM-compatible chain.
* @param blockNumber Block number to generate the proof at.
* @param address Address to generate the proof for.
* @param slot Storage slot to generate the proof for.
* @returns Account proof and storage proof.
*/
export const makeStateTrieProof = async (
provider: ethers.providers.JsonRpcProvider,
blockNumber: number,
address: string,
slot: string
): Promise<{
accountProof: string[]
storageProof: string[]
storageValue: BigNumber
storageRoot: string
}> => {
const proof = await provider.send('eth_getProof', [
address,
[slot],
toRpcHexString(blockNumber),
])
proof.storageProof[0].proof = maybeAddProofNode(
ethers.utils.keccak256(slot),
proof.storageProof[0].proof
)
return {
accountProof: proof.accountProof,
storageProof: proof.storageProof[0].proof,
storageValue: BigNumber.from(proof.storageProof[0].value),
storageRoot: proof.storageHash,
}
}
import { hashWithdrawal } from '@eth-optimism/core-utils'
import { BigNumber, utils, ethers } from 'ethers'
import { LowLevelMessage } from '../interfaces'
const { hexDataLength } = utils
// Constants used by `CrossDomainMessenger.baseGas`
const RELAY_CONSTANT_OVERHEAD = BigNumber.from(200_000)
const RELAY_PER_BYTE_DATA_COST = BigNumber.from(16)
const MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR = BigNumber.from(64)
const MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR = BigNumber.from(63)
const RELAY_CALL_OVERHEAD = BigNumber.from(40_000)
const RELAY_RESERVED_GAS = BigNumber.from(40_000)
const RELAY_GAS_CHECK_BUFFER = BigNumber.from(5_000)
/**
* Utility for hashing a LowLevelMessage object.
*
* @param message LowLevelMessage object to hash.
* @returns Hash of the given LowLevelMessage.
*/
export const hashLowLevelMessage = (message: LowLevelMessage): string => {
return hashWithdrawal(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
)
}
/**
* Utility for hashing a message hash. This computes the storage slot
* where the message hash will be stored in state. HashZero is used
* because the first mapping in the contract is used.
*
* @param messageHash Message hash to hash.
* @returns Hash of the given message hash.
*/
export const hashMessageHash = (messageHash: string): string => {
const data = ethers.utils.defaultAbiCoder.encode(
['bytes32', 'uint256'],
[messageHash, ethers.constants.HashZero]
)
return ethers.utils.keccak256(data)
}
/**
* Compute the min gas limit for a migrated withdrawal.
*/
export const migratedWithdrawalGasLimit = (
data: string,
chainID: number
): BigNumber => {
// Compute the gas limit and cap at 25 million
const dataCost = BigNumber.from(hexDataLength(data)).mul(
RELAY_PER_BYTE_DATA_COST
)
let overhead: BigNumber
if (chainID === 420) {
overhead = BigNumber.from(200_000)
} else {
// Dynamic overhead (EIP-150)
// We use a constant 1 million gas limit due to the overhead of simulating all migrated withdrawal
// transactions during the migration. This is a conservative estimate, and if a withdrawal
// uses more than the minimum gas limit, it will fail and need to be replayed with a higher
// gas limit.
const dynamicOverhead = MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR.mul(
1_000_000
).div(MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR)
// Constant overhead
overhead = RELAY_CONSTANT_OVERHEAD.add(dynamicOverhead)
.add(RELAY_CALL_OVERHEAD)
// Gas reserved for the worst-case cost of 3/5 of the `CALL` opcode's dynamic gas
// factors. (Conservative)
// Relay reserved gas (to ensure execution of `relayMessage` completes after the
// subcontext finishes executing) (Conservative)
.add(RELAY_RESERVED_GAS)
// Gas reserved for the execution between the `hasMinGas` check and the `CALL`
// opcode. (Conservative)
.add(RELAY_GAS_CHECK_BUFFER)
}
let minGasLimit = dataCost.add(overhead)
if (minGasLimit.gt(25_000_000)) {
minGasLimit = BigNumber.from(25_000_000)
}
return minGasLimit
}
// TODO: A lot of this stuff could probably live in core-utils instead.
// Review this file eventually for stuff that could go into core-utils.
/**
* Returns a copy of the given object ({ ...obj }) with the given keys omitted.
*
* @param obj Object to return with the keys omitted.
* @param keys Keys to omit from the returned object.
* @returns A copy of the given object with the given keys omitted.
*/
export const omit = <T extends object, K extends string | number | symbol>(
obj: T,
...keys: K[]
): Omit<T, K> => {
const copy = { ...obj }
for (const key of keys) {
delete copy[key as string]
}
return copy
}
/**
* Utility type for deep partials.
*/
export type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>
}
import { task, types } from 'hardhat/config'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { Wallet, providers } from 'ethers'
import { predeploys } from '@eth-optimism/core-utils'
import 'hardhat-deploy'
import '@nomiclabs/hardhat-ethers'
import {
CrossChainMessenger,
StandardBridgeAdapter,
MessageStatus,
} from '../src'
task('finalize-withdrawal', 'Finalize a withdrawal')
.addParam(
'transactionHash',
'L2 Transaction hash to finalize',
'',
types.string
)
.addParam('l2Url', 'L2 HTTP URL', 'http://localhost:9545', types.string)
.setAction(async (args, hre: HardhatRuntimeEnvironment) => {
const txHash = args.transactionHash
if (txHash === '') {
console.log('No tx hash')
}
const signers = await hre.ethers.getSigners()
if (signers.length === 0) {
throw new Error('No configured signers')
}
const signer = signers[0]
const address = await signer.getAddress()
console.log(`Using signer: ${address}`)
const l2Provider = new providers.StaticJsonRpcProvider(args.l2Url)
const l2Signer = new Wallet(hre.network.config.accounts[0], l2Provider)
let Deployment__L1StandardBridgeProxy = await hre.deployments.getOrNull(
'L1StandardBridgeProxy'
)
if (Deployment__L1StandardBridgeProxy === undefined) {
Deployment__L1StandardBridgeProxy = await hre.deployments.getOrNull(
'Proxy__OVM_L1StandardBridge'
)
}
let Deployment__L1CrossDomainMessengerProxy =
await hre.deployments.getOrNull('L1CrossDomainMessengerProxy')
if (Deployment__L1CrossDomainMessengerProxy === undefined) {
Deployment__L1CrossDomainMessengerProxy = await hre.deployments.getOrNull(
'Proxy__OVM_L1CrossDomainMessenger'
)
}
const Deployment__L2OutputOracleProxy = await hre.deployments.getOrNull(
'L2OutputOracleProxy'
)
const Deployment__OptimismPortalProxy = await hre.deployments.getOrNull(
'OptimismPortalProxy'
)
if (Deployment__L1StandardBridgeProxy?.address === undefined) {
throw new Error('No L1StandardBridgeProxy deployment')
}
if (Deployment__L1CrossDomainMessengerProxy?.address === undefined) {
throw new Error('No L1CrossDomainMessengerProxy deployment')
}
if (Deployment__L2OutputOracleProxy?.address === undefined) {
throw new Error('No L2OutputOracleProxy deployment')
}
if (Deployment__OptimismPortalProxy?.address === undefined) {
throw new Error('No OptimismPortalProxy deployment')
}
const messenger = new CrossChainMessenger({
l1SignerOrProvider: signer,
l2SignerOrProvider: l2Signer,
l1ChainId: await signer.getChainId(),
l2ChainId: await l2Signer.getChainId(),
bridges: {
Standard: {
Adapter: StandardBridgeAdapter,
l1Bridge: Deployment__L1StandardBridgeProxy?.address,
l2Bridge: predeploys.L2StandardBridge,
},
},
contracts: {
l1: {
L1StandardBridge: Deployment__L1StandardBridgeProxy?.address,
L1CrossDomainMessenger:
Deployment__L1CrossDomainMessengerProxy?.address,
L2OutputOracle: Deployment__L2OutputOracleProxy?.address,
OptimismPortal: Deployment__OptimismPortalProxy?.address,
},
},
})
console.log(`Fetching message status for ${txHash}`)
const status = await messenger.getMessageStatus(txHash)
console.log(`Status: ${MessageStatus[status]}`)
if (status === MessageStatus.READY_TO_PROVE) {
const proveTx = await messenger.proveMessage(txHash)
const proveReceipt = await proveTx.wait()
console.log('Prove receipt', proveReceipt)
const finalizeInterval = setInterval(async () => {
const currentStatus = await messenger.getMessageStatus(txHash)
console.log(`Message status: ${MessageStatus[currentStatus]}`)
}, 3000)
try {
await messenger.waitForMessageStatus(
txHash,
MessageStatus.READY_FOR_RELAY
)
} finally {
clearInterval(finalizeInterval)
}
const tx = await messenger.finalizeMessage(txHash)
const receipt = await tx.wait()
console.log(receipt)
console.log('Finalized withdrawal')
}
})
# test-next
To run these tests it is expected that anvil is already running.
See [circle config sdk-next tests](../../../.circleci/config.yml) for which anvil commands you should run
import ethers from 'ethers'
import { describe, expect, it } from 'vitest'
import { Address, PublicClient, parseEther } from 'viem'
import {
l1TestClient,
l2TestClient,
l1PublicClient,
l2PublicClient,
} from './testUtils/viemClients'
import { BRIDGE_ADAPTER_DATA, CrossChainMessenger, L2ChainID } from '../src'
import { l1Provider, l2Provider } from './testUtils/ethersProviders'
const ECO_WHALE: Address = '0x982E148216E3Aa6B38f9D901eF578B5c06DD7502'
// we should instead use tokenlist as source of truth
const ECO_L1_TOKEN_ADDRESS: Address =
'0x3E87d4d9E69163E7590f9b39a70853cf25e5ABE3'
const ECO_L2_TOKEN_ADDRESS: Address =
'0xD2f598c826429EEe7c071C02735549aCd88F2c09'
const getERC20TokenBalance = async (
publicClient: PublicClient,
tokenAddress: Address,
ownerAddress: Address
) => {
const result = await publicClient.readContract({
address: tokenAddress,
abi: [
{
inputs: [{ name: 'owner', type: 'address' }],
name: 'balanceOf',
outputs: [{ name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'balanceOf',
args: [ownerAddress],
})
return result as bigint
}
const getL1ERC20TokenBalance = async (ownerAddress: Address) => {
return getERC20TokenBalance(
l1PublicClient,
ECO_L1_TOKEN_ADDRESS,
ownerAddress
)
}
const getL2ERC20TokenBalance = async (ownerAddress: Address) => {
return getERC20TokenBalance(
l2PublicClient,
ECO_L2_TOKEN_ADDRESS,
ownerAddress
)
}
describe.skip('ECO token', () => {
it('sdk should be able to deposit to l1 bridge contract correctly', async () => {
await l1TestClient.impersonateAccount({ address: ECO_WHALE })
const l1EcoWhaleSigner = await l1Provider.getSigner(ECO_WHALE)
const preBridgeL1EcoWhaleBalance = await getL1ERC20TokenBalance(ECO_WHALE)
const crossChainMessenger = new CrossChainMessenger({
l1SignerOrProvider: l1EcoWhaleSigner,
l2SignerOrProvider: l2Provider,
l1ChainId: 5,
l2ChainId: 420,
bedrock: true,
bridges: BRIDGE_ADAPTER_DATA[L2ChainID.OPTIMISM_GOERLI],
})
await crossChainMessenger.approveERC20(
ECO_L1_TOKEN_ADDRESS,
ECO_L2_TOKEN_ADDRESS,
ethers.utils.parseEther('0.1')
)
const txResponse = await crossChainMessenger.depositERC20(
ECO_L1_TOKEN_ADDRESS,
ECO_L2_TOKEN_ADDRESS,
ethers.utils.parseEther('0.1')
)
await txResponse.wait()
const l1EcoWhaleBalance = await getL1ERC20TokenBalance(ECO_WHALE)
expect(l1EcoWhaleBalance).toEqual(
preBridgeL1EcoWhaleBalance - parseEther('0.1')
)
}, 20_000)
it('sdk should be able to withdraw into the l2 bridge contract correctly', async () => {
await l2TestClient.impersonateAccount({ address: ECO_WHALE })
const l2EcoWhaleSigner = await l2Provider.getSigner(ECO_WHALE)
const preBridgeL2EcoWhaleBalance = await getL2ERC20TokenBalance(ECO_WHALE)
const crossChainMessenger = new CrossChainMessenger({
l1SignerOrProvider: l1Provider,
l2SignerOrProvider: l2EcoWhaleSigner,
l1ChainId: 5,
l2ChainId: 420,
bedrock: true,
bridges: BRIDGE_ADAPTER_DATA[L2ChainID.OPTIMISM_GOERLI],
})
const txResponse = await crossChainMessenger.withdrawERC20(
ECO_L1_TOKEN_ADDRESS,
ECO_L2_TOKEN_ADDRESS,
ethers.utils.parseEther('0.1')
)
await txResponse.wait()
const l2EcoWhaleBalance = await getL2ERC20TokenBalance(ECO_WHALE)
expect(l2EcoWhaleBalance).toEqual(
preBridgeL2EcoWhaleBalance - parseEther('0.1')
)
}, 20_000)
})
import { describe, it, expect } from 'vitest'
import { Address, Hex, encodePacked, keccak256, toHex } from 'viem'
import { ethers } from 'ethers'
import { z } from 'zod'
import { hashCrossDomainMessagev1 } from '@eth-optimism/core-utils'
import { optimismSepolia } from 'viem/chains'
import { CONTRACT_ADDRESSES, CrossChainMessenger } from '../src'
import { sepoliaPublicClient, sepoliaTestClient } from './testUtils/viemClients'
import { sepoliaProvider, opSepoliaProvider } from './testUtils/ethersProviders'
/**
* Generated on Mar 28 2024 using
* `forge inspect L1CrossDomainMessenger storage-layout`
**/
const failedMessagesStorageLayout = {
astId: 7989,
contract: 'src/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger',
label: 'failedMessages',
offset: 0,
slot: 206n,
type: 't_mapping(t_bytes32,t_bool)',
}
const sepoliaCrossDomainMessengerAddress = CONTRACT_ADDRESSES[
optimismSepolia.id
].l1.L1CrossDomainMessenger as Address
const setMessageAsFailed = async (tx: Hex) => {
const message = await crossChainMessenger.toCrossChainMessage(tx)
const messageHash = hashCrossDomainMessagev1(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
) as Hex
const keySlotHash = keccak256(
encodePacked(
['bytes32', 'uint256'],
[messageHash, failedMessagesStorageLayout.slot]
)
)
return sepoliaTestClient.setStorageAt({
address: sepoliaCrossDomainMessengerAddress,
index: keySlotHash,
value: toHex(true, { size: 32 }),
})
}
const E2E_PRIVATE_KEY = z
.string()
.describe('Private key')
// Mnemonic: test test test test test test test test test test test junk
.default('0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6')
.parse(import.meta.env.VITE_E2E_PRIVATE_KEY)
const sepoliaWallet = new ethers.Wallet(E2E_PRIVATE_KEY, sepoliaProvider)
const crossChainMessenger = new CrossChainMessenger({
l1SignerOrProvider: sepoliaWallet,
l2SignerOrProvider: opSepoliaProvider,
l1ChainId: 11155111,
l2ChainId: 11155420,
bedrock: true,
})
describe('replaying failed messages', () => {
it('should be able to replay failed messages', async () => {
// Grab an existing tx but mark it as failed
// @see https://sepolia-optimism.etherscan.io/tx/0x28249a36f764afab583a4633d59ff6c2a0e934293062bffa7cedb662e5da9abd
const tx =
'0x28249a36f764afab583a4633d59ff6c2a0e934293062bffa7cedb662e5da9abd'
await setMessageAsFailed(tx)
// debugging ethers.js is brutal because of error message so let's instead
// send the tx with viem. If it succeeds we will then test with ethers
const txData =
await crossChainMessenger.populateTransaction.finalizeMessage(tx)
await sepoliaPublicClient.call({
data: txData.data as Hex,
to: txData.to as Address,
})
// finalize the message
const finalizeTx = await crossChainMessenger.finalizeMessage(tx)
const receipt = await finalizeTx.wait()
expect(receipt.transactionHash).toBeDefined()
})
})
import { describe, expect, it } from 'vitest'
import { CrossChainMessenger, MessageStatus } from '../src'
import { l1Provider, l2Provider } from './testUtils/ethersProviders'
const crossChainMessenger = new CrossChainMessenger({
l1SignerOrProvider: l1Provider,
l2SignerOrProvider: l2Provider,
l1ChainId: 5,
l2ChainId: 420,
bedrock: true,
})
describe.skip('getMessageStatus', () => {
it(`should be able to correctly find a finalized withdrawal`, async () => {
/**
* Tx hash of a withdrawal
*
* @see https://goerli-optimism.etherscan.io/tx/0x8fb235a61079f3fa87da66e78c9da075281bc4ba5f1af4b95197dd9480e03bb5
*/
const txWithdrawalHash =
'0x8fb235a61079f3fa87da66e78c9da075281bc4ba5f1af4b95197dd9480e03bb5'
const txReceipt = await l2Provider.getTransactionReceipt(txWithdrawalHash)
expect(txReceipt).toBeDefined()
expect(
await crossChainMessenger.getMessageStatus(
txWithdrawalHash,
0,
9370789 - 1000,
9370789
)
).toBe(MessageStatus.RELAYED)
}, 20_000)
it(`should return READY_FOR_RELAY if not in block range`, async () => {
const txWithdrawalHash =
'0x8fb235a61079f3fa87da66e78c9da075281bc4ba5f1af4b95197dd9480e03bb5'
const txReceipt = await l2Provider.getTransactionReceipt(txWithdrawalHash)
expect(txReceipt).toBeDefined()
expect(
await crossChainMessenger.getMessageStatus(txWithdrawalHash, 0, 0, 0)
).toBe(MessageStatus.READY_FOR_RELAY)
}, 20_000)
})
import ethers from 'ethers'
import { describe, expect, it } from 'vitest'
import { z } from 'zod'
import { CrossChainMessenger } from '../src'
import { l1Provider, l2Provider } from './testUtils/ethersProviders'
/**
* This test repros the bug where legacy withdrawals are not provable
*/
/*******
Cast results from runnning cast tx and cast receipt on the l2 tx hash
cast tx 0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81 --rpc-url https://goerli.optimism.io
blockHash 0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0
blockNumber 2337599
from 0x1d86C2F5cc7fBEc35FEDbd3293b5004A841EA3F0
gas 118190
gasPrice 1
hash 0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81
input 0x32b7006d000000000000000000000000deaddeaddeaddeaddeaddeaddeaddeaddead000000000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000
nonce 10
r 0x7e58c5dbb37f57303d936562d89a75a20be2a45f54c5d44dc73119453adf2e08
s 0x1bc952bd048dd38668a0c3b4bac202945c5a150465b551dd2a768e54a746e2c4
to 0x4200000000000000000000000000000000000010
transactionIndex 0
v 875
value 0
index 2337598
l1BlockNumber 7850866
l1Timestamp 1666982083
queueOrigin sequencer
rawTransaction 0xf901070a018301cdae94420000000000000000000000000000000000001080b8a432b7006d000000000000000000000000deaddeaddeaddeaddeaddeaddeaddeaddead000000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000082036ba07e58c5dbb37f57303d936562d89a75a20be2a45f54c5d44dc73119453adf2e08a01bc952bd048dd38668a0c3b4bac202945c5a150465b551dd2a768e54a746e2c4
cast tx 0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81 --rpc-url https://goerli.optimism.io
blockHash 0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0
blockNumber 2337599
contractAddress
cumulativeGasUsed 115390
effectiveGasPrice
gasUsed 115390
logs [{"address":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f0","0x0000000000000000000000000000000000000000000000000000000000000000"],"data":"0x00000000000000000000000000000000000000000000000000005af3107a4000","blockHash":"0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0","blockNumber":"0x23ab3f","transactionHash":"0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81","transactionIndex":"0x0","logIndex":"0x0","removed":false},{"address":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000","topics":["0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5","0x0000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f0"],"data":"0x00000000000000000000000000000000000000000000000000005af3107a4000","blockHash":"0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0","blockNumber":"0x23ab3f","transactionHash":"0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81","transactionIndex":"0x0","logIndex":"0x1","removed":false},{"address":"0x4200000000000000000000000000000000000007","topics":["0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a","0x000000000000000000000000636af16bf2f682dd3109e60102b8e1a089fedaa8"],"data":"0x00000000000000000000000042000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000001a048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a41532ec340000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f00000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f000000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0","blockNumber":"0x23ab3f","transactionHash":"0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81","transactionIndex":"0x0","logIndex":"0x2","removed":false},{"address":"0x4200000000000000000000000000000000000010","topics":["0x73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000deaddeaddeaddeaddeaddeaddeaddeaddead0000","0x0000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f0"],"data":"0x0000000000000000000000001d86c2f5cc7fbec35fedbd3293b5004a841ea3f000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x67956cee3de38d49206d34b77f560c4c371d77b36584047ade8bf7b67bf210c0","blockNumber":"0x23ab3f","transactionHash":"0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81","transactionIndex":"0x0","logIndex":"0x3","removed":false}]
logsBloom 0x00000000000000000010000000000000000000000000001000100000001000000000000000000080000000000000008000000800000000000000000000000240000000002000400040000008000000000000000000000000000000000000000100000000020000000000000000000800080000000040000000000010000000000000000000000000000000000000000000800000000000000020000000200000000000000000000001000000000000000000200000000000000000000000000000000002000000200000000400000000000002100000000000000000000020001000000000000000000000000000000000000000000000000000010000008000
root
status 1
transactionHash 0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81
transactionIndex 0
type
*/
const E2E_PRIVATE_KEY = z
.string()
.describe('Private key')
.parse(import.meta.env.VITE_E2E_PRIVATE_KEY)
const l1Wallet = new ethers.Wallet(E2E_PRIVATE_KEY, l1Provider)
const crossChainMessenger = new CrossChainMessenger({
l1SignerOrProvider: l1Wallet,
l2SignerOrProvider: l2Provider,
l1ChainId: 5,
l2ChainId: 420,
bedrock: true,
})
describe.skip('prove message', () => {
it(`should prove a legacy tx
`, async () => {
/**
* Tx hash of legacy withdrawal
*
* @see https://goerli-optimism.etherscan.io/tx/0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81
*/
const txWithdrawalHash =
'0xd66fda632b51a8b25a9d260d70da8be57b9930c4616370861526335c3e8eef81'
const txReceipt = await l2Provider.getTransactionReceipt(txWithdrawalHash)
expect(txReceipt).toBeDefined()
const tx = await crossChainMessenger.proveMessage(txWithdrawalHash)
const receipt = await tx.wait()
// A 1 means the transaction was successful
expect(receipt.status).toBe(1)
}, 20_000)
})
import ethers from 'ethers'
import { z } from 'zod'
/**
* @deprecated
*/
const E2E_RPC_URL_L1 = z
.string()
.url()
.default('http://localhost:8545')
.describe('L1 ethereum rpc Url')
.parse(import.meta.env.VITE_E2E_RPC_URL_L1)
/**
* @deprecated
*/
const E2E_RPC_URL_L2 = z
.string()
.url()
.default('http://localhost:9545')
.describe('L2 ethereum rpc Url')
.parse(import.meta.env.VITE_E2E_RPC_URL_L2)
const jsonRpcHeaders = { 'User-Agent': 'eth-optimism/@gateway/backend' }
/**
* @deprecated
*/
export const l1Provider = new ethers.providers.JsonRpcProvider({
url: E2E_RPC_URL_L1,
headers: jsonRpcHeaders,
})
/**
* @deprecated
*/
export const l2Provider = new ethers.providers.JsonRpcProvider({
url: E2E_RPC_URL_L2,
headers: jsonRpcHeaders,
})
export const E2E_RPC_URL_SEPOLIA = z
.string()
.url()
.default('http://localhost:8545')
.describe('SEPOLIA ethereum rpc Url')
.parse(import.meta.env.VITE_E2E_RPC_URL_SEPOLIA)
export const E2E_RPC_URL_OP_SEPOLIA = z
.string()
.url()
.default('http://localhost:9545')
.describe('OP_SEPOLIA ethereum rpc Url')
.parse(import.meta.env.VITE_E2E_RPC_URL_OP_SEPOLIA)
export const sepoliaProvider = new ethers.providers.JsonRpcProvider({
url: E2E_RPC_URL_SEPOLIA,
headers: jsonRpcHeaders,
})
export const opSepoliaProvider = new ethers.providers.JsonRpcProvider({
url: E2E_RPC_URL_OP_SEPOLIA,
headers: jsonRpcHeaders,
})
import {
createTestClient,
createPublicClient,
createWalletClient,
http,
} from 'viem'
import { goerli, optimismGoerli, optimismSepolia, sepolia } from 'viem/chains'
import { E2E_RPC_URL_OP_SEPOLIA, E2E_RPC_URL_SEPOLIA } from './ethersProviders'
/**
* @deprecated
*/
const L1_CHAIN = goerli
/**
* @deprecated
*/
const L2_CHAIN = optimismGoerli
/**
* @deprecated
*/
const L1_RPC_URL = 'http://localhost:8545'
/**
* @deprecated
*/
const L2_RPC_URL = 'http://localhost:9545'
/**
* @deprecated
*/
export const l1TestClient = createTestClient({
mode: 'anvil',
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
/**
* @deprecated
*/
export const l2TestClient = createTestClient({
mode: 'anvil',
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
/**
* @deprecated
*/
export const l1PublicClient = createPublicClient({
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
/**
* @deprecated
*/
export const l2PublicClient = createPublicClient({
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
/**
* @deprecated
*/
export const l1WalletClient = createWalletClient({
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
/**
* @deprecated
*/
export const l2WalletClient = createWalletClient({
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
const SEPOLIA_CHAIN = sepolia
const OP_SEPOLIA_CHAIN = optimismSepolia
export const sepoliaTestClient = createTestClient({
mode: 'anvil',
chain: SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_SEPOLIA),
})
export const opSepoliaTestClient = createTestClient({
mode: 'anvil',
chain: OP_SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_OP_SEPOLIA),
})
export const sepoliaPublicClient = createPublicClient({
chain: SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_SEPOLIA),
})
export const opSepoliaPublicClient = createPublicClient({
chain: OP_SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_OP_SEPOLIA),
})
export const sepoliaWalletClient = createWalletClient({
chain: SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_SEPOLIA),
})
export const opSepoliaWalletClient = createWalletClient({
chain: OP_SEPOLIA_CHAIN,
transport: http(E2E_RPC_URL_OP_SEPOLIA),
})
pragma solidity ^0.8.9;
contract AbsolutelyNothing {
function doAbsolutelyNothing() public {
return;
}
}
pragma solidity ^0.8.9;
// Right now this is copy/pasted from the contracts package. We need to do this because we don't
// currently copy the contracts into the root of the contracts package in the correct way until
// we bundle the contracts package for publication. As a result, we can't properly use the
// package the way we want to from inside the monorepo (yet). Needs to be fixed as part of a
// separate pull request.
interface ICrossDomainMessenger {
/**********
* Events *
**********/
event SentMessage(
address indexed target,
address sender,
bytes message,
uint256 messageNonce,
uint256 gasLimit
);
event RelayedMessage(bytes32 indexed msgHash);
event FailedRelayedMessage(bytes32 indexed msgHash);
/*************
* Variables *
*************/
function xDomainMessageSender() external view returns (address);
/********************
* Public Functions *
********************/
/**
* Sends a cross domain message to the target messenger.
* @param _target Target contract address.
* @param _message Message to send to the target.
* @param _gasLimit Gas limit for the provided message.
*/
function sendMessage(
address _target,
bytes calldata _message,
uint32 _gasLimit
) external;
}
pragma solidity ^0.8.9;
contract MessageEncodingHelper {
// This function is copy/pasted from the Lib_CrossDomainUtils library. We have to do this
// because the Lib_CrossDomainUtils library does not provide a function for hashing. Instead,
// I'm duplicating the functionality of the library here and exposing an additional method that
// does the required hashing. This is fragile and will break if we ever update the way that our
// contracts hash the encoded data, but at least it works for now.
// TODO: Next time we're planning to upgrade the contracts, make sure that the library also
// contains a function for hashing.
function encodeXDomainCalldata(
address _target,
address _sender,
bytes memory _message,
uint256 _messageNonce
) public pure returns (bytes memory) {
return
abi.encodeWithSignature(
"relayMessage(address,address,bytes,uint256)",
_target,
_sender,
_message,
_messageNonce
);
}
function hashXDomainCalldata(
address _target,
address _sender,
bytes memory _message,
uint256 _messageNonce
) public pure returns (bytes32) {
return keccak256(
encodeXDomainCalldata(
_target,
_sender,
_message,
_messageNonce
)
);
}
}
pragma solidity ^0.8.9;
import { MockMessenger } from "./MockMessenger.sol";
contract MockBridge {
event ETHDepositInitiated(
address indexed _from,
address indexed _to,
uint256 _amount,
bytes _data
);
event ERC20DepositInitiated(
address indexed _l1Token,
address indexed _l2Token,
address indexed _from,
address _to,
uint256 _amount,
bytes _data
);
event ERC20WithdrawalFinalized(
address indexed _l1Token,
address indexed _l2Token,
address indexed _from,
address _to,
uint256 _amount,
bytes _data
);
event WithdrawalInitiated(
address indexed _l1Token,
address indexed _l2Token,
address indexed _from,
address _to,
uint256 _amount,
bytes _data
);
event DepositFinalized(
address indexed _l1Token,
address indexed _l2Token,
address indexed _from,
address _to,
uint256 _amount,
bytes _data
);
event DepositFailed(
address indexed _l1Token,
address indexed _l2Token,
address indexed _from,
address _to,
uint256 _amount,
bytes _data
);
struct TokenEventStruct {
address l1Token;
address l2Token;
address from;
address to;
uint256 amount;
bytes data;
}
MockMessenger public messenger;
constructor(MockMessenger _messenger) {
messenger = _messenger;
}
function emitERC20DepositInitiated(
TokenEventStruct memory _params
) public {
emit ERC20DepositInitiated(_params.l1Token, _params.l2Token, _params.from, _params.to, _params.amount, _params.data);
messenger.triggerSentMessageEvent(
MockMessenger.SentMessageEventParams(
address(0),
address(0),
hex"1234",
1234,
12345678,
0
)
);
}
function emitERC20WithdrawalFinalized(
TokenEventStruct memory _params
) public {
emit ERC20WithdrawalFinalized(_params.l1Token, _params.l2Token, _params.from, _params.to, _params.amount, _params.data);
}
function emitWithdrawalInitiated(
TokenEventStruct memory _params
) public {
emit WithdrawalInitiated(_params.l1Token, _params.l2Token, _params.from, _params.to, _params.amount, _params.data);
messenger.triggerSentMessageEvent(
MockMessenger.SentMessageEventParams(
address(0),
address(0),
hex"1234",
1234,
12345678,
0
)
);
}
function emitDepositFinalized(
TokenEventStruct memory _params
) public {
emit DepositFinalized(_params.l1Token, _params.l2Token, _params.from, _params.to, _params.amount, _params.data);
}
function emitDepositFailed(
TokenEventStruct memory _params
) public {
emit DepositFailed(_params.l1Token, _params.l2Token, _params.from, _params.to, _params.amount, _params.data);
}
function depositETH(
uint32 _l2GasLimit,
bytes memory _data
)
public
payable
{
emit ETHDepositInitiated(
msg.sender,
msg.sender,
msg.value,
_data
);
}
function withdraw(
address _l2Token,
uint256 _amount,
uint32 _l1Gas,
bytes calldata _data
)
public
payable
{
emit WithdrawalInitiated(
address(0),
_l2Token,
msg.sender,
msg.sender,
_amount,
_data
);
}
}
pragma solidity ^0.8.9;
import { ICrossDomainMessenger } from "./ICrossDomainMessenger.sol";
contract MockMessenger is ICrossDomainMessenger {
function xDomainMessageSender() public view returns (address) {
return address(0);
}
uint256 public nonce;
mapping (bytes32 => bool) public successfulMessages;
mapping (bytes32 => bool) public failedMessages;
// Empty function to satisfy the interface.
function sendMessage(
address _target,
bytes calldata _message,
uint32 _gasLimit
) public {
emit SentMessage(
_target,
msg.sender,
_message,
nonce,
_gasLimit
);
nonce++;
}
function replayMessage(
address _target,
address _sender,
bytes calldata _message,
uint256 _queueIndex,
uint32 _oldGasLimit,
uint32 _newGasLimit
) public {
emit SentMessage(
_target,
_sender,
_message,
nonce,
_newGasLimit
);
nonce++;
}
struct SentMessageEventParams {
address target;
address sender;
bytes message;
uint256 messageNonce;
uint256 minGasLimit;
uint256 value;
}
function doNothing() public {
return;
}
function triggerSentMessageEvent(
SentMessageEventParams memory _params
) public {
emit SentMessage(
_params.target,
_params.sender,
_params.message,
_params.messageNonce,
_params.minGasLimit
);
}
function triggerSentMessageEvents(
SentMessageEventParams[] memory _params
) public {
for (uint256 i = 0; i < _params.length; i++) {
triggerSentMessageEvent(_params[i]);
}
}
function triggerRelayedMessageEvents(
bytes32[] memory _params
) public {
for (uint256 i = 0; i < _params.length; i++) {
emit RelayedMessage(_params[i]);
successfulMessages[_params[i]] = true;
}
}
function triggerFailedRelayedMessageEvents(
bytes32[] memory _params
) public {
for (uint256 i = 0; i < _params.length; i++) {
emit FailedRelayedMessage(_params[i]);
failedMessages[_params[i]] = true;
}
}
}
pragma solidity ^0.8.9;
contract MockSCC {
event StateBatchAppended(
uint256 indexed _batchIndex,
bytes32 _batchRoot,
uint256 _batchSize,
uint256 _prevTotalElements,
bytes _extraData
);
struct StateBatchAppendedArgs {
uint256 batchIndex;
bytes32 batchRoot;
uint256 batchSize;
uint256 prevTotalElements;
bytes extraData;
}
// Window in seconds, will resolve to 100 blocks.
uint256 public FRAUD_PROOF_WINDOW = 1500;
uint256 public batches = 0;
StateBatchAppendedArgs public sbaParams;
function getTotalBatches() public view returns (uint256) {
return batches;
}
function setSBAParams(
StateBatchAppendedArgs memory _args
) public {
sbaParams = _args;
}
function appendStateBatch(
bytes32[] memory _roots,
uint256 _shouldStartAtIndex
) public {
batches++;
emit StateBatchAppended(
sbaParams.batchIndex,
sbaParams.batchRoot,
sbaParams.batchSize,
sbaParams.prevTotalElements,
sbaParams.extraData
);
}
}
import { Provider } from '@ethersproject/abstract-provider'
import { expectApprox, hashCrossDomainMessage } from '@eth-optimism/core-utils'
import { predeploys } from '@eth-optimism/contracts'
import { Contract } from 'ethers'
import { ethers } from 'hardhat'
import { expect } from './setup'
import {
MessageDirection,
CONTRACT_ADDRESSES,
omit,
MessageStatus,
CrossChainMessage,
CrossChainMessenger,
StandardBridgeAdapter,
ETHBridgeAdapter,
L1ChainID,
L2ChainID,
IGNORABLE_CONTRACTS,
} from '../src'
import { DUMMY_MESSAGE, DUMMY_EXTENDED_MESSAGE } from './helpers'
describe('CrossChainMessenger', () => {
let l1Signer: any
let l2Signer: any
before(async () => {
;[l1Signer, l2Signer] = await ethers.getSigners()
})
describe('construction', () => {
describe('when given an ethers provider for the L1 provider', () => {
it('should use the provider as the L1 provider', () => {
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
})
expect(messenger.l1Provider).to.equal(ethers.provider)
})
})
describe('when given an ethers provider for the L2 provider', () => {
it('should use the provider as the L2 provider', () => {
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
})
expect(messenger.l2Provider).to.equal(ethers.provider)
})
})
describe('when given a string as the L1 provider', () => {
it('should create a JSON-RPC provider for the L1 provider', () => {
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: 'https://localhost:8545',
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
})
expect(Provider.isProvider(messenger.l1Provider)).to.be.true
})
})
describe('when given a string as the L2 provider', () => {
it('should create a JSON-RPC provider for the L2 provider', () => {
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
})
expect(Provider.isProvider(messenger.l2Provider)).to.be.true
})
})
describe('when given a bad L1 chain ID', () => {
it('should throw an error', () => {
expect(() => {
new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: undefined as any,
l2ChainId: L2ChainID.OPTIMISM,
})
}).to.throw('L1 chain ID is missing or invalid')
})
})
describe('when given a bad L2 chain ID', () => {
it('should throw an error', () => {
expect(() => {
new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.MAINNET,
l2ChainId: undefined as any,
})
}).to.throw('L2 chain ID is missing or invalid')
})
})
describe('when no custom contract addresses are provided', () => {
describe('when given a known chain ID', () => {
it('should use the contract addresses for the known chain ID', () => {
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
})
const addresses = CONTRACT_ADDRESSES[messenger.l2ChainId]
for (const [contractName, contractAddress] of Object.entries(
addresses.l1
)) {
const contract = messenger.contracts.l1[contractName]
expect(contract.address).to.equal(contractAddress)
}
for (const [contractName, contractAddress] of Object.entries(
addresses.l2
)) {
const contract = messenger.contracts.l2[contractName]
expect(contract.address).to.equal(contractAddress)
}
})
})
describe('when given an unknown L2 chain ID', () => {
it('should throw an error', () => {
expect(() => {
new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: 1234,
})
}).to.throw()
})
})
})
describe('when custom contract addresses are provided', () => {
describe('when given a known chain ID', () => {
it('should use known addresses except where custom addresses are given', () => {
const overrides = {
l1: {
L1CrossDomainMessenger: '0x' + '11'.repeat(20),
},
l2: {
L2CrossDomainMessenger: '0x' + '22'.repeat(20),
},
}
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: L2ChainID.OPTIMISM,
contracts: overrides,
})
const addresses = CONTRACT_ADDRESSES[messenger.l2ChainId]
for (const [contractName, contractAddress] of Object.entries(
addresses.l1
)) {
if (overrides.l1[contractName]) {
const contract = messenger.contracts.l1[contractName]
expect(contract.address).to.equal(overrides.l1[contractName])
} else {
const contract = messenger.contracts.l1[contractName]
expect(contract.address).to.equal(contractAddress)
}
}
for (const [contractName, contractAddress] of Object.entries(
addresses.l2
)) {
if (overrides.l2[contractName]) {
const contract = messenger.contracts.l2[contractName]
expect(contract.address).to.equal(overrides.l2[contractName])
} else {
const contract = messenger.contracts.l2[contractName]
expect(contract.address).to.equal(contractAddress)
}
}
})
})
describe('when given an unknown L2 chain ID', () => {
describe('when all L1 addresses are provided', () => {
it('should use custom addresses where provided', () => {
const overrides = {
l1: {
AddressManager: '0x' + '11'.repeat(20),
L1CrossDomainMessenger: '0x' + '12'.repeat(20),
L1StandardBridge: '0x' + '13'.repeat(20),
StateCommitmentChain: '0x' + '14'.repeat(20),
CanonicalTransactionChain: '0x' + '15'.repeat(20),
BondManager: '0x' + '16'.repeat(20),
OptimismPortal: '0x' + '17'.repeat(20),
L2OutputOracle: '0x' + '18'.repeat(20),
},
l2: {
L2CrossDomainMessenger: '0x' + '22'.repeat(20),
},
}
const messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: 1234,
contracts: overrides,
})
const addresses = CONTRACT_ADDRESSES[L2ChainID.OPTIMISM]
for (const [contractName, contractAddress] of Object.entries(
addresses.l1
)) {
if (overrides.l1[contractName]) {
const contract = messenger.contracts.l1[contractName]
expect(contract.address).to.equal(overrides.l1[contractName])
} else if (!IGNORABLE_CONTRACTS.includes(contractName)) {
const contract = messenger.contracts.l1[contractName]
expect(contract.address).to.equal(contractAddress)
}
}
for (const [contractName, contractAddress] of Object.entries(
addresses.l2
)) {
if (overrides.l2[contractName]) {
const contract = messenger.contracts.l2[contractName]
expect(contract.address).to.equal(overrides.l2[contractName])
} else {
const contract = messenger.contracts.l2[contractName]
expect(contract.address).to.equal(contractAddress)
}
}
})
})
describe('when not all L1 addresses are provided', () => {
it('should throw an error', () => {
expect(() => {
new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: 'https://localhost:8545',
l1ChainId: L1ChainID.MAINNET,
l2ChainId: 1234,
contracts: {
l1: {
// Missing some required L1 addresses
AddressManager: '0x' + '11'.repeat(20),
L1CrossDomainMessenger: '0x' + '12'.repeat(20),
L1StandardBridge: '0x' + '13'.repeat(20),
},
l2: {
L2CrossDomainMessenger: '0x' + '22'.repeat(20),
},
},
})
}).to.throw()
})
})
})
})
})
describe('getMessagesByTransaction', () => {
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
describe('when a direction is specified', () => {
describe('when the transaction exists', () => {
describe('when the transaction has messages', () => {
for (const n of [1, 2, 4, 8]) {
it(`should find ${n} messages when the transaction emits ${n} messages`, async () => {
const messages = [...Array(n)].map(() => {
return DUMMY_MESSAGE
})
const tx = await l1Messenger.triggerSentMessageEvents(messages)
const found = await messenger.getMessagesByTransaction(tx, {
direction: MessageDirection.L1_TO_L2,
})
expect(found).to.deep.equal(
messages.map((message, i) => {
return {
direction: MessageDirection.L1_TO_L2,
sender: message.sender,
target: message.target,
message: message.message,
messageNonce: ethers.BigNumber.from(message.messageNonce),
minGasLimit: ethers.BigNumber.from(message.minGasLimit),
value: ethers.BigNumber.from(message.value),
logIndex: i,
blockNumber: tx.blockNumber,
transactionHash: tx.hash,
}
})
)
})
}
})
describe('when the transaction has no messages', () => {
it('should find nothing', async () => {
const tx = await l1Messenger.doNothing()
const found = await messenger.getMessagesByTransaction(tx, {
direction: MessageDirection.L1_TO_L2,
})
expect(found).to.deep.equal([])
})
})
})
describe('when the transaction does not exist in the specified direction', () => {
it('should throw an error', async () => {
await expect(
messenger.getMessagesByTransaction('0x' + '11'.repeat(32), {
direction: MessageDirection.L1_TO_L2,
})
).to.be.rejectedWith('unable to find transaction receipt')
})
})
})
describe('when a direction is not specified', () => {
describe('when the transaction exists only on L1', () => {
describe('when the transaction has messages', () => {
for (const n of [1, 2, 4, 8]) {
it(`should find ${n} messages when the transaction emits ${n} messages`, async () => {
const messages = [...Array(n)].map(() => {
return DUMMY_MESSAGE
})
const tx = await l1Messenger.triggerSentMessageEvents(messages)
const found = await messenger.getMessagesByTransaction(tx)
expect(found).to.deep.equal(
messages.map((message, i) => {
return {
direction: MessageDirection.L1_TO_L2,
sender: message.sender,
target: message.target,
message: message.message,
messageNonce: ethers.BigNumber.from(message.messageNonce),
minGasLimit: ethers.BigNumber.from(message.minGasLimit),
value: ethers.BigNumber.from(message.value),
logIndex: i,
blockNumber: tx.blockNumber,
transactionHash: tx.hash,
}
})
)
})
}
})
describe('when the transaction has no messages', () => {
it('should find nothing', async () => {
const tx = await l1Messenger.doNothing()
const found = await messenger.getMessagesByTransaction(tx)
expect(found).to.deep.equal([])
})
})
})
describe('when the transaction exists only on L2', () => {
describe('when the transaction has messages', () => {
for (const n of [1, 2, 4, 8]) {
it(`should find ${n} messages when the transaction emits ${n} messages`, () => {
// TODO: Need support for simulating more than one network.
})
}
})
describe('when the transaction has no messages', () => {
it('should find nothing', () => {
// TODO: Need support for simulating more than one network.
})
})
})
describe('when the transaction does not exist', () => {
it('should throw an error', async () => {
await expect(
messenger.getMessagesByTransaction('0x' + '11'.repeat(32))
).to.be.rejectedWith('unable to find transaction receipt')
})
})
describe('when the transaction exists on both L1 and L2', () => {
it('should throw an error', async () => {
// TODO: Need support for simulating more than one network.
})
})
})
})
// Skipped until getMessagesByAddress can be implemented
describe.skip('getMessagesByAddress', () => {
describe('when the address has sent messages', () => {
describe('when no direction is specified', () => {
it('should find all messages sent by the address')
})
describe('when a direction is specified', () => {
it('should find all messages only in the given direction')
})
describe('when a block range is specified', () => {
it('should find all messages within the block range')
})
describe('when both a direction and a block range are specified', () => {
it(
'should find all messages only in the given direction and within the block range'
)
})
})
describe('when the address has not sent messages', () => {
it('should find nothing')
})
})
describe('toCrossChainMessage', () => {
let l1Bridge: Contract
let l2Bridge: Contract
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l1Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l1Messenger.address)) as any
l2Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l2Messenger.address)) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
L1StandardBridge: l1Bridge.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
L2StandardBridge: l2Bridge.address,
},
},
bridges: {
Standard: {
Adapter: StandardBridgeAdapter,
l1Bridge: l1Bridge.address,
l2Bridge: l2Bridge.address,
},
},
})
})
describe('when the input is a CrossChainMessage', () => {
it('should return the input', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
expect(await messenger.toCrossChainMessage(message)).to.deep.equal(
message
)
})
})
describe('when the input is a TokenBridgeMessage', () => {
// TODO: There are some edge cases here with custom bridges that conform to the interface but
// not to the behavioral spec. Possibly worth testing those. For now this is probably
// sufficient.
it('should return the sent message event that came after the deposit or withdrawal', async () => {
const from = '0x' + '99'.repeat(20)
const deposit = {
l1Token: '0x' + '11'.repeat(20),
l2Token: '0x' + '22'.repeat(20),
from,
to: '0x' + '44'.repeat(20),
amount: ethers.BigNumber.from(1234),
data: '0x1234',
}
const tx = await l1Bridge.emitERC20DepositInitiated(deposit)
const foundCrossChainMessages =
await messenger.getMessagesByTransaction(tx)
const foundTokenBridgeMessages = await messenger.getDepositsByAddress(
from
)
const resolved = await messenger.toCrossChainMessage(
foundTokenBridgeMessages[0]
)
expect(resolved).to.deep.equal(foundCrossChainMessages[0])
})
})
describe('when the input is a TransactionLike', () => {
describe('when the transaction sent exactly one message', () => {
it('should return the CrossChainMessage sent in the transaction', async () => {
const tx = await l1Messenger.triggerSentMessageEvents([DUMMY_MESSAGE])
const foundCrossChainMessages =
await messenger.getMessagesByTransaction(tx)
const resolved = await messenger.toCrossChainMessage(tx)
expect(resolved).to.deep.equal(foundCrossChainMessages[0])
})
})
describe('when the transaction sent more than one message', () => {
it('should be able to get second message by passing in an idex', async () => {
const messages = [...Array(2)].map(() => {
return DUMMY_MESSAGE
})
const tx = await l1Messenger.triggerSentMessageEvents(messages)
const foundCrossChainMessages =
await messenger.getMessagesByTransaction(tx)
expect(await messenger.toCrossChainMessage(tx, 1)).to.deep.eq(
foundCrossChainMessages[1]
)
})
})
describe('when the transaction sent no messages', () => {
it('should throw an out of bounds error', async () => {
const tx = await l1Messenger.triggerSentMessageEvents([])
await expect(messenger.toCrossChainMessage(tx)).to.be.rejectedWith(
`withdrawal index 0 out of bounds. There are 0 withdrawals`
)
})
})
})
})
describe('getMessageStatus', () => {
let scc: Contract
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
// TODO: Get rid of the nested awaits here. Could be a good first issue for someone.
scc = (await (await ethers.getContractFactory('MockSCC')).deploy()) as any
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
StateCommitmentChain: scc.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
const sendAndGetDummyMessage = async (direction: MessageDirection) => {
const mockMessenger =
direction === MessageDirection.L1_TO_L2 ? l1Messenger : l2Messenger
const tx = await mockMessenger.triggerSentMessageEvents([DUMMY_MESSAGE])
return (
await messenger.getMessagesByTransaction(tx, {
direction,
})
)[0]
}
const submitStateRootBatchForMessage = async (
message: CrossChainMessage
) => {
await scc.setSBAParams({
batchIndex: 0,
batchRoot: ethers.constants.HashZero,
batchSize: 1,
prevTotalElements: message.blockNumber,
extraData: '0x',
})
await scc.appendStateBatch([ethers.constants.HashZero], 0)
}
describe('when the message is an L1 => L2 message', () => {
describe('when the message has not been executed on L2 yet', () => {
it('should return a status of UNCONFIRMED_L1_TO_L2_MESSAGE', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L1_TO_L2
)
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.UNCONFIRMED_L1_TO_L2_MESSAGE
)
})
})
describe('when the message has been executed on L2', () => {
it('should return a status of RELAYED', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L1_TO_L2
)
await l2Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.RELAYED
)
})
})
describe('when the message has been executed but failed', () => {
it('should return a status of FAILED_L1_TO_L2_MESSAGE', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L1_TO_L2
)
await l2Messenger.triggerFailedRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.FAILED_L1_TO_L2_MESSAGE
)
})
})
})
describe('when the message is an L2 => L1 message', () => {
describe('when the message state root has not been published', () => {
it('should return a status of STATE_ROOT_NOT_PUBLISHED', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.STATE_ROOT_NOT_PUBLISHED
)
})
})
describe('when the message state root is still in the challenge period', () => {
it('should return a status of IN_CHALLENGE_PERIOD', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.IN_CHALLENGE_PERIOD
)
})
})
describe('when the message is no longer in the challenge period', () => {
describe('when the message has been relayed successfully', () => {
it('should return a status of RELAYED', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
const challengePeriod = await messenger.getChallengePeriodSeconds()
ethers.provider.send('evm_increaseTime', [challengePeriod + 1])
ethers.provider.send('evm_mine', [])
await l1Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.RELAYED
)
})
})
describe('when the message has been relayed but the relay failed', () => {
it('should return a status of READY_FOR_RELAY', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
const challengePeriod = await messenger.getChallengePeriodSeconds()
ethers.provider.send('evm_increaseTime', [challengePeriod + 1])
ethers.provider.send('evm_mine', [])
await l1Messenger.triggerFailedRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.READY_FOR_RELAY
)
})
})
describe('when the message has not been relayed', () => {
it('should return a status of READY_FOR_RELAY', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
const challengePeriod = await messenger.getChallengePeriodSeconds()
ethers.provider.send('evm_increaseTime', [challengePeriod + 1])
ethers.provider.send('evm_mine', [])
expect(await messenger.getMessageStatus(message)).to.equal(
MessageStatus.READY_FOR_RELAY
)
})
})
})
})
describe('when the message does not exist', () => {
// TODO: Figure out if this is the correct behavior. Mark suggests perhaps returning null.
it('should throw an error')
})
})
describe('getMessageReceipt', () => {
let l1Bridge: Contract
let l2Bridge: Contract
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l1Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l1Messenger.address)) as any
l2Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l2Messenger.address)) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
L1StandardBridge: l1Bridge.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
L2StandardBridge: l2Bridge.address,
},
},
})
})
describe('when the message has been relayed', () => {
describe('when the relay was successful', () => {
it('should return the receipt of the transaction that relayed the message', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
const tx = await l2Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
const messageReceipt = await messenger.getMessageReceipt(message)
expect(messageReceipt.receiptStatus).to.equal(1)
expect(
omit(messageReceipt.transactionReceipt, 'confirmations')
).to.deep.equal(
omit(
await ethers.provider.getTransactionReceipt(tx.hash),
'confirmations'
)
)
})
})
describe('when the relay failed', () => {
it('should return the receipt of the transaction that attempted to relay the message', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
const tx = await l2Messenger.triggerFailedRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
const messageReceipt = await messenger.getMessageReceipt(message)
expect(messageReceipt.receiptStatus).to.equal(0)
expect(
omit(messageReceipt.transactionReceipt, 'confirmations')
).to.deep.equal(
omit(
await ethers.provider.getTransactionReceipt(tx.hash),
'confirmations'
)
)
})
})
describe('when the relay failed more than once', () => {
it('should return the receipt of the last transaction that attempted to relay the message', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
await l2Messenger.triggerFailedRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
const tx = await l2Messenger.triggerFailedRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
const messageReceipt = await messenger.getMessageReceipt(message)
expect(messageReceipt.receiptStatus).to.equal(0)
expect(
omit(messageReceipt.transactionReceipt, 'confirmations')
).to.deep.equal(
omit(
await ethers.provider.getTransactionReceipt(tx.hash),
'confirmations'
)
)
})
})
})
describe('when the message has not been relayed', () => {
it('should return null', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
await l2Messenger.doNothing()
const messageReceipt = await messenger.getMessageReceipt(message)
expect(messageReceipt).to.equal(null)
})
})
// TODO: Go over all of these tests and remove the empty functions so we can accurately keep
// track of
})
describe('waitForMessageReceipt', () => {
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
describe('when the message receipt already exists', () => {
it('should immediately return the receipt', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
const tx = await l2Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
const messageReceipt = await messenger.waitForMessageReceipt(message)
expect(messageReceipt.receiptStatus).to.equal(1)
expect(
omit(messageReceipt.transactionReceipt, 'confirmations')
).to.deep.equal(
omit(
await ethers.provider.getTransactionReceipt(tx.hash),
'confirmations'
)
)
})
})
describe('when the message receipt does not exist already', () => {
describe('when no extra options are provided', () => {
it('should wait for the receipt to be published', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
setTimeout(async () => {
await l2Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
}, 5000)
const tick = Date.now()
const messageReceipt = await messenger.waitForMessageReceipt(message)
const tock = Date.now()
expect(messageReceipt.receiptStatus).to.equal(1)
expect(tock - tick).to.be.greaterThan(5000)
})
it('should wait forever for the receipt if the receipt is never published', () => {
// Not sure how to easily test this without introducing some sort of cancellation token
// I don't want the promise to loop forever and make the tests never finish.
})
})
describe('when a timeout is provided', () => {
it('should throw an error if the timeout is reached', async () => {
const message = {
...DUMMY_EXTENDED_MESSAGE,
direction: MessageDirection.L1_TO_L2,
}
await expect(
messenger.waitForMessageReceipt(message, {
timeoutMs: 10000,
})
).to.be.rejectedWith('timed out waiting for message receipt')
})
})
})
})
describe('estimateL2MessageGasLimit', () => {
let messenger: CrossChainMessenger
beforeEach(async () => {
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
})
})
describe('when the message is an L1 to L2 message', () => {
it('should return an accurate gas estimate plus a ~20% buffer', async () => {
const message = {
direction: MessageDirection.L1_TO_L2,
target: '0x' + '11'.repeat(20),
sender: '0x' + '22'.repeat(20),
message: '0x' + '33'.repeat(64),
messageNonce: 1234,
logIndex: 0,
blockNumber: 1234,
transactionHash: '0x' + '44'.repeat(32),
}
const estimate = await ethers.provider.estimateGas({
to: message.target,
from: message.sender,
data: message.message,
})
// Approximately 20% greater than the estimate, +/- 1%.
expectApprox(
await messenger.estimateL2MessageGasLimit(message),
estimate.mul(120).div(100),
{
percentUpperDeviation: 1,
percentLowerDeviation: 1,
}
)
})
it('should return an accurate gas estimate when a custom buffer is provided', async () => {
const message = {
direction: MessageDirection.L1_TO_L2,
target: '0x' + '11'.repeat(20),
sender: '0x' + '22'.repeat(20),
message: '0x' + '33'.repeat(64),
messageNonce: 1234,
logIndex: 0,
blockNumber: 1234,
transactionHash: '0x' + '44'.repeat(32),
}
const estimate = await ethers.provider.estimateGas({
to: message.target,
from: message.sender,
data: message.message,
})
// Approximately 30% greater than the estimate, +/- 1%.
expectApprox(
await messenger.estimateL2MessageGasLimit(message, {
bufferPercent: 30,
}),
estimate.mul(130).div(100),
{
percentUpperDeviation: 1,
percentLowerDeviation: 1,
}
)
})
})
describe('when the message is an L2 to L1 message', () => {
it('should throw an error', async () => {
const message = {
direction: MessageDirection.L2_TO_L1,
target: '0x' + '11'.repeat(20),
sender: '0x' + '22'.repeat(20),
message: '0x' + '33'.repeat(64),
messageNonce: 1234,
logIndex: 0,
blockNumber: 1234,
transactionHash: '0x' + '44'.repeat(32),
}
await expect(messenger.estimateL2MessageGasLimit(message)).to.be
.rejected
})
})
})
describe('estimateMessageWaitTimeSeconds', () => {
let scc: Contract
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
// TODO: Get rid of the nested awaits here. Could be a good first issue for someone.
scc = (await (await ethers.getContractFactory('MockSCC')).deploy()) as any
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: ethers.provider,
l2SignerOrProvider: ethers.provider,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
StateCommitmentChain: scc.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
const sendAndGetDummyMessage = async (direction: MessageDirection) => {
const mockMessenger =
direction === MessageDirection.L1_TO_L2 ? l1Messenger : l2Messenger
const tx = await mockMessenger.triggerSentMessageEvents([DUMMY_MESSAGE])
return (
await messenger.getMessagesByTransaction(tx, {
direction,
})
)[0]
}
const submitStateRootBatchForMessage = async (
message: CrossChainMessage
) => {
await scc.setSBAParams({
batchIndex: 0,
batchRoot: ethers.constants.HashZero,
batchSize: 1,
prevTotalElements: message.blockNumber,
extraData: '0x',
})
await scc.appendStateBatch([ethers.constants.HashZero], 0)
}
describe('when the message is an L1 => L2 message', () => {
describe('when the message has not been executed on L2 yet', () => {
it('should return the estimated seconds until the message will be confirmed on L2', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L1_TO_L2
)
await l1Messenger.triggerSentMessageEvents([message])
expect(
await messenger.estimateMessageWaitTimeSeconds(message)
).to.equal(1)
})
})
describe('when the message has been executed on L2', () => {
it('should return 0', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L1_TO_L2
)
await l1Messenger.triggerSentMessageEvents([message])
await l2Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(
await messenger.estimateMessageWaitTimeSeconds(message)
).to.equal(0)
})
})
})
describe('when the message is an L2 => L1 message', () => {
describe('when the state root has not been published', () => {
it('should return the estimated seconds until the state root will be published and pass the challenge period', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
expect(
await messenger.estimateMessageWaitTimeSeconds(message)
).to.equal(await messenger.getChallengePeriodSeconds())
})
})
describe('when the state root is within the challenge period', () => {
it('should return the estimated seconds until the state root passes the challenge period', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
const challengePeriod = await messenger.getChallengePeriodSeconds()
ethers.provider.send('evm_increaseTime', [challengePeriod / 2])
ethers.provider.send('evm_mine', [])
expectApprox(
await messenger.estimateMessageWaitTimeSeconds(message),
challengePeriod / 2,
{
percentUpperDeviation: 5,
percentLowerDeviation: 5,
}
)
})
})
describe('when the state root passes the challenge period', () => {
it('should return 0', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await submitStateRootBatchForMessage(message)
const challengePeriod = await messenger.getChallengePeriodSeconds()
ethers.provider.send('evm_increaseTime', [challengePeriod + 1])
ethers.provider.send('evm_mine', [])
expect(
await messenger.estimateMessageWaitTimeSeconds(message)
).to.equal(0)
})
})
describe('when the message has been executed', () => {
it('should return 0', async () => {
const message = await sendAndGetDummyMessage(
MessageDirection.L2_TO_L1
)
await l2Messenger.triggerSentMessageEvents([message])
await l1Messenger.triggerRelayedMessageEvents([
hashCrossDomainMessage(
message.messageNonce,
message.sender,
message.target,
message.value,
message.minGasLimit,
message.message
),
])
expect(
await messenger.estimateMessageWaitTimeSeconds(message)
).to.equal(0)
})
})
})
})
describe('sendMessage', () => {
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: l1Signer,
l2SignerOrProvider: l2Signer,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
describe('when the message is an L1 to L2 message', () => {
describe('when no l2GasLimit is provided', () => {
it('should send a message with an estimated l2GasLimit', async () => {
const message = {
direction: MessageDirection.L1_TO_L2,
target: '0x' + '11'.repeat(20),
message: '0x' + '22'.repeat(32),
}
const estimate = await messenger.estimateL2MessageGasLimit(message)
await expect(messenger.sendMessage(message))
.to.emit(l1Messenger, 'SentMessage')
.withArgs(
message.target,
await l1Signer.getAddress(),
message.message,
0,
estimate
)
})
})
describe('when an l2GasLimit is provided', () => {
it('should send a message with the provided l2GasLimit', async () => {
const message = {
direction: MessageDirection.L1_TO_L2,
target: '0x' + '11'.repeat(20),
message: '0x' + '22'.repeat(32),
}
await expect(
messenger.sendMessage(message, {
l2GasLimit: 1234,
})
)
.to.emit(l1Messenger, 'SentMessage')
.withArgs(
message.target,
await l1Signer.getAddress(),
message.message,
0,
1234
)
})
})
})
describe('when the message is an L2 to L1 message', () => {
it('should send a message', async () => {
const message = {
direction: MessageDirection.L2_TO_L1,
target: '0x' + '11'.repeat(20),
message: '0x' + '22'.repeat(32),
}
await expect(messenger.sendMessage(message))
.to.emit(l2Messenger, 'SentMessage')
.withArgs(
message.target,
await l2Signer.getAddress(),
message.message,
0,
0
)
})
})
})
describe('resendMessage', () => {
let l1Messenger: Contract
let l2Messenger: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: l1Signer,
l2SignerOrProvider: l2Signer,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
},
},
})
})
describe('when resending an L1 to L2 message', () => {
it('should resend the message with the new gas limit', async () => {
const message = {
direction: MessageDirection.L1_TO_L2,
target: '0x' + '11'.repeat(20),
message: '0x' + '22'.repeat(32),
}
const sent = await messenger.sendMessage(message, {
l2GasLimit: 1234,
})
await expect(messenger.resendMessage(sent, 10000))
.to.emit(l1Messenger, 'SentMessage')
.withArgs(
message.target,
await l1Signer.getAddress(),
message.message,
1, // nonce is now 1
10000
)
})
})
describe('when resending an L2 to L1 message', () => {
it('should throw an error', async () => {
const message = {
direction: MessageDirection.L2_TO_L1,
target: '0x' + '11'.repeat(20),
message: '0x' + '22'.repeat(32),
}
const sent = await messenger.sendMessage(message, {
l2GasLimit: 1234,
})
await expect(messenger.resendMessage(sent, 10000)).to.be.rejected
})
})
})
describe('finalizeMessage', () => {
describe('when the message being finalized exists', () => {
describe('when the message is ready to be finalized', () => {
it('should finalize the message')
})
describe('when the message is not ready to be finalized', () => {
it('should throw an error')
})
describe('when the message has already been finalized', () => {
it('should throw an error')
})
})
describe('when the message being finalized does not exist', () => {
it('should throw an error')
})
})
describe('depositETH', () => {
let l1Messenger: Contract
let l2Messenger: Contract
let l1Bridge: Contract
let l2Bridge: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l1Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l1Messenger.address)) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l2Messenger.address)) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: l1Signer,
l2SignerOrProvider: l2Signer,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
L1StandardBridge: l1Bridge.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
L2StandardBridge: l2Bridge.address,
},
},
bridges: {
ETH: {
Adapter: ETHBridgeAdapter,
l1Bridge: l1Bridge.address,
l2Bridge: l2Bridge.address,
},
},
})
})
it('should trigger the deposit ETH function with the given amount', async () => {
await expect(messenger.depositETH(100000))
.to.emit(l1Bridge, 'ETHDepositInitiated')
.withArgs(
await l1Signer.getAddress(),
await l1Signer.getAddress(),
100000,
'0x'
)
})
})
describe('withdrawETH', () => {
let l1Messenger: Contract
let l2Messenger: Contract
let l1Bridge: Contract
let l2Bridge: Contract
let messenger: CrossChainMessenger
beforeEach(async () => {
l1Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l1Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l1Messenger.address)) as any
l2Messenger = (await (
await ethers.getContractFactory('MockMessenger')
).deploy()) as any
l2Bridge = (await (
await ethers.getContractFactory('MockBridge')
).deploy(l2Messenger.address)) as any
messenger = new CrossChainMessenger({
bedrock: false,
l1SignerOrProvider: l1Signer,
l2SignerOrProvider: l2Signer,
l1ChainId: L1ChainID.HARDHAT_LOCAL,
l2ChainId: L2ChainID.OPTIMISM_HARDHAT_LOCAL,
contracts: {
l1: {
L1CrossDomainMessenger: l1Messenger.address,
L1StandardBridge: l1Bridge.address,
},
l2: {
L2CrossDomainMessenger: l2Messenger.address,
L2StandardBridge: l2Bridge.address,
},
},
bridges: {
ETH: {
Adapter: ETHBridgeAdapter,
l1Bridge: l1Bridge.address,
l2Bridge: l2Bridge.address,
},
},
})
})
it('should trigger the withdraw ETH function with the given amount', async () => {
await expect(messenger.withdrawETH(100000))
.to.emit(l2Bridge, 'WithdrawalInitiated')
.withArgs(
ethers.constants.AddressZero,
predeploys.OVM_ETH,
await l2Signer.getAddress(),
await l2Signer.getAddress(),
100000,
'0x'
)
})
})
})
import { ethers } from 'ethers'
export const DUMMY_MESSAGE = {
target: '0x' + '11'.repeat(20),
sender: '0x' + '22'.repeat(20),
message: '0x' + '33'.repeat(64),
messageNonce: ethers.BigNumber.from(1234),
value: ethers.BigNumber.from(0),
minGasLimit: ethers.BigNumber.from(5678),
}
export const DUMMY_EXTENDED_MESSAGE = {
...DUMMY_MESSAGE,
logIndex: 0,
blockNumber: 1234,
transactionHash: '0x' + '44'.repeat(32),
}
/* eslint-disable @typescript-eslint/no-empty-function */
import './setup'
describe('L2Provider', () => {
describe('getL1GasPrice', () => {
it('should query the GasPriceOracle contract', () => {})
})
describe('estimateL1Gas', () => {
it('should query the GasPriceOracle contract', () => {})
})
describe('estimateL1GasCost', () => {
it('should multiply the estimated L1 gas cost by the L1 gas price', () => {})
})
describe('estimateL2GasCost', () => {
it('should multiply the estimated L2 gas cost by the L1 gas price', () => {})
})
describe('estimateTotalGasCost', () => {
it('should be the sum of the L1 and L2 gas cost estimates', () => {})
})
})
/* External Imports */
import chai = require('chai')
import Mocha from 'mocha'
import chaiAsPromised from 'chai-as-promised'
chai.use(chaiAsPromised)
const should = chai.should()
const expect = chai.expect
export { should, expect, Mocha }
import { Provider } from '@ethersproject/abstract-provider'
import { Contract } from 'ethers'
import { ethers } from 'hardhat'
import { expect } from '../setup'
import { toSignerOrProvider, toTransactionHash } from '../../src'
describe('type coercion utils', () => {
describe('toSignerOrProvider', () => {
it('should convert a string to a JsonRpcProvider', () => {
const provider = toSignerOrProvider('http://localhost:8545')
expect(Provider.isProvider(provider)).to.be.true
})
it('should not do anything with a provider', () => {
const provider = toSignerOrProvider(ethers.provider)
expect(provider).to.deep.equal(ethers.provider)
})
})
describe('toTransactionHash', () => {
describe('string inputs', () => {
it('should return the input if the input is a valid transaction hash', () => {
const input = '0x' + '11'.repeat(32)
expect(toTransactionHash(input)).to.equal(input)
})
it('should throw an error if the input is a hex string but not a transaction hash', () => {
const input = '0x' + '11'.repeat(31)
expect(() => toTransactionHash(input)).to.throw(
'Invalid transaction hash'
)
})
it('should throw an error if the input is not a hex string', () => {
const input = 'hi mom look at me go'
expect(() => toTransactionHash(input)).to.throw(
'Invalid transaction hash'
)
})
})
describe('transaction inputs', () => {
let AbsolutelyNothing: Contract
before(async () => {
AbsolutelyNothing = (await (
await ethers.getContractFactory('AbsolutelyNothing')
).deploy()) as any
})
it('should return the transaction hash if the input is a transaction response', async () => {
const tx = await AbsolutelyNothing.doAbsolutelyNothing()
expect(toTransactionHash(tx)).to.equal(tx.hash)
})
it('should return the transaction hash if the input is a transaction receipt', async () => {
const tx = await AbsolutelyNothing.doAbsolutelyNothing()
const receipt = await tx.wait()
expect(toTransactionHash(receipt)).to.equal(receipt.transactionHash)
})
})
describe('other types', () => {
it('should throw if given a number as an input', () => {
expect(() => toTransactionHash(1234 as any)).to.throw(
'Invalid transaction'
)
})
it('should throw if given a function as an input', () => {
expect(() =>
toTransactionHash((() => {
return 1234
}) as any)
).to.throw('Invalid transaction')
})
})
})
})
/* eslint-disable @typescript-eslint/no-empty-function */
import { Signer } from 'ethers'
import { ethers } from 'hardhat'
import { expect } from '../setup'
import {
getOEContract,
getAllOEContracts,
CONTRACT_ADDRESSES,
DEFAULT_L2_CONTRACT_ADDRESSES,
L2ChainID,
} from '../../src'
describe('contract connection utils', () => {
let signers: Signer[]
before(async () => {
signers = (await ethers.getSigners()) as any
})
describe('getOEContract', () => {
describe('when given a known chain ID', () => {
describe('when not given an address override', () => {
it('should use the address for the given contract name and chain ID', () => {
const addresses = CONTRACT_ADDRESSES[L2ChainID.OPTIMISM]
for (const [contractName, contractAddress] of [
...Object.entries(addresses.l1),
...Object.entries(addresses.l2),
]) {
const contract = getOEContract(
contractName as any,
L2ChainID.OPTIMISM
)
expect(contract.address).to.equal(contractAddress)
}
})
})
describe('when given an address override', () => {
it('should use the custom address', () => {
const addresses = CONTRACT_ADDRESSES[L2ChainID.OPTIMISM]
for (const contractName of [
...Object.keys(addresses.l1),
...Object.keys(addresses.l2),
]) {
const address = '0x' + '11'.repeat(20)
const contract = getOEContract(contractName as any, 1, {
address,
})
expect(contract.address).to.equal(address)
}
})
})
})
describe('when given an unknown chain ID', () => {
describe('when not given an address override', () => {
it('should throw an error', () => {
expect(() => getOEContract('L1CrossDomainMessenger', 3)).to.throw()
})
})
describe('when given an address override', () => {
it('should use the custom address', () => {
const address = '0x' + '11'.repeat(20)
const contract = getOEContract('L1CrossDomainMessenger', 3, {
address,
})
expect(contract.address).to.equal(address)
})
})
})
describe('when connected to a valid address', () => {
it('should have the correct interface for the contract name', () => {
const contract = getOEContract(
'L1CrossDomainMessenger',
L2ChainID.OPTIMISM
)
expect(contract.sendMessage).to.not.be.undefined
})
describe('when not given a signer or provider', () => {
it('should not have a signer or provider', () => {
const contract = getOEContract(
'L1CrossDomainMessenger',
L2ChainID.OPTIMISM
)
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
})
})
describe('when given a signer', () => {
it('should attach the given signer', () => {
const contract = getOEContract(
'L1CrossDomainMessenger',
L2ChainID.OPTIMISM,
{
signerOrProvider: signers[0],
}
)
expect(contract.signer).to.deep.equal(signers[0])
})
})
describe('when given a provider', () => {
it('should attach the given provider', () => {
const contract = getOEContract(
'L1CrossDomainMessenger',
L2ChainID.OPTIMISM,
{
signerOrProvider: ethers.provider as any,
}
)
expect(contract.signer).to.be.null
expect(contract.provider).to.deep.equal(ethers.provider)
})
})
})
})
describe('getAllOEContracts', () => {
describe('when given a known chain ID', () => {
describe('when not given any address overrides', () => {
it('should return all contracts connected to the default addresses', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM)
const addresses = CONTRACT_ADDRESSES[L2ChainID.OPTIMISM]
for (const [contractName, contractAddress] of Object.entries(
addresses.l1
)) {
const contract = contracts.l1[contractName]
expect(contract.address).to.equal(contractAddress)
}
for (const [contractName, contractAddress] of Object.entries(
addresses.l2
)) {
const contract = contracts.l2[contractName]
expect(contract.address).to.equal(contractAddress)
}
})
})
describe('when given address overrides', () => {
it('should return contracts connected to the overridden addresses where given', () => {
const overrides = {
l1: {
L1CrossDomainMessenger: '0x' + '11'.repeat(20),
},
l2: {
L2CrossDomainMessenger: '0x' + '22'.repeat(20),
},
}
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, { overrides })
const addresses = CONTRACT_ADDRESSES[L2ChainID.OPTIMISM]
for (const [contractName, contractAddress] of Object.entries(
addresses.l1
)) {
const contract = contracts.l1[contractName]
if (overrides.l1[contractName]) {
expect(contract.address).to.equal(overrides.l1[contractName])
} else {
expect(contract.address).to.equal(contractAddress)
}
}
for (const [contractName, contractAddress] of Object.entries(
addresses.l2
)) {
const contract = contracts.l2[contractName]
if (overrides.l2[contractName]) {
expect(contract.address).to.equal(overrides.l2[contractName])
} else {
expect(contract.address).to.equal(contractAddress)
}
}
})
})
})
describe('when given an unknown chain ID', () => {
describe('when given address overrides for all L1 contracts', () => {
describe('when given address overrides for L2 contracts', () => {
it('should return contracts connected to the overridden addresses where given', () => {
const l1Overrides = {}
for (const contractName of Object.keys(
CONTRACT_ADDRESSES[L2ChainID.OPTIMISM].l1
)) {
l1Overrides[contractName] = '0x' + '11'.repeat(20)
}
const contracts = getAllOEContracts(3, {
overrides: {
l1: l1Overrides as any,
l2: {
L2CrossDomainMessenger: '0x' + '22'.repeat(20),
},
},
})
for (const [contractName, contract] of Object.entries(
contracts.l1
)) {
expect(contract.address).to.equal(l1Overrides[contractName])
}
expect(contracts.l2.L2CrossDomainMessenger.address).to.equal(
'0x' + '22'.repeat(20)
)
})
})
describe('when not given address overrides for L2 contracts', () => {
it('should return contracts connected to the default L2 addresses and custom L1 addresses', () => {
const l1Overrides = {}
for (const contractName of Object.keys(
CONTRACT_ADDRESSES[L2ChainID.OPTIMISM].l1
)) {
l1Overrides[contractName] = '0x' + '11'.repeat(20)
}
const contracts = getAllOEContracts(3, {
overrides: {
l1: l1Overrides as any,
},
})
for (const [contractName, contract] of Object.entries(
contracts.l1
)) {
expect(contract.address).to.equal(l1Overrides[contractName])
}
for (const [contractName, contract] of Object.entries(
contracts.l2
)) {
expect(contract.address).to.equal(
DEFAULT_L2_CONTRACT_ADDRESSES[contractName]
)
}
})
})
})
describe('when given address overrides for some L1 contracts', () => {
it('should throw an error', () => {
expect(() =>
getAllOEContracts(3, {
overrides: {
l1: {
L1CrossDomainMessenger: '0x' + '11'.repeat(20),
},
},
})
).to.throw()
})
})
describe('when given address overrides for no L1 contracts', () => {
it('should throw an error', () => {
expect(() => getAllOEContracts(3)).to.throw()
})
})
})
describe('when not given a signer or provider', () => {
it('should not attach a signer or provider to any contracts', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM)
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
})
})
describe('when given an L1 signer', () => {
it('should attach the signer to the L1 contracts only', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l1SignerOrProvider: signers[0],
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.deep.equal(signers[0])
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
})
})
describe('when given an L2 signer', () => {
it('should attach the signer to the L2 contracts only', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l2SignerOrProvider: signers[0],
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.deep.equal(signers[0])
}
})
})
describe('when given an L1 signer and an L2 signer', () => {
it('should attach the signer to both sets of contracts', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l1SignerOrProvider: signers[0],
l2SignerOrProvider: signers[1],
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.deep.equal(signers[0])
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.deep.equal(signers[1])
}
})
})
describe('when given an L1 provider', () => {
it('should attach the provider to the L1 contracts only', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l1SignerOrProvider: ethers.provider as any,
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.deep.equal(ethers.provider)
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
})
})
describe('when given an L2 provider', () => {
it('should attach the provider to the L2 contracts only', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l2SignerOrProvider: ethers.provider as any,
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.be.null
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.deep.equal(ethers.provider)
}
})
})
describe('when given an L1 provider and an L2 provider', () => {
it('should attach the provider to both sets of contracts', () => {
const contracts = getAllOEContracts(L2ChainID.OPTIMISM, {
l1SignerOrProvider: ethers.provider as any,
l2SignerOrProvider: ethers.provider as any,
})
for (const contract of Object.values(contracts.l1)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.deep.equal(ethers.provider)
}
for (const contract of Object.values(contracts.l2)) {
expect(contract.signer).to.be.null
expect(contract.provider).to.deep.equal(ethers.provider)
}
})
})
})
})
import { ethers } from 'ethers'
import { expect } from '../setup'
import { maybeAddProofNode } from '../../src/utils/merkle-utils'
describe('Merkle Utils', () => {
describe('maybeAddProofNode', () => {
// Test taken from opBNB testnet withdrawal.
it('should add a proof node when final node is inside of a branch', () => {
const key = ethers.utils.keccak256(
'0x5cd60ecef836e75dd12539abe8ad5f4ba0dc4fcaae2c45024c69bd9e20746eba'
)
const proof = [
'0xf90211a0feb6c6afca5ea568e0b7183d7292c112e9d28a1c846d889636d5c8822463aa77a0df719a24d8049d04a47e0e07ba493110fed0665d897c0ffdb05a7ce474782026a01bec363c069dc337ce16b4ca5cffa11d20e305fd7dcf6d87547b151c31aabf0ca00583d5a451bfa01f5e51d992e129ee17e65adda9495bda77898187484625aa9ea0bd9fef27cd52c2721e519bcd40c63a818095374e505a3bbd88db29c6c4521982a009a31937313c5b2bc06da6fec4075110f19526a9dbde3629ebe36aa8cd8e0851a0555f89002a34f6570bab438e69c5d8b855f2664e31f5dd59b807d0956577cc81a07e6f59ec99405b7afa436bf62abd098a85b43861fd3a9da3214a5d46b2d12543a03e7e883b0406cb781e5bf2a71cafc02ebbcdb0684ac03439633faf339d1259e2a0fa154fcf0bedd25aacac74e9864e4b96742c3d06f58c170cd320ade69db16c88a07e34154a031da5e50a3886efcb15c6681deeb20832726f083f80b03678b56d33a0d24408a39fb57838fdfe85c68f7eac74daab709ec3c22dfd0a579c1dbd64861aa093c1837ab2907fc51de7e918b81b997d60a6c8a18e3538720ee0d0f369530c26a0fca1af24293865f21d18d5eb823e0ecc007306823864f11d59c1c5c370fb22c2a0de8c894b5067d637df401aa6b963a3fc52b774abbedf6688e25bbf9a29672b7ca021c85d42de67601599e605d9ed1257451d1ce403d2478496d0a99d60db643d5280',
'0xf90211a02288f14667ef872b449e0f0f5526c2ad3634dcdb7376616d18fd87f6af9293bfa027223b95acda1508dbc42caac8edfb422759eedd13628e4dff0c5bf79d275182a0352a96940c817156a6e33c6f6cb2010ac216296f6e912c335982ba75ffb11898a0c3b7339a174d0a5fd842d3bb946a2ba6d9c1088215d9c3f56449af4dabb59e1ca03b331c72db0a3e0b51167ecb4d0ee76126181e3a54718e7cdefbf89ae0ae0d7ea03f162cadc26daa12d91e9ba459c9e61008ef57314e9cb810f074a878f2b81910a00dc670d0489ec214e2a636274d1e8b2df9db343218503ae2bf7ed868d8ab553fa0bffdd8cf5fe58452a64254f44e28ecd886964898fbab68711749423478d9c94ea0ca722fcaddd052f5a8ddce25c0c4161cd9e5552a0697ceccba540b0520cfcb61a0ffc0036ebf8ed2d9603de8c22d36cdc3fb451dd92a23adefe5593a4d8a12299da0bff43610f0c3d44e73e741d58f34f4d8e25aa3f67e0796241210bf321c2f1117a0341dcdbf2722bd7eacc3af46b6a9d80bb775dace93808a6737a1e135b9b225f3a07b3c3ec4c199c11374ba2dd28227e8c1efdbd8cb065768eff27e3918647eaccfa0e5a903a66eedfe8ea6d28a0f93cc91fc5f00f612a54aeeff100dafe84182a815a0203b138ec5130556a58d06184fdc399cb726954d28fe9fc68131f23d211382f5a057e92c1aec0a5b4e723cbbb3928d1008c9a9b4a26206656fccf70c14136a77de80',
'0xf90211a0437a65e2661356d938aa5321927d85003770566f25f121ec0dba4ad4acae9a8ca04acf516468076bf35f8c10e6aa904612fe08fcfba5c7b76bd87a5fe38e212c4da08db4fa1d774e1653468078c4c6a26cc6236025d6ab88dd1c02dae7c8bc7b19f7a03fb292d186e2d63e163788b3af313403cd12bc4b839037be4ad15a6fbbee217aa0dc569eab6a0b0a1d1dd7d12a24512bff7d4a6f5dc55a5a2dea31ed1a5415d383a0e4eaab256b73b4abc3402f44b6fa90a0854b733cdd5b884915ae8c07f5c78002a075ccef6818cc6c2870a70a0b41e3904ba2355937e028b02cb54a7ab321492357a0b059014d41d68c6c28b7de8f06b57c015210167d64c8589f9d7801dd4f025a60a07bf03f4912eaba2dd295222c1e01c1ddd7baedad61cf90d4e5987fc7ae1c6beaa0309d5aff3d1194cf259389cbb365e43548291aa9125d0550ab4908d1cc958844a0ff3fa5bba3bd95b08506336101c1c71cb920dd3ee68d8120654dac8f4b05d390a03a7b3de7b7476d9bf665396b718a28f8d746828bbf51a396e43669a4c90ca770a0913bc7b7ef04689a19cebf2c785f4eea68ccf9c97be94bb5bdd1346d4b145147a0cc21ab258bc2d961534438ddbbf185de30f8387acbc40f89857d88a23f90047ea0cf8b6876bd0cfd19ddd39fcfe88470d76757f64ba8496cfc382c92ed65706586a051de24dd2a27ffce89bb1dfcd6aa33469a91b50c4332ff9ef45d3cc917613a5c80',
'0xf90211a00aaeb3f8caea8f7167815fcdf1470777f7e100c781bc9ed79afefac295bb0d03a04b9f1d4ade00185fc62732b28abfb243afff140ebfa034daa4f139e0015a2195a0f9608d7d4346638e5ad4219ef6ea0769aa9fdb4bc6207831cf0f64854b072c2da0b953f4ee5f8ae17d9da8e3c1efaf9a822d0301dab05cae4b776fbd666fce8158a0bd8460bbbcfa3e02af0909445883176e3b65c85a63c6f91c2994fa2979228726a024f9c1c9952c2b6edec11955b50eaccd1ef44099db309f807f85aa4c4130b31ea056ad08d1e812df59fb54d2b847b1e7fa0872aaa1f3ac8f4e314d6893baece56aa02ca9f7cf8514dcca9401081f94b824f03b4d74dc690dfeed6779ddee4a9ad72ba050dffdadd79fbb8d857ad658864cd9cb19e69c73f8ba9c241fc2b451e2124320a00377a910bb501d1b22b7b03a3fa60aa47facf33515c10b0742fb76bd5a3d7a6ca0abcffd053ac378f2aa4d90e95c64dd7cc450fe6f961f9f55722cc49ef7b47f7ba042a8b3431675d5909bad710d519dd2c5d3287f3af8641122cce53b137087ce6ba0b77542431b232d0aabbbdf27e1c1adab761e144d396d0658ec1a84a712906a73a099ca74decdad4e079c0d1f35c8da403acbe65bf284253dab1be788f1808687eba06d866839d5ce08a75b3c8a2383b7eec6120ab32c7dfbe9b036831fc3101c8250a0fd315d671bf51da89b2db014d0f199be522fbf8e19d0276d0a14a1c66c1df8ac80',
'0xf901f1a0d6228395f59dea0ead05458d95d54c315c7feddf6416bb41aed62dc165446a6ca051e1ecb5424d948d386c0d291bb674fac4c47349f67e40a77850f54254b612b5a0e3b1d858fc2bb8001052eb3a36c9e2bea2966c795848aff0e5fb3cd779cfb565a0046a3c69a3639aa8bc1b3cf2c052d54424a88d2ea90a6388595b160ef5ef161780a0b2b1a778cbd8a3257ff7114116d892491a3ab148be723e22262b842680a9b29ea026da2284e756fcade15d922c0b8f6282a008e1c842e5030a307b3ea2e9a55726a026c0862e8e9e06ddef9ce37044fe2228a3ba9863faaf0cf1ad0863d41f7d7f13a0bcfbf48375296ad05ade4710ffe7e2b419fe246623369f7a6a4fa6f720bb185fa0d982dbbef7671cf7add6efd8612d47477b77f40d62e11983fe4478e959c0a86da0b3bf440462efb53c7056f5ff3ea134a072363a95a15a6945b83e416e6adee245a00396e89cb82998271f55ef0e892d456a7bbf624c23bf751f1ea2da6a7690be42a06f2588a03a07740fe4d300795096252abeb6b984e41b4f7027df84c1c520ea84a0ce163ce486c3de11ca2f6656f5dcf82e62496cb0d5472e042dede34d0e1aedd8a0fec8a8bfbf3e3418c4730c3c7c047cd73695c4c429f6ec6babc7165b9b27e635a002711d0ce2951376bac13daf1d3bcf359a90f68bc804b6b2b2e9efe09a8157af80',
'0xf89180808080808080a0326fe6fc4a847e4db1144153b15d0d3811f0317239f2885cc2a383825ccb1d8480a04455f6e0d1f8a2022ea33d5e6a537e384483dfccd19d07d21047e9b264b56e3c808080a06174ffa3ff6accab10abb5d61000db050324c608b10c0344a3eec6fa0107a079a0d494a04c23ba556fc3bdbe234562fe6825d55f3aaaa81e43415b8070a733d0bd8080',
'0xe482000fa03cb626e2849a157c57ca2e62c3dd139cf803efe281f5b6331b3ba92280dd8c42',
'0xf84d8080808080de9c332c35a4d03ec6ab9b3ffd06c69652ce8e02ff95537f98b7a0feb29c01808080de9c36620d27102d4799d259fe08f690c0a21b80d0a1a903db682417a23f0180808080808080',
]
const modifiedProof = maybeAddProofNode(key, proof)
expect(modifiedProof).to.deep.equal([
...proof,
'0xde9c36620d27102d4799d259fe08f690c0a21b80d0a1a903db682417a23f01',
])
})
// Test taken from opBNB testnet withdrawal.
it('should not add a proof node when final node is a leaf node', () => {
const key = ethers.utils.keccak256(
'0x55b08006167f308d31af5ea9f302384725df906124e39e0eb2c6d040498e0fae'
)
const proof = [
'0xf90211a08c7918779c1c4435737b269573de96df28e1ec8c5847d7317906971b4c5fa73fa018679d112e60f815616a167692ea7d821691f34bed06df12c7b121a4c7b8384ba06b0a09649c9e7df1bde1c7448243c954dfecae8301b7f6bbe7d8f0b781733194a0258988e63a01754eafaffa3837ccc321c4f99d50869d04c09e7ab587988ecfa6a0a5b325ae646fd16ad7daac9d6da2ea244d456fa1a219f828cb9a5785f01bbf4ea0532b1427977ae09ee5344667910500207fd500912f9e1c6f5e7aa6b8b333a717a04a32b16d0d56f217216a9dae9eea953883ff3bcf1a9578d60d6bb28bbf4b6655a009e8cabb94c504eeb5cf15a151ed4b99be678bf969ee30be5d8aaf1312210079a0938dedf6ad32b04a9a2da09f29e481c51d7cf440d62651ed570355e12a4858d8a0b6bae212efc7179842abc76e9d6b2850b05336720b81dac467e942f7f6cd6b9ba0be45a8205c8c75ebe83c10cc9e87a597820d7e3ca691f9d1549e12a6f050a296a0c65bd95874adb4054ae8b346f2d2ccc88e76555c662b230d62072db36933508ca0e21442e3384b11c414e4a6bc2d56e71dbbbc672c38ac00bd63386ad55c590955a0d3d178f5be5f808d97ce22d48adce909ecf326cc5d9a0e7b64af616ca2d3e12ca09475833e7206cd83f7301f995617825f6d7050c782e17495ce5eb0556c2b68c4a09638ed778938e150e4c68cbcaf9bd47f97e1a6a6d6d2bbf9bc516450166a1ed980',
'0xf90211a0a3f8f3795f08496d4cd1b0c054c337d10d28fa2e9725162da7714c20d3b30c88a05856b0aa4c58cd715545c05ddb8bd93835dcd0ecbc7c2b139266af1c1850a671a000b3e2386218f9308469c731f6d53d5fb27512082390826956c8a234854a88aca0e525d6f4fa38fec4694f5cdb589156dc3a4d829861e1228b502c0130a4834ceaa0a414e804e76eb8863d1804ae04189237119b0415bf57c8a6a4ab176ad9f78eeca022aa4baf04a82bb83148c6ff6261dec1165f5d2f9bdf0ce73dfb2c9719fb8597a06fe7a289928f7fbd860aafb95945dcc2699bf7bf2010d6aa83b9f49308e968c9a008d5e746de17a948d6e7fc864286215d008e7f2d592cf7269df4dab0a3486215a0c39c7aa088d057db66179d7354b3f0d48f6d3ed2e62f8a840d9117b7b66a64bda0dd4ccdc76f721cf04cdf14d1d8a1821501d89c3d44ed5ed92b5a820431b36990a06c89982d73cc213516be264bb2fb6c969131f542afbc460ff781b839290e42f8a09954b3cbc392cdefb5664bc8483e1400def7846c631728d814b1a163ba871c44a0215b32a1491899a86be9c986dd695612a3964235b20e73158e501e6005cec689a0c1a8d7e66e95c7b661018c01dce2732f0f88614caa69e0e0848f5a750c8a9bbaa01aab317da329eee7bcdb91ee23d9a776f2a662bc672cc89f9d8f1c40cf94a4d5a013b5fc28d7d795f1203db98a7f49493ec4dbc6e7f19415131fd724274d53b93b80',
'0xf90211a099cf6b57cf52d79d997c6c7cacc880d9eecba4d91b711e94567d153a4e7a0586a05dd28dc2c3001cd399773fec132570d32a88cf439c15d8ed1750692892019bbda0419a8369667afcc1bd0eb25aa2ee01aa9914389f1c4c5b8cfdb76c7387b1efeda0c31b4168d817e9e6c1f8d9241cb61d3e40417396438799cae60b21036c569585a02cb6faef5768eb7381530c01c30a69ee9d6b74b63ad7875df8dce0d3f9e33beea0722b13f67dcc8e022e2f2f6cf42b697330425f910499f9f69455e9b9dc7a5696a0c2da3ee274178cd500418aa82c86116f8a19c03f50680589689cd76c526885baa0de4fcbd8ef4edef419cac8f12a67f76c27a7d53a47d0408251c89b191599e2a6a01bec2c60b7ab411ffe01ef36723a82b1e36df58759e4356b90f0b939cf9f7feca0823b67e452e64a3986da2836b6398bfe6dd6257b1313b649bd38b8109b442e86a0fe8fd7cf12be37c649531fa445116c53258d76664ba95b84f6adac356015f469a04d68070a9bd5b183068eafc1edfec122dba0ded10725ebc468cb0b7b7fba15d6a051b612dfba41f35f8c827ee18387bf6e3316cb8494fd30d88a091b5405bc5d8ca01c622f8ce84c20a5d1055a984e405638509e2e8683d1fa89725b4855500f353aa01e795b4bd4df111c9528d22c7964d89f96cdb5f7217fda91132b10b30782965fa0d91eacec2f75501bb1e9c7c3dd7d2cdf12d206627f096da1408573f2775646ce80',
'0xf90211a03b7d6150ad44f8399b7fa60d27034db408b0fe2f42770312dbc12220205ba6b2a0c34225fedb6a5a5351429e52c6dc637abed3bde536318fbb9e592630dbaa9ff8a0a3a4cbf9ee86518067c263c9ea3c59683306519f5ad518f8c7ccb298e8b405dda0bb9847a6a1e58287f2f5e0dd2fc9a7e78118639f1d9768d970114fd72cf4bb94a00bd41abbd004fc6aabb2ad6ca5ad6c8adc9188263b41e3c5c1c640bc6cdad909a01ddb2f8f80a1856248f813e3f066f12a0699c83c7a620a3a156f8d7320887901a0716be43af95da7bb5b22ffd86b67790da8f6470bdb771a1c72c3d8b918101f77a08e844b3e7b41dbf69f7cb59df673d21dd0d0679b387d136e77e91e01c2aa83cda01086f25f4f678183dc4a5398a0c608f28578619d5ef25890457f266dfd0b2b45a05c463dd5c575e7440ceea9322b3a50fc1111f45f15d8a2bb822efe430cb321e9a0deb669961500f680770e94ee2253cd5fbb20d30a0d2cb10a35efd0c1a7827ebaa090fb4c646e0a7d00b427d27372532e003f6e430fef4a896b26da3d334b5e35bea0e00315beb0ceadcbfe33727cfdb08d98c86dca534ceb50e799f2bf914e18da66a0b32fcca5247e924812fedc00a2f6c72ef36dfb28896a315bbbad8f7dac09623ca07e5d50949d89b497620383abcc9fe952911f4821b50184261c3dda6e46a0b815a039921c389fef00713e4ad8897bc5c68781fee90d0873a42cfd814b8709152c4380',
'0xf901f1a01dd4ceeb1ab5bc49adb270f4c031783adcc6d4b8b2c874778310b84188fe9b64a0747c08e80562666c517c00dfb2648e71273377b1412b56ad5e45f633f952229aa0991ce5972ae42c944f7d7fafb8cf01913a0658efd48ea4beff7dfc4c45c0f21aa0fe8c9b0e45134639ea41c880910a73d49d3c5fb8e3cf003eda7ceb48891b9d12a0d5748723a79117e595d805b90c5da4f28a88ca06ab8a3b540509fc5f74487be2a04724502db500742f7bf9f64bd6d0c9cecb150dcacd8f41b235baa3228120c3dc80a05ba19409d69154ee9397c0451ce8fe478a4a17097c49df7f25aa349243522455a01f16b5317ef849b7d520e74f02e3a1b5d3aa5454a009c398f6917ef72d12fd3aa0354fbfecc5fe46c76395042141308381ef0f59e0ffae159d1758b287dcd92c2ea065df8dd7ad7fe8accdc96ae5bf97802b1425dec3cef9c148f49c736dc8151faaa0eb440cd657329946458789ab7ba02df5dcd77a28095009305001fe5124424079a05fa06e6354a138012417afd550c71a9a08164bceccf652f150d1ea6a31f89d20a06cc7b02dce36338aa84041a725bb47b87bc93090b676776b53c0a7c654d93361a02c4ec483c0b8b4d148c133e2ea471b3432d310ed7c43d2b983203bd08adbb3eda025964bfbdd4d19d5d5f094ac4ca8bb2476047f3c5328cb1c84a24ee5bea5fdcb80',
'0xf851808080a045d583df49281f7f8c545ab91f4d35ba48873cc4da6deb2c0703135959fc8ec080808080a0ca2836f17b4c1af21e2531f7036a069ba8ef535650495820731ca669590dfddb8080808080808080',
'0xe09e202ec4eafbdfe1b7f218e5f087854c923c7f41b85d3ada15c32bef29588a01',
]
const modifiedProof = maybeAddProofNode(key, proof)
expect(modifiedProof).to.deep.equal(proof)
})
// Test taken from MerkleTrie solidity test suite.
it('should not add a proof node when the value itself is inside a branch node', () => {
const key = '0x6b657933'
const proof = [
'0xe68416b65793a0f3f387240403976788281c0a6ee5b3fc08360d276039d635bb824ea7e6fed779',
'0xf87180a034d14ccc7685aa2beb64f78b11ee2a335eae82047ef97c79b7dda7f0732b9f4ca05fb052b64e23d177131d9f32e9c5b942209eb7229e9a07c99a5d93245f53af18a09a137197a43a880648d5887cce656a5e6bbbe5e44ecb4f264395ccaddbe1acca80808080808080808080808080',
'0xf839808080808080c9823363856176616c338080808080808080809f31323334353637383930313233343536373839303132333435363738393031',
]
const modifiedProof = maybeAddProofNode(key, proof)
expect(modifiedProof).to.deep.equal(proof)
})
})
})
import { BigNumber } from 'ethers'
import { expect } from '../setup'
import {
migratedWithdrawalGasLimit,
hashLowLevelMessage,
hashMessageHash,
} from '../../src/utils/message-utils'
const goerliChainID = 420
describe('Message Utils', () => {
describe('migratedWithdrawalGasLimit', () => {
it('should have a max of 25 million', () => {
const data = '0x' + 'ff'.repeat(15_000_000)
const result = migratedWithdrawalGasLimit(data, goerliChainID)
expect(result).to.eq(BigNumber.from(25_000_000))
})
it('should work for mixes of zeros and ones', () => {
const tests = [
{ input: '0x', result: BigNumber.from(200_000) },
{ input: '0xff', result: BigNumber.from(200_000 + 16) },
{ input: '0xff00', result: BigNumber.from(200_000 + 16 + 16) },
{ input: '0x00', result: BigNumber.from(200_000 + 16) },
{ input: '0x000000', result: BigNumber.from(200_000 + 16 + 16 + 16) },
]
for (const test of tests) {
const result = migratedWithdrawalGasLimit(test.input, goerliChainID)
expect(result).to.eq(test.result)
}
})
})
/**
* Test that storage slot computation is correct. The test vectors are
* from actual migrated withdrawals on goerli.
*/
describe('Withdrawal Hashing', () => {
it('should work', () => {
const tests = [
{
input: {
messageNonce: BigNumber.from(100000),
sender: '0x4200000000000000000000000000000000000007',
target: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294',
value: BigNumber.from(0),
minGasLimit: BigNumber.from(207744),
message:
'0xd764ad0b00000000000000000000000000000000000000000000000000000000000186a00000000000000000000000004200000000000000000000000000000000000010000000000000000000000000636af16bf2f682dd3109e60102b8e1a089fedaa80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e4a9f9e67500000000000000000000000007865c6e87b9f70255377e024ace6630c1eaa37f0000000000000000000000003b8e53b3ab8e01fb57d0c9e893bc4d655aa67d84000000000000000000000000b91882244f7f82540f2941a759724523c7b9a166000000000000000000000000b91882244f7f82540f2941a759724523c7b9a166000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
},
result:
'0x7c83d39edf60c0ab61bc7cfd2e5f741efdf02fd6e2da0f12318f0d1858d3773b',
},
{
input: {
messageNonce: BigNumber.from(100001),
sender: '0x4200000000000000000000000000000000000007',
target: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294',
value: BigNumber.from(0),
minGasLimit: BigNumber.from(207744),
message:
'0xd764ad0b00000000000000000000000000000000000000000000000000000000000186a10000000000000000000000004200000000000000000000000000000000000010000000000000000000000000636af16bf2f682dd3109e60102b8e1a089fedaa80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e4a9f9e67500000000000000000000000007865c6e87b9f70255377e024ace6630c1eaa37f0000000000000000000000004e62882864fb8ce54affcaf8d899a286762b011b000000000000000000000000b91882244f7f82540f2941a759724523c7b9a166000000000000000000000000b91882244f7f82540f2941a759724523c7b9a166000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
},
result:
'0x17c90d87508a23d806962f4c5f366ef505e8d80e5cc2a5c87242560c21d7c588',
},
]
for (const test of tests) {
const hash = hashLowLevelMessage(test.input)
const messageSlot = hashMessageHash(hash)
expect(messageSlot).to.eq(test.result)
}
})
})
})
import { defineConfig } from 'vitest/config'
// https://vitest.dev/config/ - for docs
export default defineConfig({
test: {
setupFiles: './setupVitest.ts',
include: ['test-next/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
},
})
......@@ -114,15 +114,6 @@ importers:
specifier: ^7.2.0
version: 7.2.0
indexer/api-ts:
devDependencies:
tsup:
specifier: ^8.0.1
version: 8.0.1(@swc/core@1.4.13)(postcss@8.4.35)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)
vitest:
specifier: ^1.2.2
version: 1.2.2(@types/node@20.11.17)(jsdom@24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.7))(terser@5.26.0)
packages/chain-mon:
dependencies:
'@eth-optimism/common-ts':
......@@ -190,60 +181,24 @@ importers:
specifier: ^5.4.5
version: 5.4.5
packages/sdk:
packages/devnet-tasks:
dependencies:
'@eth-optimism/contracts':
specifier: 0.6.0
version: 0.6.0(bufferutil@4.0.8)(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(utf-8-validate@5.0.7)
'@eth-optimism/core-utils':
specifier: ^0.13.2
version: 0.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)
lodash:
specifier: ^4.17.21
version: 4.17.21
merkletreejs:
specifier: ^0.3.11
version: 0.3.11
rlp:
specifier: ^2.2.7
version: 2.2.7
semver:
specifier: ^7.6.0
version: 7.6.0
'@eth-optimism/sdk':
specifier: ^3.3.1
version: 3.3.1(bufferutil@4.0.8)(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(utf-8-validate@5.0.7)
devDependencies:
'@ethersproject/abstract-provider':
specifier: ^5.7.0
version: 5.7.0
'@ethersproject/abstract-signer':
specifier: ^5.7.0
version: 5.7.0
'@ethersproject/transactions':
specifier: ^5.7.0
version: 5.7.0
'@nomiclabs/hardhat-ethers':
specifier: ^2.2.3
version: 2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))
'@nomiclabs/hardhat-waffle':
specifier: ^2.0.1
version: 2.0.1(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)))(ethereum-waffle@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))
'@types/chai':
specifier: ^4.3.11
version: 4.3.11
'@types/chai-as-promised':
specifier: ^7.1.8
version: 7.1.8
'@types/mocha':
specifier: ^10.0.6
version: 10.0.6
version: 2.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)))(@types/sinon-chai@3.2.5)(ethereum-waffle@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))
'@types/node':
specifier: ^20.11.17
version: 20.11.17
'@types/semver':
specifier: ^7.5.7
version: 7.5.7
chai-as-promised:
specifier: ^7.1.1
version: 7.1.1(chai@4.3.10)
ethereum-waffle:
specifier: ^4.0.10
version: 4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5)
......@@ -256,12 +211,6 @@ importers:
hardhat-deploy:
specifier: ^0.12.2
version: 0.12.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)
isomorphic-fetch:
specifier: ^3.0.0
version: 3.0.0
mocha:
specifier: ^10.2.0
version: 10.2.0
nyc:
specifier: ^15.1.0
version: 15.1.0
......@@ -274,15 +223,6 @@ importers:
typescript:
specifier: ^5.4.5
version: 5.4.5
viem:
specifier: ^2.8.13
version: 2.8.13(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.7)(zod@3.22.4)
vitest:
specifier: ^1.2.2
version: 1.2.2(@types/node@20.11.17)(jsdom@24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.7))(terser@5.26.0)
zod:
specifier: ^3.22.4
version: 3.22.4
packages:
......@@ -290,9 +230,6 @@ packages:
resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
engines: {node: '>=0.10.0'}
'@adraffy/ens-normalize@1.10.0':
resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==}
'@ampproject/remapping@2.2.1':
resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
engines: {node: '>=6.0.0'}
......@@ -489,264 +426,132 @@ packages:
cpu: [arm64]
os: [android]
'@esbuild/android-arm64@0.19.7':
resolution: {integrity: sha512-YEDcw5IT7hW3sFKZBkCAQaOCJQLONVcD4bOyTXMZz5fr66pTHnAet46XAtbXAkJRfIn2YVhdC6R9g4xa27jQ1w==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.19.10':
resolution: {integrity: sha512-7W0bK7qfkw1fc2viBfrtAEkDKHatYfHzr/jKAHNr9BvkYDXPcC6bodtm8AyLJNNuqClLNaeTLuwURt4PRT9d7w==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
'@esbuild/android-arm@0.19.7':
resolution: {integrity: sha512-YGSPnndkcLo4PmVl2tKatEn+0mlVMr3yEpOOT0BeMria87PhvoJb5dg5f5Ft9fbCVgtAz4pWMzZVgSEGpDAlww==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.19.10':
resolution: {integrity: sha512-O/nO/g+/7NlitUxETkUv/IvADKuZXyH4BHf/g/7laqKC4i/7whLpB0gvpPc2zpF0q9Q6FXS3TS75QHac9MvVWw==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
'@esbuild/android-x64@0.19.7':
resolution: {integrity: sha512-jhINx8DEjz68cChFvM72YzrqfwJuFbfvSxZAk4bebpngGfNNRm+zRl4rtT9oAX6N9b6gBcFaJHFew5Blf6CvUw==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.19.10':
resolution: {integrity: sha512-YSRRs2zOpwypck+6GL3wGXx2gNP7DXzetmo5pHXLrY/VIMsS59yKfjPizQ4lLt5vEI80M41gjm2BxrGZ5U+VMA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-arm64@0.19.7':
resolution: {integrity: sha512-dr81gbmWN//3ZnBIm6YNCl4p3pjnabg1/ZVOgz2fJoUO1a3mq9WQ/1iuEluMs7mCL+Zwv7AY5e3g1hjXqQZ9Iw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.19.10':
resolution: {integrity: sha512-alfGtT+IEICKtNE54hbvPg13xGBe4GkVxyGWtzr+yHO7HIiRJppPDhOKq3zstTcVf8msXb/t4eavW3jCDpMSmA==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
'@esbuild/darwin-x64@0.19.7':
resolution: {integrity: sha512-Lc0q5HouGlzQEwLkgEKnWcSazqr9l9OdV2HhVasWJzLKeOt0PLhHaUHuzb8s/UIya38DJDoUm74GToZ6Wc7NGQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.19.10':
resolution: {integrity: sha512-dMtk1wc7FSH8CCkE854GyGuNKCewlh+7heYP/sclpOG6Cectzk14qdUIY5CrKDbkA/OczXq9WesqnPl09mj5dg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-arm64@0.19.7':
resolution: {integrity: sha512-+y2YsUr0CxDFF7GWiegWjGtTUF6gac2zFasfFkRJPkMAuMy9O7+2EH550VlqVdpEEchWMynkdhC9ZjtnMiHImQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.19.10':
resolution: {integrity: sha512-G5UPPspryHu1T3uX8WiOEUa6q6OlQh6gNl4CO4Iw5PS+Kg5bVggVFehzXBJY6X6RSOMS8iXDv2330VzaObm4Ag==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
'@esbuild/freebsd-x64@0.19.7':
resolution: {integrity: sha512-CdXOxIbIzPJmJhrpmJTLx+o35NoiKBIgOvmvT+jeSadYiWJn0vFKsl+0bSG/5lwjNHoIDEyMYc/GAPR9jxusTA==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.19.10':
resolution: {integrity: sha512-QxaouHWZ+2KWEj7cGJmvTIHVALfhpGxo3WLmlYfJ+dA5fJB6lDEIg+oe/0//FuyVHuS3l79/wyBxbHr0NgtxJQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm64@0.19.7':
resolution: {integrity: sha512-inHqdOVCkUhHNvuQPT1oCB7cWz9qQ/Cz46xmVe0b7UXcuIJU3166aqSunsqkgSGMtUCWOZw3+KMwI6otINuC9g==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.19.10':
resolution: {integrity: sha512-j6gUW5aAaPgD416Hk9FHxn27On28H4eVI9rJ4az7oCGTFW48+LcgNDBN+9f8rKZz7EEowo889CPKyeaD0iw9Kg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
'@esbuild/linux-arm@0.19.7':
resolution: {integrity: sha512-Y+SCmWxsJOdQtjcBxoacn/pGW9HDZpwsoof0ttL+2vGcHokFlfqV666JpfLCSP2xLxFpF1lj7T3Ox3sr95YXww==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.19.10':
resolution: {integrity: sha512-4ub1YwXxYjj9h1UIZs2hYbnTZBtenPw5NfXCRgEkGb0b6OJ2gpkMvDqRDYIDRjRdWSe/TBiZltm3Y3Q8SN1xNg==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-ia32@0.19.7':
resolution: {integrity: sha512-2BbiL7nLS5ZO96bxTQkdO0euGZIUQEUXMTrqLxKUmk/Y5pmrWU84f+CMJpM8+EHaBPfFSPnomEaQiG/+Gmh61g==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.19.10':
resolution: {integrity: sha512-lo3I9k+mbEKoxtoIbM0yC/MZ1i2wM0cIeOejlVdZ3D86LAcFXFRdeuZmh91QJvUTW51bOK5W2BznGNIl4+mDaA==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-loong64@0.19.7':
resolution: {integrity: sha512-BVFQla72KXv3yyTFCQXF7MORvpTo4uTA8FVFgmwVrqbB/4DsBFWilUm1i2Oq6zN36DOZKSVUTb16jbjedhfSHw==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.19.10':
resolution: {integrity: sha512-J4gH3zhHNbdZN0Bcr1QUGVNkHTdpijgx5VMxeetSk6ntdt+vR1DqGmHxQYHRmNb77tP6GVvD+K0NyO4xjd7y4A==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-mips64el@0.19.7':
resolution: {integrity: sha512-DzAYckIaK+pS31Q/rGpvUKu7M+5/t+jI+cdleDgUwbU7KdG2eC3SUbZHlo6Q4P1CfVKZ1lUERRFP8+q0ob9i2w==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.19.10':
resolution: {integrity: sha512-tgT/7u+QhV6ge8wFMzaklOY7KqiyitgT1AUHMApau32ZlvTB/+efeCtMk4eXS+uEymYK249JsoiklZN64xt6oQ==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-ppc64@0.19.7':
resolution: {integrity: sha512-JQ1p0SmUteNdUaaiRtyS59GkkfTW0Edo+e0O2sihnY4FoZLz5glpWUQEKMSzMhA430ctkylkS7+vn8ziuhUugQ==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.19.10':
resolution: {integrity: sha512-0f/spw0PfBMZBNqtKe5FLzBDGo0SKZKvMl5PHYQr3+eiSscfJ96XEknCe+JoOayybWUFQbcJTrk946i3j9uYZA==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-riscv64@0.19.7':
resolution: {integrity: sha512-xGwVJ7eGhkprY/nB7L7MXysHduqjpzUl40+XoYDGC4UPLbnG+gsyS1wQPJ9lFPcxYAaDXbdRXd1ACs9AE9lxuw==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.19.10':
resolution: {integrity: sha512-pZFe0OeskMHzHa9U38g+z8Yx5FNCLFtUnJtQMpwhS+r4S566aK2ci3t4NCP4tjt6d5j5uo4h7tExZMjeKoehAA==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-s390x@0.19.7':
resolution: {integrity: sha512-U8Rhki5PVU0L0nvk+E8FjkV8r4Lh4hVEb9duR6Zl21eIEYEwXz8RScj4LZWA2i3V70V4UHVgiqMpszXvG0Yqhg==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.19.10':
resolution: {integrity: sha512-SpYNEqg/6pZYoc+1zLCjVOYvxfZVZj6w0KROZ3Fje/QrM3nfvT2llI+wmKSrWuX6wmZeTapbarvuNNK/qepSgA==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
'@esbuild/linux-x64@0.19.7':
resolution: {integrity: sha512-ZYZopyLhm4mcoZXjFt25itRlocKlcazDVkB4AhioiL9hOWhDldU9n38g62fhOI4Pth6vp+Mrd5rFKxD0/S+7aQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-x64@0.19.10':
resolution: {integrity: sha512-ACbZ0vXy9zksNArWlk2c38NdKg25+L9pr/mVaj9SUq6lHZu/35nx2xnQVRGLrC1KKQqJKRIB0q8GspiHI3J80Q==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
'@esbuild/netbsd-x64@0.19.7':
resolution: {integrity: sha512-/yfjlsYmT1O3cum3J6cmGG16Fd5tqKMcg5D+sBYLaOQExheAJhqr8xOAEIuLo8JYkevmjM5zFD9rVs3VBcsjtQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-x64@0.19.10':
resolution: {integrity: sha512-PxcgvjdSjtgPMiPQrM3pwSaG4kGphP+bLSb+cihuP0LYdZv1epbAIecHVl5sD3npkfYBZ0ZnOjR878I7MdJDFg==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
'@esbuild/openbsd-x64@0.19.7':
resolution: {integrity: sha512-MYDFyV0EW1cTP46IgUJ38OnEY5TaXxjoDmwiTXPjezahQgZd+j3T55Ht8/Q9YXBM0+T9HJygrSRGV5QNF/YVDQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
'@esbuild/sunos-x64@0.19.10':
resolution: {integrity: sha512-ZkIOtrRL8SEJjr+VHjmW0znkPs+oJXhlJbNwfI37rvgeMtk3sxOQevXPXjmAPZPigVTncvFqLMd+uV0IBSEzqA==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
'@esbuild/sunos-x64@0.19.7':
resolution: {integrity: sha512-JcPvgzf2NN/y6X3UUSqP6jSS06V0DZAV/8q0PjsZyGSXsIGcG110XsdmuWiHM+pno7/mJF6fjH5/vhUz/vA9fw==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.19.10':
resolution: {integrity: sha512-+Sa4oTDbpBfGpl3Hn3XiUe4f8TU2JF7aX8cOfqFYMMjXp6ma6NJDztl5FDG8Ezx0OjwGikIHw+iA54YLDNNVfw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-arm64@0.19.7':
resolution: {integrity: sha512-ZA0KSYti5w5toax5FpmfcAgu3ZNJxYSRm0AW/Dao5up0YV1hDVof1NvwLomjEN+3/GMtaWDI+CIyJOMTRSTdMw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.19.10':
resolution: {integrity: sha512-EOGVLK1oWMBXgfttJdPHDTiivYSjX6jDNaATeNOaCOFEVcfMjtbx7WVQwPSE1eIfCp/CaSF2nSrDtzc4I9f8TQ==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-ia32@0.19.7':
resolution: {integrity: sha512-CTOnijBKc5Jpk6/W9hQMMvJnsSYRYgveN6O75DTACCY18RA2nqka8dTZR+x/JqXCRiKk84+5+bRKXUSbbwsS0A==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.19.10':
resolution: {integrity: sha512-whqLG6Sc70AbU73fFYvuYzaE4MNMBIlR1Y/IrUeOXFrWHxBEjjbZaQ3IXIQS8wJdAzue2GwYZCjOrgrU1oUHoA==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
'@esbuild/win32-x64@0.19.7':
resolution: {integrity: sha512-gRaP2sk6hc98N734luX4VpF318l3w+ofrtTu9j5L8EQXF+FzQKV6alCOHMVoJJHvVK/mGbwBXfOL1HETQu9IGQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
'@eslint-community/eslint-utils@4.4.0':
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
......@@ -1007,9 +812,6 @@ packages:
resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==}
engines: {node: '>=6.0.0'}
'@jridgewell/source-map@0.3.5':
resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==}
'@jridgewell/sourcemap-codec@1.4.15':
resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
......@@ -1035,9 +837,6 @@ packages:
'@noble/curves@1.1.0':
resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==}
'@noble/curves@1.2.0':
resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==}
'@noble/hashes@1.2.0':
resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==}
......@@ -1196,14 +995,6 @@ packages:
ethers: ^5.0.0
hardhat: ^2.0.0
'@nomiclabs/hardhat-waffle@2.0.1':
resolution: {integrity: sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ==}
peerDependencies:
'@nomiclabs/hardhat-ethers': ^2.0.0
ethereum-waffle: ^3.2.0
ethers: ^5.0.0
hardhat: ^2.0.0
'@nomiclabs/hardhat-waffle@2.0.6':
resolution: {integrity: sha512-+Wz0hwmJGSI17B+BhU/qFRZ1l6/xMW82QGXE/Gi+WTmwgJrQefuBs1lIf7hzQ1hLk6hpkvb/zwcNkpVKRYTQYg==}
peerDependencies:
......@@ -1296,66 +1087,6 @@ packages:
'@resolver-engine/imports@0.3.3':
resolution: {integrity: sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==}
'@rollup/rollup-android-arm-eabi@4.5.1':
resolution: {integrity: sha512-YaN43wTyEBaMqLDYeze+gQ4ZrW5RbTEGtT5o1GVDkhpdNcsLTnLRcLccvwy3E9wiDKWg9RIhuoy3JQKDRBfaZA==}
cpu: [arm]
os: [android]
'@rollup/rollup-android-arm64@4.5.1':
resolution: {integrity: sha512-n1bX+LCGlQVuPlCofO0zOKe1b2XkFozAVRoczT+yxWZPGnkEAKTTYVOGZz8N4sKuBnKMxDbfhUsB1uwYdup/sw==}
cpu: [arm64]
os: [android]
'@rollup/rollup-darwin-arm64@4.5.1':
resolution: {integrity: sha512-QqJBumdvfBqBBmyGHlKxje+iowZwrHna7pokj/Go3dV1PJekSKfmjKrjKQ/e6ESTGhkfPNLq3VXdYLAc+UtAQw==}
cpu: [arm64]
os: [darwin]
'@rollup/rollup-darwin-x64@4.5.1':
resolution: {integrity: sha512-RrkDNkR/P5AEQSPkxQPmd2ri8WTjSl0RYmuFOiEABkEY/FSg0a4riihWQGKDJ4LnV9gigWZlTMx2DtFGzUrYQw==}
cpu: [x64]
os: [darwin]
'@rollup/rollup-linux-arm-gnueabihf@4.5.1':
resolution: {integrity: sha512-ZFPxvUZmE+fkB/8D9y/SWl/XaDzNSaxd1TJUSE27XAKlRpQ2VNce/86bGd9mEUgL3qrvjJ9XTGwoX0BrJkYK/A==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm64-gnu@4.5.1':
resolution: {integrity: sha512-FEuAjzVIld5WVhu+M2OewLmjmbXWd3q7Zcx+Rwy4QObQCqfblriDMMS7p7+pwgjZoo9BLkP3wa9uglQXzsB9ww==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-arm64-musl@4.5.1':
resolution: {integrity: sha512-f5Gs8WQixqGRtI0Iq/cMqvFYmgFzMinuJO24KRfnv7Ohi/HQclwrBCYkzQu1XfLEEt3DZyvveq9HWo4bLJf1Lw==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-x64-gnu@4.5.1':
resolution: {integrity: sha512-CWPkPGrFfN2vj3mw+S7A/4ZaU3rTV7AkXUr08W9lNP+UzOvKLVf34tWCqrKrfwQ0NTk5GFqUr2XGpeR2p6R4gw==}
cpu: [x64]
os: [linux]
'@rollup/rollup-linux-x64-musl@4.5.1':
resolution: {integrity: sha512-ZRETMFA0uVukUC9u31Ed1nx++29073goCxZtmZARwk5aF/ltuENaeTtRVsSQzFlzdd4J6L3qUm+EW8cbGt0CKQ==}
cpu: [x64]
os: [linux]
'@rollup/rollup-win32-arm64-msvc@4.5.1':
resolution: {integrity: sha512-ihqfNJNb2XtoZMSCPeoo0cYMgU04ksyFIoOw5S0JUVbOhafLot+KD82vpKXOurE2+9o/awrqIxku9MRR9hozHQ==}
cpu: [arm64]
os: [win32]
'@rollup/rollup-win32-ia32-msvc@4.5.1':
resolution: {integrity: sha512-zK9MRpC8946lQ9ypFn4gLpdwr5a01aQ/odiIJeL9EbgZDMgbZjjT/XzTqJvDfTmnE1kHdbG20sAeNlpc91/wbg==}
cpu: [ia32]
os: [win32]
'@rollup/rollup-win32-x64-msvc@4.5.1':
resolution: {integrity: sha512-5I3Nz4Sb9TYOtkRwlH0ow+BhMH2vnh38tZ4J4mggE48M/YyJyp/0sPSxhw1UeS1+oBgQ8q7maFtSeKpeRJu41Q==}
cpu: [x64]
os: [win32]
'@scure/base@1.1.3':
resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==}
......@@ -1365,9 +1096,6 @@ packages:
'@scure/bip32@1.3.1':
resolution: {integrity: sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==}
'@scure/bip32@1.3.2':
resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==}
'@scure/bip39@1.1.1':
resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==}
......@@ -1573,9 +1301,6 @@ packages:
'@types/debug@4.1.12':
resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
'@types/estree@1.0.5':
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
'@types/express-serve-static-core@4.17.35':
resolution: {integrity: sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==}
......@@ -1669,15 +1394,9 @@ packages:
'@types/sinon@10.0.2':
resolution: {integrity: sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==}
'@types/underscore@1.11.3':
resolution: {integrity: sha512-Fl1TX1dapfXyDqFg2ic9M+vlXRktcPJrc4PR7sRc7sdVrjavg/JHlbUXBt8qWWqhJrmSqg3RNAkAPRiOYw6Ahw==}
'@types/unist@2.0.6':
resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
'@types/web3@1.0.19':
resolution: {integrity: sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A==}
'@typescript-eslint/eslint-plugin@6.21.0':
resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==}
engines: {node: ^16.0.0 || >=18.0.0}
......@@ -1739,21 +1458,6 @@ packages:
'@ungap/structured-clone@1.2.0':
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
'@vitest/expect@1.2.2':
resolution: {integrity: sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==}
'@vitest/runner@1.2.2':
resolution: {integrity: sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==}
'@vitest/snapshot@1.2.2':
resolution: {integrity: sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==}
'@vitest/spy@1.2.2':
resolution: {integrity: sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==}
'@vitest/utils@1.2.2':
resolution: {integrity: sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==}
'@vue/compiler-core@3.3.4':
resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==}
......@@ -1783,17 +1487,6 @@ packages:
resolution: {integrity: sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg==}
hasBin: true
abitype@1.0.0:
resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==}
peerDependencies:
typescript: '>=5.0.4'
zod: ^3 >=3.22.0
peerDependenciesMeta:
typescript:
optional: true
zod:
optional: true
abort-controller@3.0.0:
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
engines: {node: '>=6.5'}
......@@ -1819,10 +1512,6 @@ packages:
resolution: {integrity: sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==}
engines: {node: '>=0.4.0'}
acorn-walk@8.3.2:
resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==}
engines: {node: '>=0.4.0'}
acorn@8.10.0:
resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==}
engines: {node: '>=0.4.0'}
......@@ -1839,10 +1528,6 @@ packages:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
agent-base@7.1.0:
resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
engines: {node: '>= 14'}
aggregate-error@3.1.0:
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
engines: {node: '>=8'}
......@@ -1903,9 +1588,6 @@ packages:
resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
engines: {node: '>=12'}
any-promise@1.3.0:
resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
......@@ -2180,12 +1862,6 @@ packages:
resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
engines: {node: '>=6'}
bundle-require@4.0.1:
resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
peerDependencies:
esbuild: '>=0.17'
busboy@1.6.0:
resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==}
engines: {node: '>=10.16.0'}
......@@ -2194,10 +1870,6 @@ packages:
resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
engines: {node: '>= 0.8'}
cac@6.7.14:
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
engines: {node: '>=8'}
caching-transform@4.0.0:
resolution: {integrity: sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==}
engines: {node: '>=8'}
......@@ -2392,10 +2064,6 @@ packages:
commander@3.0.2:
resolution: {integrity: sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==}
commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
commander@8.3.0:
resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==}
engines: {node: '>= 12'}
......@@ -2418,9 +2086,6 @@ packages:
resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
engines: {node: '>= 0.6'}
convert-source-map@1.8.0:
resolution: {integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==}
convert-source-map@1.9.0:
resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
......@@ -2473,10 +2138,6 @@ packages:
crypto-js@4.2.0:
resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==}
cssstyle@4.0.1:
resolution: {integrity: sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==}
engines: {node: '>=18'}
csv-generate@3.4.3:
resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==}
......@@ -2494,10 +2155,6 @@ packages:
resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
engines: {node: '>=0.10'}
data-urls@5.0.0:
resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}
engines: {node: '>=18'}
dataloader@1.4.0:
resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
......@@ -2541,9 +2198,6 @@ packages:
resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==}
engines: {node: '>=10'}
decimal.js@10.4.3:
resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
deep-eql@4.1.3:
resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==}
engines: {node: '>=6'}
......@@ -2729,10 +2383,6 @@ packages:
resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==}
engines: {node: '>=0.12'}
entities@4.5.0:
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
engines: {node: '>=0.12'}
env-paths@2.2.1:
resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
engines: {node: '>=6'}
......@@ -2774,11 +2424,6 @@ packages:
engines: {node: '>=12'}
hasBin: true
esbuild@0.19.7:
resolution: {integrity: sha512-6brbTZVqxhqgbpqBR5MzErImcpA0SQdoKOkcWK/U30HtQxnokIpG3TX2r0IJqbFUzqLjhU/zC1S5ndgakObVCQ==}
engines: {node: '>=12'}
hasBin: true
escalade@3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
......@@ -2951,9 +2596,6 @@ packages:
estree-walker@2.0.2:
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
esutils@2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
......@@ -3023,10 +2665,6 @@ packages:
evp_bytestokey@1.0.3:
resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==}
execa@5.1.1:
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
engines: {node: '>=10'}
execa@8.0.1:
resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==}
engines: {node: '>=16.17'}
......@@ -3291,10 +2929,6 @@ packages:
resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==}
engines: {node: '>=8.0.0'}
get-stream@6.0.1:
resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
engines: {node: '>=10'}
get-stream@8.0.1:
resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
engines: {node: '>=16'}
......@@ -3322,11 +2956,9 @@ packages:
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
glob@7.1.6:
resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
glob@7.1.7:
resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==}
deprecated: Glob versions prior to v9 are no longer supported
glob@7.2.0:
resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==}
......@@ -3457,10 +3089,6 @@ packages:
hosted-git-info@2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
html-encoding-sniffer@4.0.0:
resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==}
engines: {node: '>=18'}
html-escaper@2.0.2:
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
......@@ -3471,10 +3099,6 @@ packages:
resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==}
engines: {node: '>= 0.8'}
http-proxy-agent@7.0.0:
resolution: {integrity: sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==}
engines: {node: '>= 14'}
http-signature@1.2.0:
resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
engines: {node: '>=0.8', npm: '>=1.3.7'}
......@@ -3483,17 +3107,9 @@ packages:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'}
https-proxy-agent@7.0.2:
resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==}
engines: {node: '>= 14'}
human-id@1.0.2:
resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==}
human-signals@2.1.0:
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
engines: {node: '>=10.17.0'}
human-signals@5.0.0:
resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
engines: {node: '>=16.17.0'}
......@@ -3507,10 +3123,6 @@ packages:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'}
iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
idna-uts46-hx@2.3.1:
resolution: {integrity: sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==}
engines: {node: '>=4.0.0'}
......@@ -3697,9 +3309,6 @@ packages:
resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==}
engines: {node: '>=8'}
is-potential-custom-element-name@1.0.1:
resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}
is-regex@1.1.4:
resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
engines: {node: '>= 0.4'}
......@@ -3770,21 +3379,9 @@ packages:
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
isomorphic-fetch@3.0.0:
resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==}
isows@1.0.3:
resolution: {integrity: sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==}
peerDependencies:
ws: '*'
isstream@0.1.2:
resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
istanbul-lib-coverage@3.0.0:
resolution: {integrity: sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==}
engines: {node: '>=8'}
istanbul-lib-coverage@3.2.2:
resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}
engines: {node: '>=8'}
......@@ -3801,10 +3398,6 @@ packages:
resolution: {integrity: sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==}
engines: {node: '>=8'}
istanbul-lib-report@3.0.0:
resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==}
engines: {node: '>=8'}
istanbul-lib-report@3.0.1:
resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==}
engines: {node: '>=10'}
......@@ -3835,10 +3428,6 @@ packages:
joi@17.11.0:
resolution: {integrity: sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==}
joycon@3.1.1:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
js-sdsl@4.4.2:
resolution: {integrity: sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w==}
......@@ -3866,15 +3455,6 @@ packages:
resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==}
engines: {node: '>=12.0.0'}
jsdom@24.0.0:
resolution: {integrity: sha512-UDS2NayCvmXSXVP6mpTj+73JnNQadZlr9N68189xib2tx5Mls7swlTNao26IoHv46BZJFvXygyRtyXd1feAk1A==}
engines: {node: '>=18'}
peerDependencies:
canvas: ^2.11.2
peerDependenciesMeta:
canvas:
optional: true
jsesc@0.5.0:
resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==}
hasBin: true
......@@ -3999,10 +3579,6 @@ packages:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
lilconfig@2.1.0:
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
engines: {node: '>=10'}
lilconfig@3.0.0:
resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==}
engines: {node: '>=14'}
......@@ -4027,18 +3603,10 @@ packages:
resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==}
engines: {node: '>=0.10.0'}
load-tsconfig@0.2.5:
resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
load-yaml-file@0.2.0:
resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==}
engines: {node: '>=6'}
local-pkg@0.5.0:
resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==}
engines: {node: '>=14'}
locate-path@2.0.0:
resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==}
engines: {node: '>=4'}
......@@ -4063,9 +3631,6 @@ packages:
lodash.merge@4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
lodash.sortby@4.7.0:
resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==}
lodash.startcase@4.4.0:
resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==}
......@@ -4340,9 +3905,6 @@ packages:
engines: {node: '>=10'}
hasBin: true
mlly@1.4.2:
resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==}
mnemonist@0.38.3:
resolution: {integrity: sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw==}
......@@ -4371,9 +3933,6 @@ packages:
murmur-128@0.2.1:
resolution: {integrity: sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==}
mz@2.7.0:
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
nanoid@3.3.3:
resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
......@@ -4444,9 +4003,6 @@ packages:
resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==}
engines: {node: '>=6.5.0', npm: '>=3'}
nwsapi@2.2.7:
resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==}
nx-cloud@18.0.0:
resolution: {integrity: sha512-VpPywcHmFIU3GSWb3KV3nQ+TAMLc06DTO39vTFsM+HreB6qRloDxbADRvfM5eHAbY26TNmwflT7wxd0fluv2+A==}
hasBin: true
......@@ -4583,10 +4139,6 @@ packages:
resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
engines: {node: '>=10'}
p-limit@5.0.0:
resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==}
engines: {node: '>=18'}
p-locate@2.0.0:
resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==}
engines: {node: '>=4'}
......@@ -4642,9 +4194,6 @@ packages:
resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==}
engines: {node: '>=0.10.0'}
parse5@7.1.2:
resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
parseurl@1.3.3:
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
engines: {node: '>= 0.8'}
......@@ -4694,9 +4243,6 @@ packages:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
pathe@1.1.1:
resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==}
pathval@1.1.1:
resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}
......@@ -4764,17 +4310,10 @@ packages:
resolution: {integrity: sha512-oswmokxkav9bADfJ2ifrvfHUwad6MLp73Uat0IkQWY3iAw5xTRoznXbXksZs8oaOUMpmhVWD+PZogNzllWpJaA==}
hasBin: true
pirates@4.0.6:
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
engines: {node: '>= 6'}
pkg-dir@4.2.0:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
engines: {node: '>=8'}
pkg-types@1.0.3:
resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==}
please-upgrade-node@3.2.0:
resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==}
......@@ -4782,18 +4321,6 @@ packages:
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
engines: {node: '>=4'}
postcss-load-config@4.0.1:
resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==}
engines: {node: '>= 14'}
peerDependencies:
postcss: '>=8.0.9'
ts-node: '>=9.0.0'
peerDependenciesMeta:
postcss:
optional: true
ts-node:
optional: true
postcss@8.4.35:
resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==}
engines: {node: ^10 || ^12 || >=14}
......@@ -4885,9 +4412,6 @@ packages:
resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==}
engines: {node: '>=0.6'}
querystringify@2.2.0:
resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==}
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
......@@ -5032,9 +4556,6 @@ packages:
require-package-name@2.0.1:
resolution: {integrity: sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==}
requires-port@1.0.0:
resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==}
resolve-dir@1.0.1:
resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==}
engines: {node: '>=0.10.0'}
......@@ -5082,6 +4603,7 @@ packages:
rimraf@2.7.1:
resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
deprecated: Rimraf versions prior to v4 are no longer supported
hasBin: true
rimraf@3.0.2:
......@@ -5104,14 +4626,6 @@ packages:
resolution: {integrity: sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==}
hasBin: true
rollup@4.5.1:
resolution: {integrity: sha512-0EQribZoPKpb5z1NW/QYm3XSR//Xr8BeEXU49Lc/mQmpmVVG5jPUVrpc2iptup/0WMrY9mzas0fxH+TjYvG2CA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
rrweb-cssom@0.6.0:
resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
......@@ -5147,10 +4661,6 @@ packages:
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
saxes@6.0.0:
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
engines: {node: '>=v12.22.7'}
scrypt-js@3.0.1:
resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==}
......@@ -5227,9 +4737,6 @@ packages:
side-channel@1.0.4:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
siginfo@2.0.0:
resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
......@@ -5285,10 +4792,6 @@ packages:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
source-map@0.8.0-beta.0:
resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==}
engines: {node: '>= 8'}
spawn-wrap@2.0.0:
resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==}
engines: {node: '>=8'}
......@@ -5326,9 +4829,6 @@ packages:
engines: {node: '>=0.10.0'}
hasBin: true
stackback@0.0.2:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
stacktrace-parser@0.1.10:
resolution: {integrity: sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==}
engines: {node: '>=6'}
......@@ -5337,9 +4837,6 @@ packages:
resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==}
engines: {node: '>= 0.8'}
std-env@3.6.0:
resolution: {integrity: sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==}
stream-shift@1.0.1:
resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==}
......@@ -5413,10 +4910,6 @@ packages:
resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==}
engines: {node: '>=8'}
strip-final-newline@2.0.0:
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
engines: {node: '>=6'}
strip-final-newline@3.0.0:
resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
engines: {node: '>=12'}
......@@ -5433,19 +4926,11 @@ packages:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
strip-literal@1.3.0:
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
strong-log-transformer@2.1.0:
resolution: {integrity: sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==}
engines: {node: '>=4'}
hasBin: true
sucrase@3.34.0:
resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==}
engines: {node: '>=8'}
hasBin: true
supports-color@5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'}
......@@ -5462,9 +4947,6 @@ packages:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
symbol-tree@3.2.4:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
table-layout@1.0.2:
resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==}
engines: {node: '>=8.0.0'}
......@@ -5484,11 +4966,6 @@ packages:
resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==}
engines: {node: '>=8'}
terser@5.26.0:
resolution: {integrity: sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==}
engines: {node: '>=10'}
hasBin: true
test-exclude@6.0.0:
resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
engines: {node: '>=8'}
......@@ -5500,13 +4977,6 @@ packages:
text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
thenify-all@1.6.0:
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
engines: {node: '>=0.8'}
thenify@3.3.1:
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
thread-stream@0.15.2:
resolution: {integrity: sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==}
......@@ -5519,17 +4989,6 @@ packages:
through@2.3.8:
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
tinybench@2.5.1:
resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==}
tinypool@0.8.2:
resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==}
engines: {node: '>=14.0.0'}
tinyspy@2.2.0:
resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==}
engines: {node: '>=14.0.0'}
tmp@0.0.33:
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
engines: {node: '>=0.6.0'}
......@@ -5554,27 +5013,12 @@ packages:
resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==}
engines: {node: '>=0.8'}
tough-cookie@4.1.3:
resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==}
engines: {node: '>=6'}
tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
tr46@1.0.1:
resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==}
tr46@5.0.0:
resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==}
engines: {node: '>=18'}
traverse@0.6.6:
resolution: {integrity: sha512-kdf4JKs8lbARxWdp7RKdNzoJBhGUcIalSYibuGyHJbmk40pOysQ0+QPvlkCOICOivDWU2IJo2rkrxyTK2AH4fw==}
tree-kill@1.2.2:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
treeify@1.1.0:
resolution: {integrity: sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==}
engines: {node: '>=0.6'}
......@@ -5601,9 +5045,6 @@ packages:
peerDependencies:
typescript: '>=3.7.0'
ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
ts-mocha@10.0.0:
resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==}
engines: {node: '>= 6.X.X'}
......@@ -5646,25 +5087,6 @@ packages:
tsort@0.0.1:
resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==}
tsup@8.0.1:
resolution: {integrity: sha512-hvW7gUSG96j53ZTSlT4j/KL0q1Q2l6TqGBFc6/mu/L46IoNWqLLUzLRLP1R8Q7xrJTmkDxxDoojV5uCVs1sVOg==}
engines: {node: '>=18'}
hasBin: true
peerDependencies:
'@microsoft/api-extractor': ^7.36.0
'@swc/core': ^1
postcss: ^8.4.12
typescript: '>=4.5.0'
peerDependenciesMeta:
'@microsoft/api-extractor':
optional: true
'@swc/core':
optional: true
postcss:
optional: true
typescript:
optional: true
tsx@4.7.0:
resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==}
engines: {node: '>=18.0.0'}
......@@ -5776,9 +5198,6 @@ packages:
resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==}
engines: {node: '>=8'}
ufo@1.3.2:
resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==}
unbox-primitive@1.0.2:
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
......@@ -5808,10 +5227,6 @@ packages:
resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
engines: {node: '>= 4.0.0'}
universalify@0.2.0:
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
engines: {node: '>= 4.0.0'}
universalify@2.0.0:
resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==}
engines: {node: '>= 10.0.0'}
......@@ -5832,9 +5247,6 @@ packages:
uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
url-parse@1.5.10:
resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==}
url-value-parser@2.0.3:
resolution: {integrity: sha512-FjIX+Q9lYmDM9uYIGdMYfQW0uLbWVwN2NrL2ayAI7BTOvEwzH+VoDdNquwB9h4dFAx+u6mb0ONLa3sHD5DvyvA==}
engines: {node: '>=6.0.0'}
......@@ -5885,110 +5297,12 @@ packages:
vfile@4.2.1:
resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==}
viem@2.8.13:
resolution: {integrity: sha512-jEbRUjsiBwmoDr3fnKL1Bh1GhK5ERhmZcPLeARtEaQoBTPB6bcO2siKhNPVOF8qrYRnGHGQrZHncBWMQhTjGYg==}
peerDependencies:
typescript: '>=5.0.4'
peerDependenciesMeta:
typescript:
optional: true
vite-node@1.2.2:
resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==}
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
vite@5.1.5:
resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==}
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@types/node': ^18.0.0 || >=20.0.0
less: '*'
lightningcss: ^1.21.0
sass: '*'
stylus: '*'
sugarss: '*'
terser: ^5.4.0
peerDependenciesMeta:
'@types/node':
optional: true
less:
optional: true
lightningcss:
optional: true
sass:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
vite@5.1.7:
resolution: {integrity: sha512-sgnEEFTZYMui/sTlH1/XEnVNHMujOahPLGMxn1+5sIT45Xjng1Ec1K78jRP15dSmVgg5WBin9yO81j3o9OxofA==}
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@types/node': ^18.0.0 || >=20.0.0
less: '*'
lightningcss: ^1.21.0
sass: '*'
stylus: '*'
sugarss: '*'
terser: ^5.4.0
peerDependenciesMeta:
'@types/node':
optional: true
less:
optional: true
lightningcss:
optional: true
sass:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
vitest@1.2.2:
resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==}
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
'@types/node': ^18.0.0 || >=20.0.0
'@vitest/browser': ^1.0.0
'@vitest/ui': ^1.0.0
happy-dom: '*'
jsdom: '*'
peerDependenciesMeta:
'@edge-runtime/vm':
optional: true
'@types/node':
optional: true
'@vitest/browser':
optional: true
'@vitest/ui':
optional: true
happy-dom:
optional: true
jsdom:
optional: true
vscode-oniguruma@1.7.0:
resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==}
vscode-textmate@8.0.0:
resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==}
w3c-xmlserializer@5.0.0:
resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}
engines: {node: '>=18'}
wait-on@7.2.0:
resolution: {integrity: sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==}
engines: {node: '>=12.0.0'}
......@@ -6004,34 +5318,9 @@ packages:
webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
webidl-conversions@4.0.2:
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
webidl-conversions@7.0.0:
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'}
whatwg-encoding@3.1.1:
resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==}
engines: {node: '>=18'}
whatwg-fetch@3.6.17:
resolution: {integrity: sha512-c4ghIvG6th0eudYwKZY5keb81wtFz9/WeAHAoy8+r18kcWlitUIrmGFQ2rWEl4UCKUilD3zCLHOIPheHx5ypRQ==}
whatwg-mimetype@4.0.0:
resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}
engines: {node: '>=18'}
whatwg-url@14.0.0:
resolution: {integrity: sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==}
engines: {node: '>=18'}
whatwg-url@5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
whatwg-url@7.1.0:
resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==}
which-boxed-primitive@1.0.2:
resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
......@@ -6065,11 +5354,6 @@ packages:
engines: {node: '>= 8'}
hasBin: true
why-is-node-running@2.2.2:
resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==}
engines: {node: '>=8'}
hasBin: true
widest-line@3.1.0:
resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==}
engines: {node: '>=8'}
......@@ -6136,37 +5420,6 @@ packages:
utf-8-validate:
optional: true
ws@8.13.0:
resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
ws@8.16.0:
resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
xml-name-validator@5.0.0:
resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
engines: {node: '>=18'}
xmlchars@2.2.0:
resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==}
xtend@4.0.2:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
......@@ -6248,19 +5501,12 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
yocto-queue@1.0.0:
resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
engines: {node: '>=12.20'}
zksync-ethers@5.6.0:
resolution: {integrity: sha512-+lw1dhURpVZos6+g82HdXVw2i/OI+S2nTqyNvBK2xwnQYv8vqxv0Ux/cMPV2AflswTG1/zrMmseRp+UJUCaw9g==}
engines: {node: '>=16.0.0'}
peerDependencies:
ethers: ~5.7.0
zod@3.22.4:
resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
zwitch@1.0.5:
resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==}
......@@ -6268,8 +5514,6 @@ snapshots:
'@aashutoshrathi/word-wrap@1.2.6': {}
'@adraffy/ens-normalize@1.10.0': {}
'@ampproject/remapping@2.2.1':
dependencies:
'@jridgewell/gen-mapping': 0.3.3
......@@ -6607,135 +5851,69 @@ snapshots:
'@esbuild/android-arm64@0.19.10':
optional: true
'@esbuild/android-arm64@0.19.7':
optional: true
'@esbuild/android-arm@0.19.10':
optional: true
'@esbuild/android-arm@0.19.7':
optional: true
'@esbuild/android-x64@0.19.10':
optional: true
'@esbuild/android-x64@0.19.7':
optional: true
'@esbuild/darwin-arm64@0.19.10':
optional: true
'@esbuild/darwin-arm64@0.19.7':
optional: true
'@esbuild/darwin-x64@0.19.10':
optional: true
'@esbuild/darwin-x64@0.19.7':
optional: true
'@esbuild/freebsd-arm64@0.19.10':
optional: true
'@esbuild/freebsd-arm64@0.19.7':
optional: true
'@esbuild/freebsd-x64@0.19.10':
optional: true
'@esbuild/freebsd-x64@0.19.7':
optional: true
'@esbuild/linux-arm64@0.19.10':
optional: true
'@esbuild/linux-arm64@0.19.7':
optional: true
'@esbuild/linux-arm@0.19.10':
optional: true
'@esbuild/linux-arm@0.19.7':
optional: true
'@esbuild/linux-ia32@0.19.10':
optional: true
'@esbuild/linux-ia32@0.19.7':
optional: true
'@esbuild/linux-loong64@0.19.10':
optional: true
'@esbuild/linux-loong64@0.19.7':
optional: true
'@esbuild/linux-mips64el@0.19.10':
optional: true
'@esbuild/linux-mips64el@0.19.7':
optional: true
'@esbuild/linux-ppc64@0.19.10':
optional: true
'@esbuild/linux-ppc64@0.19.7':
optional: true
'@esbuild/linux-riscv64@0.19.10':
optional: true
'@esbuild/linux-riscv64@0.19.7':
optional: true
'@esbuild/linux-s390x@0.19.10':
optional: true
'@esbuild/linux-s390x@0.19.7':
optional: true
'@esbuild/linux-x64@0.19.10':
optional: true
'@esbuild/linux-x64@0.19.7':
optional: true
'@esbuild/netbsd-x64@0.19.10':
optional: true
'@esbuild/netbsd-x64@0.19.7':
optional: true
'@esbuild/openbsd-x64@0.19.10':
optional: true
'@esbuild/openbsd-x64@0.19.7':
optional: true
'@esbuild/sunos-x64@0.19.10':
optional: true
'@esbuild/sunos-x64@0.19.7':
optional: true
'@esbuild/win32-arm64@0.19.10':
optional: true
'@esbuild/win32-arm64@0.19.7':
optional: true
'@esbuild/win32-ia32@0.19.10':
optional: true
'@esbuild/win32-ia32@0.19.7':
optional: true
'@esbuild/win32-x64@0.19.10':
optional: true
'@esbuild/win32-x64@0.19.7':
optional: true
'@eslint-community/eslint-utils@4.4.0(eslint@8.56.0)':
dependencies:
eslint: 8.56.0
......@@ -7331,12 +6509,6 @@ snapshots:
'@jridgewell/set-array@1.1.2': {}
'@jridgewell/source-map@0.3.5':
dependencies:
'@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.19
optional: true
'@jridgewell/sourcemap-codec@1.4.15': {}
'@jridgewell/trace-mapping@0.3.19':
......@@ -7381,10 +6553,6 @@ snapshots:
dependencies:
'@noble/hashes': 1.3.1
'@noble/curves@1.2.0':
dependencies:
'@noble/hashes': 1.3.2
'@noble/hashes@1.2.0': {}
'@noble/hashes@1.3.1': {}
......@@ -7579,15 +6747,6 @@ snapshots:
ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)
hardhat: 2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)
'@nomiclabs/hardhat-waffle@2.0.1(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)))(ethereum-waffle@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))':
dependencies:
'@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))
'@types/sinon-chai': 3.2.5
'@types/web3': 1.0.19
ethereum-waffle: 4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5)
ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)
hardhat: 2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)
'@nomiclabs/hardhat-waffle@2.0.6(@nomiclabs/hardhat-ethers@2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7)))(@types/sinon-chai@3.2.5)(ethereum-waffle@4.0.10(@ensdomains/ens@0.4.5)(@ensdomains/resolver@0.2.4)(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(typescript@5.4.5))(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))':
dependencies:
'@nomiclabs/hardhat-ethers': 2.2.3(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7))(hardhat@2.20.1(bufferutil@4.0.8)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.7))
......@@ -7677,42 +6836,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@rollup/rollup-android-arm-eabi@4.5.1':
optional: true
'@rollup/rollup-android-arm64@4.5.1':
optional: true
'@rollup/rollup-darwin-arm64@4.5.1':
optional: true
'@rollup/rollup-darwin-x64@4.5.1':
optional: true
'@rollup/rollup-linux-arm-gnueabihf@4.5.1':
optional: true
'@rollup/rollup-linux-arm64-gnu@4.5.1':
optional: true
'@rollup/rollup-linux-arm64-musl@4.5.1':
optional: true
'@rollup/rollup-linux-x64-gnu@4.5.1':
optional: true
'@rollup/rollup-linux-x64-musl@4.5.1':
optional: true
'@rollup/rollup-win32-arm64-msvc@4.5.1':
optional: true
'@rollup/rollup-win32-ia32-msvc@4.5.1':
optional: true
'@rollup/rollup-win32-x64-msvc@4.5.1':
optional: true
'@scure/base@1.1.3': {}
'@scure/bip32@1.1.5':
......@@ -7727,12 +6850,6 @@ snapshots:
'@noble/hashes': 1.3.2
'@scure/base': 1.1.3
'@scure/bip32@1.3.2':
dependencies:
'@noble/curves': 1.2.0
'@noble/hashes': 1.3.2
'@scure/base': 1.1.3
'@scure/bip39@1.1.1':
dependencies:
'@noble/hashes': 1.2.0
......@@ -7956,8 +7073,6 @@ snapshots:
dependencies:
'@types/ms': 0.7.31
'@types/estree@1.0.5': {}
'@types/express-serve-static-core@4.17.35':
dependencies:
'@types/node': 20.11.17
......@@ -8061,15 +7176,8 @@ snapshots:
dependencies:
'@sinonjs/fake-timers': 7.1.2
'@types/underscore@1.11.3': {}
'@types/unist@2.0.6': {}
'@types/web3@1.0.19':
dependencies:
'@types/bn.js': 5.1.0
'@types/underscore': 1.11.3
'@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.4.5))(eslint@8.56.0)(typescript@5.4.5)':
dependencies:
'@eslint-community/regexpp': 4.6.2
......@@ -8158,35 +7266,6 @@ snapshots:
'@ungap/structured-clone@1.2.0': {}
'@vitest/expect@1.2.2':
dependencies:
'@vitest/spy': 1.2.2
'@vitest/utils': 1.2.2
chai: 4.3.10
'@vitest/runner@1.2.2':
dependencies:
'@vitest/utils': 1.2.2
p-limit: 5.0.0
pathe: 1.1.1
'@vitest/snapshot@1.2.2':
dependencies:
magic-string: 0.30.5
pathe: 1.1.1
pretty-format: 29.7.0
'@vitest/spy@1.2.2':
dependencies:
tinyspy: 2.2.0
'@vitest/utils@1.2.2':
dependencies:
diff-sequences: 29.6.3
estree-walker: 3.0.3
loupe: 2.3.7
pretty-format: 29.7.0
'@vue/compiler-core@3.3.4':
dependencies:
'@babel/parser': 7.23.6
......@@ -8238,11 +7317,6 @@ snapshots:
dependencies:
argparse: 2.0.1
abitype@1.0.0(typescript@5.4.5)(zod@3.22.4):
optionalDependencies:
typescript: 5.4.5
zod: 3.22.4
abort-controller@3.0.0:
dependencies:
event-target-shim: 5.0.1
......@@ -8274,8 +7348,6 @@ snapshots:
acorn-walk@8.3.0: {}
acorn-walk@8.3.2: {}
acorn@8.10.0: {}
adm-zip@0.4.16: {}
......@@ -8288,13 +7360,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
agent-base@7.1.0:
dependencies:
debug: 4.3.4(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
optional: true
aggregate-error@3.1.0:
dependencies:
clean-stack: 2.2.0
......@@ -8347,8 +7412,6 @@ snapshots:
ansi-styles@6.2.1: {}
any-promise@1.3.0: {}
anymatch@3.1.3:
dependencies:
normalize-path: 3.0.0
......@@ -8673,19 +7736,12 @@ snapshots:
builtin-modules@3.3.0: {}
bundle-require@4.0.1(esbuild@0.19.7):
dependencies:
esbuild: 0.19.7
load-tsconfig: 0.2.5
busboy@1.6.0:
dependencies:
streamsearch: 1.1.0
bytes@3.1.2: {}
cac@6.7.14: {}
caching-transform@4.0.0:
dependencies:
hasha: 5.2.2
......@@ -8880,8 +7936,6 @@ snapshots:
commander@3.0.2: {}
commander@4.1.1: {}
commander@8.3.0: {}
comment-parser@1.4.1: {}
......@@ -8896,10 +7950,6 @@ snapshots:
content-type@1.0.5: {}
convert-source-map@1.8.0:
dependencies:
safe-buffer: 5.1.2
convert-source-map@1.9.0: {}
cookie-signature@1.0.6: {}
......@@ -8959,11 +8009,6 @@ snapshots:
crypto-js@4.2.0: {}
cssstyle@4.0.1:
dependencies:
rrweb-cssom: 0.6.0
optional: true
csv-generate@3.4.3: {}
csv-parse@4.16.3: {}
......@@ -8981,12 +8026,6 @@ snapshots:
dependencies:
assert-plus: 1.0.0
data-urls@5.0.0:
dependencies:
whatwg-mimetype: 4.0.0
whatwg-url: 14.0.0
optional: true
dataloader@1.4.0: {}
dateformat@4.5.1: {}
......@@ -9014,9 +8053,6 @@ snapshots:
decamelize@4.0.0: {}
decimal.js@10.4.3:
optional: true
deep-eql@4.1.3:
dependencies:
type-detect: 4.0.8
......@@ -9207,9 +8243,6 @@ snapshots:
entities@3.0.1: {}
entities@4.5.0:
optional: true
env-paths@2.2.1: {}
envalid@8.0.0:
......@@ -9327,31 +8360,6 @@ snapshots:
'@esbuild/win32-ia32': 0.19.10
'@esbuild/win32-x64': 0.19.10
esbuild@0.19.7:
optionalDependencies:
'@esbuild/android-arm': 0.19.7
'@esbuild/android-arm64': 0.19.7
'@esbuild/android-x64': 0.19.7
'@esbuild/darwin-arm64': 0.19.7
'@esbuild/darwin-x64': 0.19.7
'@esbuild/freebsd-arm64': 0.19.7
'@esbuild/freebsd-x64': 0.19.7
'@esbuild/linux-arm': 0.19.7
'@esbuild/linux-arm64': 0.19.7
'@esbuild/linux-ia32': 0.19.7
'@esbuild/linux-loong64': 0.19.7
'@esbuild/linux-mips64el': 0.19.7
'@esbuild/linux-ppc64': 0.19.7
'@esbuild/linux-riscv64': 0.19.7
'@esbuild/linux-s390x': 0.19.7
'@esbuild/linux-x64': 0.19.7
'@esbuild/netbsd-x64': 0.19.7
'@esbuild/openbsd-x64': 0.19.7
'@esbuild/sunos-x64': 0.19.7
'@esbuild/win32-arm64': 0.19.7
'@esbuild/win32-ia32': 0.19.7
'@esbuild/win32-x64': 0.19.7
escalade@3.1.1: {}
escape-html@1.0.3: {}
......@@ -9590,10 +8598,6 @@ snapshots:
estree-walker@2.0.2: {}
estree-walker@3.0.3:
dependencies:
'@types/estree': 1.0.5
esutils@2.0.3: {}
etag@1.8.1: {}
......@@ -9746,18 +8750,6 @@ snapshots:
md5.js: 1.3.5
safe-buffer: 5.2.1
execa@5.1.1:
dependencies:
cross-spawn: 7.0.3
get-stream: 6.0.1
human-signals: 2.1.0
is-stream: 2.0.1
merge-stream: 2.0.0
npm-run-path: 4.0.1
onetime: 5.1.2
signal-exit: 3.0.7
strip-final-newline: 2.0.0
execa@8.0.1:
dependencies:
cross-spawn: 7.0.3
......@@ -10068,8 +9060,6 @@ snapshots:
get-package-type@0.1.0: {}
get-stream@6.0.1: {}
get-stream@8.0.1: {}
get-symbol-description@1.0.0:
......@@ -10101,15 +9091,6 @@ snapshots:
minipass: 7.0.3
path-scurry: 1.10.1
glob@7.1.6:
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
glob@7.1.7:
dependencies:
fs.realpath: 1.0.0
......@@ -10337,11 +9318,6 @@ snapshots:
hosted-git-info@2.8.9: {}
html-encoding-sniffer@4.0.0:
dependencies:
whatwg-encoding: 3.1.1
optional: true
html-escaper@2.0.2: {}
htmlparser2@7.2.0:
......@@ -10359,14 +9335,6 @@ snapshots:
statuses: 2.0.1
toidentifier: 1.0.1
http-proxy-agent@7.0.0:
dependencies:
agent-base: 7.1.0
debug: 4.3.4(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
optional: true
http-signature@1.2.0:
dependencies:
assert-plus: 1.0.0
......@@ -10380,18 +9348,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
https-proxy-agent@7.0.2:
dependencies:
agent-base: 7.1.0
debug: 4.3.4(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
optional: true
human-id@1.0.2: {}
human-signals@2.1.0: {}
human-signals@5.0.0: {}
husky@9.0.10: {}
......@@ -10400,11 +9358,6 @@ snapshots:
dependencies:
safer-buffer: 2.1.2
iconv-lite@0.6.3:
dependencies:
safer-buffer: 2.1.2
optional: true
idna-uts46-hx@2.3.1:
dependencies:
punycode: 2.1.0
......@@ -10557,9 +9510,6 @@ snapshots:
is-plain-obj@2.1.0: {}
is-potential-custom-element-name@1.0.1:
optional: true
is-regex@1.1.4:
dependencies:
call-bind: 1.0.2
......@@ -10620,21 +9570,8 @@ snapshots:
isexe@2.0.0: {}
isomorphic-fetch@3.0.0:
dependencies:
node-fetch: 2.6.12
whatwg-fetch: 3.6.17
transitivePeerDependencies:
- encoding
isows@1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.7)):
dependencies:
ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.7)
isstream@0.1.2: {}
istanbul-lib-coverage@3.0.0: {}
istanbul-lib-coverage@3.2.2: {}
istanbul-lib-hook@3.0.0:
......@@ -10660,12 +9597,6 @@ snapshots:
rimraf: 3.0.2
uuid: 3.4.0
istanbul-lib-report@3.0.0:
dependencies:
istanbul-lib-coverage: 3.2.2
make-dir: 3.1.0
supports-color: 7.2.0
istanbul-lib-report@3.0.1:
dependencies:
istanbul-lib-coverage: 3.2.2
......@@ -10716,8 +9647,6 @@ snapshots:
'@sideway/formula': 3.0.1
'@sideway/pinpoint': 2.0.0
joycon@3.1.1: {}
js-sdsl@4.4.2: {}
js-sha3@0.5.7: {}
......@@ -10739,35 +9668,6 @@ snapshots:
jsdoc-type-pratt-parser@4.0.0: {}
jsdom@24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.7):
dependencies:
cssstyle: 4.0.1
data-urls: 5.0.0
decimal.js: 10.4.3
form-data: 4.0.0
html-encoding-sniffer: 4.0.0
http-proxy-agent: 7.0.0
https-proxy-agent: 7.0.2
is-potential-custom-element-name: 1.0.1
nwsapi: 2.2.7
parse5: 7.1.2
rrweb-cssom: 0.6.0
saxes: 6.0.0
symbol-tree: 3.2.4
tough-cookie: 4.1.3
w3c-xmlserializer: 5.0.0
webidl-conversions: 7.0.0
whatwg-encoding: 3.1.1
whatwg-mimetype: 4.0.0
whatwg-url: 14.0.0
ws: 8.16.0(bufferutil@4.0.8)(utf-8-validate@5.0.7)
xml-name-validator: 5.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
optional: true
jsesc@0.5.0: {}
jsesc@2.5.2: {}
......@@ -10894,8 +9794,6 @@ snapshots:
prelude-ls: 1.2.1
type-check: 0.4.0
lilconfig@2.1.0: {}
lilconfig@3.0.0: {}
lines-and-columns@1.2.4: {}
......@@ -10934,8 +9832,6 @@ snapshots:
pinkie-promise: 2.0.1
strip-bom: 2.0.0
load-tsconfig@0.2.5: {}
load-yaml-file@0.2.0:
dependencies:
graceful-fs: 4.2.11
......@@ -10943,11 +9839,6 @@ snapshots:
pify: 4.0.1
strip-bom: 3.0.0
local-pkg@0.5.0:
dependencies:
mlly: 1.4.2
pkg-types: 1.0.3
locate-path@2.0.0:
dependencies:
p-locate: 2.0.0
......@@ -10969,8 +9860,6 @@ snapshots:
lodash.merge@4.6.2: {}
lodash.sortby@4.7.0: {}
lodash.startcase@4.4.0: {}
lodash@4.17.21: {}
......@@ -11303,13 +10192,6 @@ snapshots:
mkdirp@1.0.4: {}
mlly@1.4.2:
dependencies:
acorn: 8.10.0
pathe: 1.1.1
pkg-types: 1.0.3
ufo: 1.3.2
mnemonist@0.38.3:
dependencies:
obliterator: 1.6.1
......@@ -11368,12 +10250,6 @@ snapshots:
fmix: 0.1.0
imul: 1.0.1
mz@2.7.0:
dependencies:
any-promise: 1.3.0
object-assign: 4.1.1
thenify-all: 1.6.0
nanoid@3.3.3: {}
nanoid@3.3.7: {}
......@@ -11425,9 +10301,6 @@ snapshots:
bn.js: 4.11.6
strip-hex-prefix: 1.0.0
nwsapi@2.2.7:
optional: true
nx-cloud@18.0.0:
dependencies:
'@nrwl/nx-cloud': 18.0.0
......@@ -11499,18 +10372,18 @@ snapshots:
'@istanbuljs/load-nyc-config': 1.1.0
'@istanbuljs/schema': 0.1.3
caching-transform: 4.0.0
convert-source-map: 1.8.0
convert-source-map: 1.9.0
decamelize: 1.2.0
find-cache-dir: 3.3.2
find-up: 4.1.0
foreground-child: 2.0.0
get-package-type: 0.1.0
glob: 7.2.3
istanbul-lib-coverage: 3.0.0
istanbul-lib-coverage: 3.2.2
istanbul-lib-hook: 3.0.0
istanbul-lib-instrument: 4.0.3
istanbul-lib-processinfo: 2.0.2
istanbul-lib-report: 3.0.0
istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 4.0.0
istanbul-reports: 3.0.2
make-dir: 3.1.0
......@@ -11661,10 +10534,6 @@ snapshots:
dependencies:
yocto-queue: 0.1.0
p-limit@5.0.0:
dependencies:
yocto-queue: 1.0.0
p-locate@2.0.0:
dependencies:
p-limit: 1.3.0
......@@ -11724,11 +10593,6 @@ snapshots:
parse-passwd@1.0.0: {}
parse5@7.1.2:
dependencies:
entities: 4.5.0
optional: true
parseurl@1.3.3: {}
path-browserify@1.0.1: {}
......@@ -11764,8 +10628,6 @@ snapshots:
path-type@4.0.0: {}
pathe@1.1.1: {}
pathval@1.1.1: {}
pbkdf2@3.1.2:
......@@ -11848,32 +10710,16 @@ snapshots:
sonic-boom: 3.7.0
thread-stream: 2.4.0
pirates@4.0.6: {}
pkg-dir@4.2.0:
dependencies:
find-up: 4.1.0
pkg-types@1.0.3:
dependencies:
jsonc-parser: 3.2.0
mlly: 1.4.2
pathe: 1.1.1
please-upgrade-node@3.2.0:
dependencies:
semver-compare: 1.0.0
pluralize@8.0.0: {}
postcss-load-config@4.0.1(postcss@8.4.35)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5)):
dependencies:
lilconfig: 2.1.0
yaml: 2.3.4
optionalDependencies:
postcss: 8.4.35
ts-node: 10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5)
postcss@8.4.35:
dependencies:
nanoid: 3.3.7
......@@ -11961,9 +10807,6 @@ snapshots:
qs@6.5.3: {}
querystringify@2.2.0:
optional: true
queue-microtask@1.2.3: {}
quick-format-unescaped@4.0.4: {}
......@@ -12138,9 +10981,6 @@ snapshots:
require-package-name@2.0.1: {}
requires-port@1.0.0:
optional: true
resolve-dir@1.0.1:
dependencies:
expand-tilde: 2.0.2
......@@ -12213,25 +11053,6 @@ snapshots:
dependencies:
bn.js: 5.2.1
rollup@4.5.1:
optionalDependencies:
'@rollup/rollup-android-arm-eabi': 4.5.1
'@rollup/rollup-android-arm64': 4.5.1
'@rollup/rollup-darwin-arm64': 4.5.1
'@rollup/rollup-darwin-x64': 4.5.1
'@rollup/rollup-linux-arm-gnueabihf': 4.5.1
'@rollup/rollup-linux-arm64-gnu': 4.5.1
'@rollup/rollup-linux-arm64-musl': 4.5.1
'@rollup/rollup-linux-x64-gnu': 4.5.1
'@rollup/rollup-linux-x64-musl': 4.5.1
'@rollup/rollup-win32-arm64-msvc': 4.5.1
'@rollup/rollup-win32-ia32-msvc': 4.5.1
'@rollup/rollup-win32-x64-msvc': 4.5.1
fsevents: 2.3.3
rrweb-cssom@0.6.0:
optional: true
run-parallel@1.2.0:
dependencies:
queue-microtask: 1.2.3
......@@ -12269,11 +11090,6 @@ snapshots:
safer-buffer@2.1.2: {}
saxes@6.0.0:
dependencies:
xmlchars: 2.2.0
optional: true
scrypt-js@3.0.1: {}
secp256k1@4.0.3:
......@@ -12363,8 +11179,6 @@ snapshots:
get-intrinsic: 1.2.1
object-inspect: 1.12.3
siginfo@2.0.0: {}
signal-exit@3.0.7: {}
signal-exit@4.1.0: {}
......@@ -12441,10 +11255,6 @@ snapshots:
source-map@0.6.1: {}
source-map@0.8.0-beta.0:
dependencies:
whatwg-url: 7.1.0
spawn-wrap@2.0.0:
dependencies:
foreground-child: 2.0.0
......@@ -12498,16 +11308,12 @@ snapshots:
safer-buffer: 2.1.2
tweetnacl: 0.14.5
stackback@0.0.2: {}
stacktrace-parser@0.1.10:
dependencies:
type-fest: 0.7.1
statuses@2.0.1: {}
std-env@3.6.0: {}
stream-shift@1.0.1: {}
stream-transform@2.1.3:
......@@ -12597,8 +11403,6 @@ snapshots:
strip-bom@4.0.0: {}
strip-final-newline@2.0.0: {}
strip-final-newline@3.0.0: {}
strip-hex-prefix@1.0.0:
......@@ -12611,26 +11415,12 @@ snapshots:
strip-json-comments@3.1.1: {}
strip-literal@1.3.0:
dependencies:
acorn: 8.10.0
strong-log-transformer@2.1.0:
dependencies:
duplexer: 0.1.2
minimist: 1.2.8
through: 2.3.8
sucrase@3.34.0:
dependencies:
'@jridgewell/gen-mapping': 0.3.3
commander: 4.1.1
glob: 7.1.6
lines-and-columns: 1.2.4
mz: 2.7.0
pirates: 4.0.6
ts-interface-checker: 0.1.13
supports-color@5.5.0:
dependencies:
has-flag: 3.0.0
......@@ -12645,9 +11435,6 @@ snapshots:
supports-preserve-symlinks-flag@1.0.0: {}
symbol-tree@3.2.4:
optional: true
table-layout@1.0.2:
dependencies:
array-back: 4.0.2
......@@ -12678,14 +11465,6 @@ snapshots:
term-size@2.2.1: {}
terser@5.26.0:
dependencies:
'@jridgewell/source-map': 0.3.5
acorn: 8.10.0
commander: 2.20.3
source-map-support: 0.5.21
optional: true
test-exclude@6.0.0:
dependencies:
'@istanbuljs/schema': 0.1.3
......@@ -12696,14 +11475,6 @@ snapshots:
text-table@0.2.0: {}
thenify-all@1.6.0:
dependencies:
thenify: 3.3.1
thenify@3.3.1:
dependencies:
any-promise: 1.3.0
thread-stream@0.15.2:
dependencies:
real-require: 0.1.0
......@@ -12719,12 +11490,6 @@ snapshots:
through@2.3.8: {}
tinybench@2.5.1: {}
tinypool@0.8.2: {}
tinyspy@2.2.0: {}
tmp@0.0.33:
dependencies:
os-tmpdir: 1.0.2
......@@ -12746,29 +11511,10 @@ snapshots:
psl: 1.9.0
punycode: 2.3.1
tough-cookie@4.1.3:
dependencies:
psl: 1.9.0
punycode: 2.3.1
universalify: 0.2.0
url-parse: 1.5.10
optional: true
tr46@0.0.3: {}
tr46@1.0.1:
dependencies:
punycode: 2.3.1
tr46@5.0.0:
dependencies:
punycode: 2.3.1
optional: true
traverse@0.6.6: {}
tree-kill@1.2.2: {}
treeify@1.1.0: {}
trim-newlines@3.0.1: {}
......@@ -12790,8 +11536,6 @@ snapshots:
dependencies:
typescript: 5.4.5
ts-interface-checker@0.1.13: {}
ts-mocha@10.0.0(mocha@10.2.0):
dependencies:
mocha: 10.2.0
......@@ -12849,30 +11593,6 @@ snapshots:
tsort@0.0.1: {}
tsup@8.0.1(@swc/core@1.4.13)(postcss@8.4.35)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))(typescript@5.4.5):
dependencies:
bundle-require: 4.0.1(esbuild@0.19.7)
cac: 6.7.14
chokidar: 3.5.3
debug: 4.3.4(supports-color@8.1.1)
esbuild: 0.19.7
execa: 5.1.1
globby: 11.1.0
joycon: 3.1.1
postcss-load-config: 4.0.1(postcss@8.4.35)(ts-node@10.9.2(@swc/core@1.4.13)(@types/node@20.11.17)(typescript@5.4.5))
resolve-from: 5.0.0
rollup: 4.5.1
source-map: 0.8.0-beta.0
sucrase: 3.34.0
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.4.13
postcss: 8.4.35
typescript: 5.4.5
transitivePeerDependencies:
- supports-color
- ts-node
tsx@4.7.0:
dependencies:
esbuild: 0.19.10
......@@ -12988,8 +11708,6 @@ snapshots:
typical@5.2.0: {}
ufo@1.3.2: {}
unbox-primitive@1.0.2:
dependencies:
call-bind: 1.0.2
......@@ -13028,9 +11746,6 @@ snapshots:
universalify@0.1.2: {}
universalify@0.2.0:
optional: true
universalify@2.0.0: {}
unpipe@1.0.0: {}
......@@ -13047,12 +11762,6 @@ snapshots:
dependencies:
punycode: 2.3.1
url-parse@1.5.10:
dependencies:
querystringify: 2.2.0
requires-port: 1.0.0
optional: true
url-value-parser@2.0.3: {}
url@0.11.1:
......@@ -13102,104 +11811,10 @@ snapshots:
unist-util-stringify-position: 2.0.3
vfile-message: 2.0.4
viem@2.8.13(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.7)(zod@3.22.4):
dependencies:
'@adraffy/ens-normalize': 1.10.0
'@noble/curves': 1.2.0
'@noble/hashes': 1.3.2
'@scure/bip32': 1.3.2
'@scure/bip39': 1.2.1
abitype: 1.0.0(typescript@5.4.5)(zod@3.22.4)
isows: 1.0.3(ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.7))
ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.7)
optionalDependencies:
typescript: 5.4.5
transitivePeerDependencies:
- bufferutil
- utf-8-validate
- zod
vite-node@1.2.2(@types/node@20.11.17)(terser@5.26.0):
dependencies:
cac: 6.7.14
debug: 4.3.4(supports-color@8.1.1)
pathe: 1.1.1
picocolors: 1.0.0
vite: 5.1.7(@types/node@20.11.17)(terser@5.26.0)
transitivePeerDependencies:
- '@types/node'
- less
- lightningcss
- sass
- stylus
- sugarss
- supports-color
- terser
vite@5.1.5(@types/node@20.11.17)(terser@5.26.0):
dependencies:
esbuild: 0.19.10
postcss: 8.4.35
rollup: 4.5.1
optionalDependencies:
'@types/node': 20.11.17
fsevents: 2.3.3
terser: 5.26.0
vite@5.1.7(@types/node@20.11.17)(terser@5.26.0):
dependencies:
esbuild: 0.19.10
postcss: 8.4.35
rollup: 4.5.1
optionalDependencies:
'@types/node': 20.11.17
fsevents: 2.3.3
terser: 5.26.0
vitest@1.2.2(@types/node@20.11.17)(jsdom@24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.7))(terser@5.26.0):
dependencies:
'@vitest/expect': 1.2.2
'@vitest/runner': 1.2.2
'@vitest/snapshot': 1.2.2
'@vitest/spy': 1.2.2
'@vitest/utils': 1.2.2
acorn-walk: 8.3.2
cac: 6.7.14
chai: 4.3.10
debug: 4.3.4(supports-color@8.1.1)
execa: 8.0.1
local-pkg: 0.5.0
magic-string: 0.30.5
pathe: 1.1.1
picocolors: 1.0.0
std-env: 3.6.0
strip-literal: 1.3.0
tinybench: 2.5.1
tinypool: 0.8.2
vite: 5.1.5(@types/node@20.11.17)(terser@5.26.0)
vite-node: 1.2.2(@types/node@20.11.17)(terser@5.26.0)
why-is-node-running: 2.2.2
optionalDependencies:
'@types/node': 20.11.17
jsdom: 24.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.7)
transitivePeerDependencies:
- less
- lightningcss
- sass
- stylus
- sugarss
- supports-color
- terser
vscode-oniguruma@1.7.0: {}
vscode-textmate@8.0.0: {}
w3c-xmlserializer@5.0.0:
dependencies:
xml-name-validator: 5.0.0
optional: true
wait-on@7.2.0:
dependencies:
axios: 1.6.7
......@@ -13227,38 +11842,11 @@ snapshots:
webidl-conversions@3.0.1: {}
webidl-conversions@4.0.2: {}
webidl-conversions@7.0.0:
optional: true
whatwg-encoding@3.1.1:
dependencies:
iconv-lite: 0.6.3
optional: true
whatwg-fetch@3.6.17: {}
whatwg-mimetype@4.0.0:
optional: true
whatwg-url@14.0.0:
dependencies:
tr46: 5.0.0
webidl-conversions: 7.0.0
optional: true
whatwg-url@5.0.0:
dependencies:
tr46: 0.0.3
webidl-conversions: 3.0.1
whatwg-url@7.1.0:
dependencies:
lodash.sortby: 4.7.0
tr46: 1.0.1
webidl-conversions: 4.0.2
which-boxed-primitive@1.0.2:
dependencies:
is-bigint: 1.0.4
......@@ -13314,11 +11902,6 @@ snapshots:
dependencies:
isexe: 2.0.0
why-is-node-running@2.2.2:
dependencies:
siginfo: 2.0.0
stackback: 0.0.2
widest-line@3.1.0:
dependencies:
string-width: 4.2.3
......@@ -13380,23 +11963,6 @@ snapshots:
bufferutil: 4.0.8
utf-8-validate: 5.0.7
ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.7):
optionalDependencies:
bufferutil: 4.0.8
utf-8-validate: 5.0.7
ws@8.16.0(bufferutil@4.0.8)(utf-8-validate@5.0.7):
optionalDependencies:
bufferutil: 4.0.8
utf-8-validate: 5.0.7
optional: true
xml-name-validator@5.0.0:
optional: true
xmlchars@2.2.0:
optional: true
xtend@4.0.2: {}
y18n@3.2.2: {}
......@@ -13495,12 +12061,8 @@ snapshots:
yocto-queue@0.1.0: {}
yocto-queue@1.0.0: {}
zksync-ethers@5.6.0(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)):
dependencies:
ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.7)
zod@3.22.4: {}
zwitch@1.0.5: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment