Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrower95 committed Dec 16, 2024
1 parent dd3928f commit c9089e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 8 additions & 3 deletions cli/core/findStalePods.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,20 @@ func isEigenpod(eth *ethclient.Client, chainId uint64, eigenpodAddress string) (

dmAddress, err := podMan.DelegationManager(nil)
if err != nil {
return false, fmt.Errorf("failed to reach delegationManager: %w", err)
return false, fmt.Errorf("failed to read delegationManager: %w", err)
}

dm, err := DelegationManager.NewDelegationManager(dmAddress, eth)
if err != nil {
return false, fmt.Errorf("failed to reach delegationManager: %w", err)
}

// TODO: are we looking for an aggregate sum here?
// TODO: is this computation correct?
_, podOwnerShares, err := dm.GetDepositedShares(nil, owner)
if err != nil {
return false, fmt.Errorf("PodOwnerShares() failed: %s", err.Error())
}
totalPodOwnerShares := utils.BigSum(podOwnerShares)

balance, err := eth.BalanceAt(context.Background(), common.HexToAddress(eigenpodAddress), nil)
if err != nil {
Expand All @@ -124,7 +129,7 @@ func isEigenpod(eth *ethclient.Client, chainId uint64, eigenpodAddress string) (
// Simulate fetching from contracts
// Implement contract fetching logic here
cache.PodOwnerShares[eigenpodAddress] = PodOwnerShare{
SharesWei: podOwnerShares[0],
SharesWei: totalPodOwnerShares,
ExecutionLayerBalanceWei: balance,
IsEigenpod: true,
}
Expand Down
9 changes: 6 additions & 3 deletions cli/core/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/DelegationManager"
"github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod"
"github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPodManager"
"github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils"
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/phase0"
gethCommon "github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -155,9 +156,11 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
_, shares, err := delegationManager.GetDepositedShares(nil, eigenPodOwner)
PanicOnError("failed to load owner shares", err)

// TODO: finish computation based on shares/strategies. (this is wrong)
currentOwnerSharesETH := IweiToEther(shares[0])
currentOwnerSharesWei := shares[0]
totalDepositedShares := utils.BigSum(shares)

// TODO: is this calculation correct?
currentOwnerSharesETH := IweiToEther(totalDepositedShares)
currentOwnerSharesWei := totalDepositedShares

withdrawableRestakedExecutionLayerGwei, err := eigenPod.WithdrawableRestakedExecutionLayerGwei(nil)
PanicOnError("failed to fetch withdrawableRestakedExecutionLayerGwei", err)
Expand Down

0 comments on commit c9089e9

Please sign in to comment.