Skip to content

Commit

Permalink
Merge pull request #376 from SocketDotTech/fix/opt-withdrawal
Browse files Browse the repository at this point in the history
Fix/opt withdrawal
  • Loading branch information
ameeshaagrawal authored Jun 6, 2024
2 parents ee95bb9 + a7c38dd commit 5479131
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@arbitrum/sdk": "^3.1.13",
"@aws-sdk/client-s3": "^3.465.0",
"@eth-optimism/sdk": "^3.2.0",
"@eth-optimism/sdk": "^3.2.3",
"@ethersproject/bytes": "^5.7.0",
"@fxportal/maticjs-fxportal": "^1.1.1",
"@maticnetwork/maticjs": "^3.5.0",
Expand Down
17 changes: 8 additions & 9 deletions scripts/native-bridge-helpers/optimism/l2tol1Relay.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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) => {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2197,10 +2197,10 @@
ethers "^5.7.2"
node-fetch "^2.6.7"

"@eth-optimism/sdk@^3.2.0":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@eth-optimism/sdk/-/sdk-3.2.2.tgz#732c2d6fde96a25303b3c5b39b3b3ed1f913d9aa"
integrity sha512-P8YXAlh2lun0KZlwrw4FqmK4kNIoOOzI816XXhfkW3nMVADGRAru3TKSM74MgmEuyGiHrA9EoPRq1WLqUX4B0w==
"@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.17.1"
Expand Down Expand Up @@ -11343,7 +11343,7 @@ semver@^7.3.8:
dependencies:
lru-cache "^6.0.0"

semver@^7.5.4, semver@^7.6.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==
Expand Down

0 comments on commit 5479131

Please sign in to comment.