From 203a7e50706c4efca3d672b1bffc535d70837ce5 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 12 Dec 2024 15:13:31 +0100 Subject: [PATCH 1/2] read queue length from storage for consolidations & withdrawal submissions --- .../ConsolidationReview.tsx | 13 ++++++------- .../SubmitWithdrawalsForm/WithdrawalReview.tsx | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ui-package/src/components/SubmitConsolidationsForm/ConsolidationReview.tsx b/ui-package/src/components/SubmitConsolidationsForm/ConsolidationReview.tsx index 67a4d329..1e777b58 100644 --- a/ui-package/src/components/SubmitConsolidationsForm/ConsolidationReview.tsx +++ b/ui-package/src/components/SubmitConsolidationsForm/ConsolidationReview.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useAccount, useSendTransaction } from 'wagmi'; -import { useCall } from 'wagmi' +import { useStorageAt } from 'wagmi' import { useState } from 'react'; import { IValidator } from './SubmitConsolidationsFormProps'; import { toReadableAmount } from '../../utils/ReadableAmount'; @@ -18,11 +18,10 @@ const ConsolidationReview = (props: IConsolidationReviewProps) => { const [addExtraFee, setAddExtraFee] = useState(true); const [errorModal, setErrorModal] = useState(null); - const consolidationQueueLengthCall = useCall({ - account: address, - to: props.consolidationContract, - data: "0x", - chain: chain, + const consolidationQueueLengthCall = useStorageAt({ + address: props.consolidationContract as `0x${string}`, + slot: "0x00", + chainId: chain?.id, }); const submitRequest = useSendTransaction(); @@ -41,7 +40,7 @@ const ConsolidationReview = (props: IConsolidationReviewProps) => { let requestFee = 0n; let failedQueueLength = false; if (consolidationQueueLengthCall.isFetched && consolidationQueueLengthCall.data) { - var queueLenHex = consolidationQueueLengthCall.data.data as string; + var queueLenHex = consolidationQueueLengthCall.data as string; if (!queueLenHex) { failedQueueLength = true; } else if (queueLenHex == "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") { diff --git a/ui-package/src/components/SubmitWithdrawalsForm/WithdrawalReview.tsx b/ui-package/src/components/SubmitWithdrawalsForm/WithdrawalReview.tsx index 6c376e35..f7723b2c 100644 --- a/ui-package/src/components/SubmitWithdrawalsForm/WithdrawalReview.tsx +++ b/ui-package/src/components/SubmitWithdrawalsForm/WithdrawalReview.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useAccount, useSendTransaction } from 'wagmi'; -import { useCall } from 'wagmi' +import { useStorageAt } from 'wagmi' import { useState } from 'react'; import { IValidator } from './SubmitWithdrawalsFormProps'; import { toReadableAmount } from '../../utils/ReadableAmount'; @@ -18,11 +18,10 @@ const WithdrawalReview = (props: IWithdrawalReviewProps) => { const [addExtraFee, setAddExtraFee] = useState(true); const [errorModal, setErrorModal] = useState(null); - const withdrawalQueueLengthCall = useCall({ - account: address, - to: props.withdrawalContract, - data: "0x", - chain: chain, + const withdrawalQueueLengthCall = useStorageAt({ + address: props.withdrawalContract as `0x${string}`, + slot: "0x00", + chainId: chain?.id, }); const submitRequest = useSendTransaction(); @@ -41,7 +40,7 @@ const WithdrawalReview = (props: IWithdrawalReviewProps) => { let requestFee = 0n; let failedQueueLength = false; if (withdrawalQueueLengthCall.isFetched && withdrawalQueueLengthCall.data) { - var queueLenHex = withdrawalQueueLengthCall.data.data as string; + var queueLenHex = withdrawalQueueLengthCall.data as string; if (!queueLenHex) { failedQueueLength = true; } else if (queueLenHex == "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") { From a925345491f092df4bc781cae9dde1708ccce449 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 12 Dec 2024 15:15:08 +0100 Subject: [PATCH 2/2] update system contract addresses for devnet 5 --- indexer/execution/consolidation_indexer.go | 2 +- indexer/execution/withdrawal_indexer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indexer/execution/consolidation_indexer.go b/indexer/execution/consolidation_indexer.go index 4f542946..dc778328 100644 --- a/indexer/execution/consolidation_indexer.go +++ b/indexer/execution/consolidation_indexer.go @@ -17,7 +17,7 @@ import ( "github.com/ethpandaops/dora/utils" ) -const ConsolidationContractAddr = "0x01aBEa29659e5e97C95107F20bb753cD3e09bBBb" +const ConsolidationContractAddr = "0x00431F263cE400f4455c2dCf564e53007Ca4bbBb" // ConsolidationIndexer is the indexer for the eip-7251 consolidation system contract type ConsolidationIndexer struct { diff --git a/indexer/execution/withdrawal_indexer.go b/indexer/execution/withdrawal_indexer.go index 3f587849..9f629e3e 100644 --- a/indexer/execution/withdrawal_indexer.go +++ b/indexer/execution/withdrawal_indexer.go @@ -18,7 +18,7 @@ import ( "github.com/ethpandaops/dora/utils" ) -const WithdrawalContractAddr = "0x09Fc772D0857550724b07B850a4323f39112aAaA" +const WithdrawalContractAddr = "0x0c15F14308530b7CDB8460094BbB9cC28b9AaaAA" // WithdrawalIndexer is the indexer for the eip-7002 consolidation system contract type WithdrawalIndexer struct {