From 6bf4c38716ffb5585b95ee3b70202534e1483755 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 22 Mar 2024 12:02:57 +0530 Subject: [PATCH 1/2] chore: bump optimism sdk --- package.json | 2 +- yarn.lock | 46 +++++++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 5c56dbd00..41f093f50 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@arbitrum/sdk": "^3.1.13", "@aws-sdk/client-s3": "^3.465.0", - "@eth-optimism/sdk": "^3.1.4", + "@eth-optimism/sdk": "^3.2.3", "@ethersproject/bytes": "^5.7.0", "@fxportal/maticjs-fxportal": "^1.1.1", "@maticnetwork/maticjs": "^3.5.0", diff --git a/yarn.lock b/yarn.lock index 29202fc1b..4d5621a04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -646,10 +646,10 @@ resolved "https://registry.npmjs.org/@ensdomains/resolver/-/resolver-0.2.4.tgz" integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== -"@eth-optimism/contracts-bedrock@0.16.2": - version "0.16.2" - resolved "https://registry.yarnpkg.com/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.16.2.tgz#065ad561c3c8b942e4e0dd3d0ea6ed7e00a0f8f0" - integrity sha512-a2+f7soDbrd6jV74U02EpyMwQt2iZeDZ4c2ZwgkObcxXUZLZQ2ELt/VRFBf8TIL3wYcBOGpUa1aXAE2oHQ7oRA== +"@eth-optimism/contracts-bedrock@0.17.1": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.17.1.tgz#729b1dc53ec23d02ea9e68181f994955129f7415" + integrity sha512-Hc5peN5PM8kzl9dzqSD5jv6ED3QliO1DF0dXLRJxfrXR7/rmEeyuAYESUwUM0gdJZjkwRYiS5m230BI6bQmnlw== "@eth-optimism/contracts@0.6.0": version "0.6.0" @@ -702,17 +702,18 @@ ethers "^5.7.2" node-fetch "^2.6.7" -"@eth-optimism/sdk@^3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@eth-optimism/sdk/-/sdk-3.1.4.tgz#96f5573ace11a727e3e1beaa8c526527711a58ed" - integrity sha512-gqbw/7KAwXSiFF7KN57oe3iz0kcOuSUTfnkAf0aZImmSbegPY5AWszxYvnQCIXcWRY0kaDf3LpXrHKur4TdgGA== +"@eth-optimism/sdk@^3.2.3": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@eth-optimism/sdk/-/sdk-3.2.3.tgz#42aa99ed388355ec85b5cf68589aaa15f0c6c7f6" + integrity sha512-e3XQTbbU+HTzsEv/VIsJpZifK6YZVlzEtF6tj/Vz/VIEDCjZk5JPcnCQOMVcs9ICI4EJyyur+y/+RU7fPa6qtg== dependencies: "@eth-optimism/contracts" "0.6.0" - "@eth-optimism/contracts-bedrock" "0.16.2" + "@eth-optimism/contracts-bedrock" "0.17.1" "@eth-optimism/core-utils" "0.13.1" lodash "^4.17.21" - merkletreejs "^0.3.10" + merkletreejs "^0.3.11" rlp "^2.2.7" + semver "^7.6.0" "@ethereum-waffle/chai@^3.4.4": version "3.4.4" @@ -4122,10 +4123,10 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@^3.1.9-1: - version "3.3.0" - resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz" - integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== +crypto-js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== d@1, d@^1.0.1: version "1.0.1" @@ -7121,14 +7122,14 @@ merkle-patricia-tree@^4.2.4: readable-stream "^3.6.0" semaphore-async-await "^1.5.1" -merkletreejs@^0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.10.tgz#b9abdfc5e3aadaf9eb8b0a35c4b87aea33f5d4b7" - integrity sha512-lin42tKfRdkW+6iE5pjtQ9BnH+1Hk3sJ5Fn9hUUSjcXRcJbSISHgPCfYvMNEXiNqZPhz/TyRPEV30qgnujsQ7A== +merkletreejs@^0.3.11: + version "0.3.11" + resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.3.11.tgz#e0de05c3ca1fd368de05a12cb8efb954ef6fc04f" + integrity sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ== dependencies: bignumber.js "^9.0.1" buffer-reverse "^1.0.1" - crypto-js "^3.1.9-1" + crypto-js "^4.2.0" treeify "^1.1.0" web3-utils "^1.3.4" @@ -8493,6 +8494,13 @@ semver@^7.3.8: dependencies: lru-cache "^6.0.0" +semver@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + semver@~5.4.1: version "5.4.1" resolved "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz" From d61161550867efd54ae4b6a2fd37c5b979fe262b Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 22 Mar 2024 12:03:13 +0530 Subject: [PATCH 2/2] fix: op withdrawal --- .../optimism/l2tol1Relay.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts b/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts index 39069d080..dd348703f 100644 --- a/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts +++ b/scripts/native-bridge-helpers/optimism/l2tol1Relay.ts @@ -1,26 +1,24 @@ import { providers, Wallet } from "ethers"; import { CrossChainMessenger, MessageStatus } from "@eth-optimism/sdk"; import { getJsonRpcUrl } from "../../constants"; -import { ChainKey } from "../../../src"; +import { HardhatChainName, ChainId } from "../../../src"; // get providers for source and destination -const localChain = ChainKey.GOERLI; -const remoteChain = ChainKey.OPTIMISM_GOERLI; +const l1ChainId = ChainId.SEPOLIA; +const l2ChainId = ChainId.OPTIMISM_SEPOLIA; const walletPrivateKey = process.env.SOCKET_SIGNER_KEY!; -const l1Provider = new providers.JsonRpcProvider(getJsonRpcUrl(localChain)); +const l1Provider = new providers.JsonRpcProvider(getJsonRpcUrl(l1ChainId)); const l1Wallet = new Wallet(walletPrivateKey, l1Provider); const sealTxHash = ""; export const main = async () => { const crossChainMessenger = new CrossChainMessenger({ - l1ChainId: 5, - l2ChainId: 420, + l1ChainId, + l2ChainId, l1SignerOrProvider: l1Wallet, - l2SignerOrProvider: new providers.JsonRpcProvider( - getJsonRpcUrl(remoteChain) - ), + l2SignerOrProvider: new providers.JsonRpcProvider(getJsonRpcUrl(l2ChainId)), }); const status = await crossChainMessenger.getMessageStatus(sealTxHash); @@ -40,6 +38,7 @@ export const main = async () => { } }; +// npx ts-node scripts/native-bridge-helpers/optimism/l2tol1Relay.ts main() .then(() => process.exit(0)) .catch((error: Error) => {