Skip to content

Commit

Permalink
Merge pull request #193 from ethpandaops/pk910/queue-length-from-storage
Browse files Browse the repository at this point in the history
read queue length from storage and update system contract addresses for devnet 5
  • Loading branch information
pk910 authored Dec 17, 2024
2 parents 231d62b + a925345 commit 65a7268
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion indexer/execution/consolidation_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion indexer/execution/withdrawal_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -18,11 +18,10 @@ const ConsolidationReview = (props: IConsolidationReviewProps) => {
const [addExtraFee, setAddExtraFee] = useState(true);
const [errorModal, setErrorModal] = useState<string | null>(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();

Expand All @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -18,11 +18,10 @@ const WithdrawalReview = (props: IWithdrawalReviewProps) => {
const [addExtraFee, setAddExtraFee] = useState(true);
const [errorModal, setErrorModal] = useState<string | null>(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();

Expand All @@ -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") {
Expand Down

0 comments on commit 65a7268

Please sign in to comment.