diff --git a/.github/workflows/cli_release.yml b/.github/workflows/cli_release.yml deleted file mode 100644 index 559db094..00000000 --- a/.github/workflows/cli_release.yml +++ /dev/null @@ -1,45 +0,0 @@ -# .github/workflows/release.yml -name: Release CLI Binaries - -on: - pull_request: - push: - # run only against tags - tags: - - "*" - -permissions: - contents: write - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: stable - - name: Run GoReleaser (tagged release) - uses: goreleaser/goreleaser-action@v6 - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} - with: - distribution: goreleaser - version: "~> v2" - args: release --clean - workdir: cli - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Run GoReleaser (branch) - uses: goreleaser/goreleaser-action@v6 - if: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }} - with: - distribution: goreleaser - version: "~> v2" - args: release --snapshot - workdir: cli - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml deleted file mode 100644 index 41500408..00000000 --- a/.github/workflows/go_test.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Run Go Tests - -on: - push: - pull_request: - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: Install dependencies - run: | - go mod download - sudo apt-get install -y unzip - - - name: Download blockchain data - run: | - curl -o data/deneb_holesky_beacon_state_2227472.ssz.zip https://dviu8zszosyat.cloudfront.net/deneb_holesky_beacon_state_2227472.ssz.zip - (cd data && unzip deneb_holesky_beacon_state_2227472.ssz.zip) - - - name: Run tests - run: | - go test -v ./... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 7670221c..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Lint - -on: - push: - branches: - - main - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go 1.22 - uses: actions/setup-go@v1 - env: - GOPATH: /home/runner/.go - with: - go-version: 1.22.4 - - - name: Install dependencies - env: - GOPATH: /home/runner/.go - run: | - mkdir /home/runner/.go - make setup - go env - ls -lar $GOPATH - - - name: Run Lint - env: - GOPATH: /home/runner/.go - run: /home/runner/.go/bin/golangci-lint run ./cli diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 00000000..a1101859 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,97 @@ +# .github/workflows/release.yml +name: Build, test, release + +on: + pull_request: + push: + # run only against tags + tags: + - "*" + +permissions: + contents: write + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go 1.22 + uses: actions/setup-go@v1 + env: + GOPATH: /home/runner/.go + with: + go-version: 1.22.4 + + - name: Install dependencies + env: + GOPATH: /home/runner/.go + run: | + mkdir /home/runner/.go + make setup + go env + ls -lar $GOPATH + + - name: Run Lint + env: + GOPATH: /home/runner/.go + run: /home/runner/.go/bin/golangci-lint run ./cli + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Install dependencies + run: | + go mod download + sudo apt-get install -y unzip + + - name: Download blockchain data + run: | + curl -o data/deneb_holesky_beacon_state_2227472.ssz.zip https://dviu8zszosyat.cloudfront.net/deneb_holesky_beacon_state_2227472.ssz.zip + (cd data && unzip deneb_holesky_beacon_state_2227472.ssz.zip) + + - name: Run tests + run: | + go test -v ./... + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + - name: Run GoReleaser (tagged release) + uses: goreleaser/goreleaser-action@v6 + if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + workdir: cli + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser (branch) + uses: goreleaser/goreleaser-action@v6 + if: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }} + with: + distribution: goreleaser + version: "~> v2" + args: release --snapshot + workdir: cli + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 48b24d48..9463c636 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,7 +12,7 @@ linters-settings: - performance - style govet: - check-shadowing: true + shadow: true enable: - fieldalignment nolintlint: @@ -26,12 +26,11 @@ linters: - dogsled - dupl - errcheck - - exportloopref + - copyloopvar - exhaustive - goconst - gocritic - gofmt - - gomnd - gocyclo - gosec - gosimple diff --git a/cli/commands/assignSubmitter.go b/cli/commands/assignSubmitter.go index 68c9e3ae..a6a2480c 100644 --- a/cli/commands/assignSubmitter.go +++ b/cli/commands/assignSubmitter.go @@ -4,8 +4,8 @@ import ( "context" "fmt" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/fatih/color" @@ -44,7 +44,7 @@ func AssignSubmitterCommand(args TAssignSubmitterArgs) error { return fmt.Errorf("failed to parse --sender: %w", err) } - pod, err := onchain.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) + pod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) if err != nil { return fmt.Errorf("error contacting eigenpod: %w", err) } diff --git a/cli/commands/checkpoint.go b/cli/commands/checkpoint.go index 645a8bc5..04bbce60 100644 --- a/cli/commands/checkpoint.go +++ b/cli/commands/checkpoint.go @@ -3,8 +3,8 @@ package commands import ( "context" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -42,7 +42,7 @@ func CheckpointCommand(args TCheckpointCommandArgs) error { currentCheckpoint, err := core.GetCurrentCheckpoint(args.EigenpodAddress, eth) core.PanicOnError("failed to load checkpoint", err) - eigenpod, err := onchain.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) + eigenpod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) core.PanicOnError("failed to connect to eigenpod", err) if currentCheckpoint == 0 { diff --git a/cli/commands/completeAllWithdrawals.go b/cli/commands/completeAllWithdrawals.go new file mode 100644 index 00000000..9399f0dc --- /dev/null +++ b/cli/commands/completeAllWithdrawals.go @@ -0,0 +1,172 @@ +package commands + +import ( + "context" + "fmt" + "math/big" + + "github.com/pkg/errors" + lo "github.com/samber/lo" + + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/IDelegationManager" + "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/fatih/color" +) + +type TCompleteWithdrawalArgs struct { + EthNode string + EigenPod string + Sender string + EstimateGas bool +} + +func DelegationManager(chainId *big.Int) common.Address { + data := map[uint64]string{ + // TODO(zeus) - make this runnable via zeus. + 1: "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A", // mainnet + 17000: "0x75dfE5B44C2E530568001400D3f704bC8AE350CC", // holesky preprod + } + contract, ok := data[chainId.Uint64()] + if !ok { + panic("no delegation manager found for chain") + } + addr := common.HexToAddress(contract) + return addr +} + +func CompleteAllWithdrawalsCommand(args TCompleteWithdrawalArgs) error { + ctx := context.Background() + + isSimulation := args.EstimateGas + + eth, err := ethclient.DialContext(ctx, args.EthNode) + core.PanicOnError("failed to reach eth node", err) + + chainId, err := eth.ChainID(ctx) + core.PanicOnError("failed to load chainId", err) + + acc, err := core.PrepareAccount(&args.Sender, chainId, isSimulation) + core.PanicOnError("failed to parse private key", err) + + curBlockNumber, err := eth.BlockNumber(ctx) + core.PanicOnError("failed to load current block number", err) + + pod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenPod), eth) + core.PanicOnError("failed to reach eigenpod", err) + + reg, err := pod.WithdrawableRestakedExecutionLayerGwei(nil) + core.PanicOnError("failed to fetch REG", err) + rew := core.GweiToWei(new(big.Float).SetUint64(reg)) + + podOwner, err := pod.PodOwner(nil) + core.PanicOnError("failed to read podOwner", err) + + delegationManager, err := IDelegationManager.NewIDelegationManager(DelegationManager(chainId), eth) + core.PanicOnError("failed to reach delegation manager", err) + + minDelay, err := delegationManager.MinWithdrawalDelayBlocks(nil) + core.PanicOnError("failed to read MinWithdrawalDelayBlocks", err) + + queuedWithdrawals, err := delegationManager.GetQueuedWithdrawals(nil, podOwner) + core.PanicOnError("failed to read queuedWithdrawals", err) + + eligibleWithdrawals := lo.Map(queuedWithdrawals.Withdrawals, func(withdrawal IDelegationManager.IDelegationManagerTypesWithdrawal, index int) *IDelegationManager.IDelegationManagerTypesWithdrawal { + isBeaconWithdrawal := len(withdrawal.Strategies) == 1 && withdrawal.Strategies[0].Cmp(core.BeaconStrategy()) == 0 + isCompletable := curBlockNumber > uint64(withdrawal.StartBlock+minDelay) + if isBeaconWithdrawal && isCompletable { + return &withdrawal + } + return nil + }) + + readyWithdrawalCount := len(lo.Filter(eligibleWithdrawals, func(withdrawal *IDelegationManager.IDelegationManagerTypesWithdrawal, index int) bool { + return withdrawal != nil + })) + + if readyWithdrawalCount == 0 { + fmt.Printf("Your pod has no eligible withdrawals.\n") + return nil + } + + var runningSumWei *big.Float = new(big.Float) + + affordedWithdrawals := lo.Map(eligibleWithdrawals, func(withdrawal *IDelegationManager.IDelegationManagerTypesWithdrawal, index int) *IDelegationManager.IDelegationManagerTypesWithdrawal { + if withdrawal == nil { + return nil + } + withdrawalShares := queuedWithdrawals.Shares[index][0] + // if REW > runningSumWei + withdrawalShares, we can complete with withdrawal. + if rew.Cmp( + new(big.Float).Add( + runningSumWei, + new(big.Float).SetInt(withdrawalShares), + ), + ) > 0 { + runningSumWei = new(big.Float).Add(runningSumWei, new(big.Float).SetInt(withdrawalShares)) + return withdrawal + } + return nil + }) + + affordedWithdrawals = lo.Filter(affordedWithdrawals, func(withdrawal *IDelegationManager.IDelegationManagerTypesWithdrawal, index int) bool { + return withdrawal != nil + }) + + if len(affordedWithdrawals) == 0 && readyWithdrawalCount > 0 { + color.Yellow("WARN: Your pod has %d withdrawal(s) available, but your pod does not have enough funding to proceed.\n", readyWithdrawalCount) + color.Yellow("Consider checkpointing to claim beacon rewards, or depositing ETH and checkpointing to complete these withdrawals.\n\n") + return errors.New("Insufficient funds") + } + + if len(affordedWithdrawals) != readyWithdrawalCount { + color.Yellow("WARN: Your pod has %d withdrawal(s) available, but you only have enough balance to satisfy %d of them.\n", readyWithdrawalCount, len(affordedWithdrawals)) + color.Yellow("Consider checkpointing to claim beacon rewards, or depositing ETH and checkpointing to complete these withdrawals.\n\n") + } + + fmt.Printf("Your podOwner(%s) has %d withdrawal(s) that can be completed right now.\n", podOwner.Hex(), len(affordedWithdrawals)) + runningSumWeiInt, _ := runningSumWei.Int(nil) + fmt.Printf("Total ETH on all withdrawals: %sETH\n", core.GweiToEther(core.WeiToGwei(runningSumWeiInt)).String()) + + if !isSimulation { + core.PanicIfNoConsent("Would you like to continue?") + } else { + color.Yellow("THIS IS A SIMULATION. No transaction will be recorded onchain.\n") + } + + withdrawals := lo.Map(affordedWithdrawals, func(w *IDelegationManager.IDelegationManagerTypesWithdrawal, i int) IDelegationManager.IDelegationManagerTypesWithdrawal { + return *w + }) + + tokens := lo.Map(withdrawals, func(_ IDelegationManager.IDelegationManagerTypesWithdrawal, _ int) []common.Address { + return []common.Address{common.BigToAddress(big.NewInt(0))} + }) + + receiveAsTokens := lo.Map(withdrawals, func(_ IDelegationManager.IDelegationManagerTypesWithdrawal, _ int) bool { + return true + }) + + txn, err := delegationManager.CompleteQueuedWithdrawals(acc.TransactionOptions, withdrawals, tokens, receiveAsTokens) + core.PanicOnError("CompleteQueuedWithdrawals failed.", err) + + if !isSimulation { + _, err := bind.WaitMined(ctx, eth, txn) + core.PanicOnError("waitMined failed", err) + + color.Green("%s\n", txn.Hash().Hex()) + } else { + printAsJSON(Transaction{ + Type: "complete-withdrawals", + To: txn.To().Hex(), + CallData: common.Bytes2Hex(txn.Data()), + GasEstimateGwei: func() *uint64 { + gas := txn.Gas() + return &gas + }(), + }) + } + return nil +} diff --git a/cli/commands/computeCheckpointableValue.go b/cli/commands/computeCheckpointableValue.go deleted file mode 100644 index 4ced1774..00000000 --- a/cli/commands/computeCheckpointableValue.go +++ /dev/null @@ -1,297 +0,0 @@ -package commands - -import ( - "context" - _ "embed" - "fmt" - "math/big" - "strings" - - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils" - "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" - multicall "github.com/jbrower95/multicall-go" -) - -type TComputeCheckpointableValueCommandArgs struct { - Node string - BeaconNode string -} - -// TODO: this is duplicated -func PodManagerContracts() map[uint64]string { - return map[uint64]string{ - 1: "0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338", - 17000: "0x30770d7E3e71112d7A6b7259542D1f680a70e315", //testnet holesky - } -} - -type TQueryAllEigenpodsOnNetworkArgs struct { - Ctx context.Context - AllValidators []core.ValidatorWithIndex - Eth *ethclient.Client - EigenpodAbi abi.ABI - PodManagerAbi abi.ABI - PodManagerAddress string - Mc *multicall.MulticallClient -} - -func queryAllEigenpodsOnNetwork(args TQueryAllEigenpodsOnNetworkArgs) ([]string, error) { - // see which validators are eigenpods - // - // 1. can ignore anything that isn't withdrawing to the execution chain. - executionLayerWithdrawalCredentialValidators := utils.Filter(args.AllValidators, func(validator core.ValidatorWithIndex) bool { - return validator.Validator.WithdrawalCredentials[0] == 1 - }) - - interestingWithdrawalAddresses := getKeys(utils.Reduce(executionLayerWithdrawalCredentialValidators, func(accum map[string]int, next core.ValidatorWithIndex) map[string]int { - accum[common.Bytes2Hex(next.Validator.WithdrawalCredentials[12:])] = 1 - return accum - }, map[string]int{})) - - fmt.Printf("Querying %d addresses to see if they may be eigenpods\n", len(interestingWithdrawalAddresses)) - podOwners, err := multicall.DoManyAllowFailures(args.Mc, utils.Map(interestingWithdrawalAddresses, func(address string, index uint64) *multicall.MultiCallMetaData[common.Address] { - callMeta, err := multicall.Describe[common.Address]( - common.HexToAddress(address), - args.EigenpodAbi, - "podOwner", - ) - core.PanicOnError("failed to form mc", err) - return callMeta - })...) - - if podOwners == nil || err != nil || len(*podOwners) == 0 { - core.PanicOnError("failed to fetch podOwners", err) - core.Panic("loaded no pod owners") - return nil, err - } - - // now we can filter by which addresses actually claimed to have podOwner() - podToPodOwner := map[string]*common.Address{} - addressesWithPodOwners := utils.FilterI(interestingWithdrawalAddresses, func(address string, i uint64) bool { - success := (*podOwners)[i].Success - if success { - podToPodOwner[address] = (*podOwners)[i].Value - } - return success - }) - - // array[eigenpods given the owner] - fmt.Printf("Querying %d addresses on (EigenPodManager=%s) to see if it knows about these eigenpods\n", len(addressesWithPodOwners), args.PodManagerAddress) - - eigenpodForOwner, err := multicall.DoManyAllowFailures( - args.Mc, - utils.Map(addressesWithPodOwners, func(address string, i uint64) *multicall.MultiCallMetaData[common.Address] { - claimedOwner := *podToPodOwner[address] - call, err := multicall.Describe[common.Address]( - common.HexToAddress(args.PodManagerAddress), - args.PodManagerAbi, - "ownerToPod", - claimedOwner, - ) - core.PanicOnError("failed to form multicall", err) - return call - })..., - ) - core.PanicOnError("failed to query", err) - - // now, see which of `addressesWithPodOwners` properly were eigenpods. - return utils.FilterI(addressesWithPodOwners, func(address string, i uint64) bool { - return (*eigenpodForOwner)[i].Success && (*eigenpodForOwner)[i].Value.Cmp(common.HexToAddress(addressesWithPodOwners[i])) == 0 - }), nil -} - -func ComputeCheckpointableValueCommand(args TComputeCheckpointableValueCommandArgs) error { - ctx := context.Background() - - eigenpodAbi, err := abi.JSON(strings.NewReader(onchain.EigenPodABI)) - core.PanicOnError("failed to load eigenpod abi", err) - - podManagerAbi, err := abi.JSON(strings.NewReader(onchain.EigenPodManagerABI)) - core.PanicOnError("failed to load eigenpod manager abi", err) - - eth, beaconClient, chainId, err := core.GetClients(ctx, args.Node, args.BeaconNode, true) - core.PanicOnError("failed to reach ethereum clients", err) - - mc, err := multicall.NewMulticallClient(ctx, eth, &multicall.TMulticallClientOptions{ - MaxBatchSizeBytes: 8192, - }) - core.PanicOnError("error initializing mc", err) - - podManagerAddress, ok := PodManagerContracts()[chainId.Uint64()] - if !ok { - core.Panic("unsupported network") - } - - // fetch latest beacon state. - beaconState, err := beaconClient.GetBeaconState(ctx, "head") - core.PanicOnError("failed to load beacon state", err) - - allBalances, err := beaconState.ValidatorBalances() - core.PanicOnError("failed to parse beacon balances", err) - - _allValidators, err := beaconState.Validators() - core.PanicOnError("failed to fetch validators", err) - allValidators := utils.Map(_allValidators, func(validator *phase0.Validator, i uint64) core.ValidatorWithIndex { - return core.ValidatorWithIndex{ - Validator: validator, - Index: i, - } - }) - - allEigenpods, err := queryAllEigenpodsOnNetwork(TQueryAllEigenpodsOnNetworkArgs{ - Ctx: ctx, - AllValidators: allValidators, - Eth: eth, - EigenpodAbi: eigenpodAbi, - PodManagerAbi: podManagerAbi, - PodManagerAddress: podManagerAddress, - Mc: mc, - }) - core.PanicOnError("queryAllEigenpodsOnNetwork", err) - - isEigenpodSet := utils.Reduce(allEigenpods, func(allEigenpodSet map[string]int, eigenpod string) map[string]int { - allEigenpodSet[strings.ToLower(eigenpod)] = 1 - return allEigenpodSet - }, map[string]int{}) - - fmt.Printf("%d eigenpods discovered on the network", len(allEigenpods)) - - // Compute all pending rewards for each eigenpod; - // see: https://github.com/Layr-Labs/eigenlayer-contracts/blob/dev/src/contracts/pods/EigenPod.sol#L656 - // - // futureCheckpointableRewards(eigenpod) := (podBalanceGwei + checkpoint.balanceDeltasGwei) - // - // where: - // podBalanceGwei = address(pod).balanceGwei - pod.withdrawableRestakedExecutionLayerGwei - // and - // checkpoint.balanceDeltasGwei = sumBeaconBalancesGwei - sumRestakedBalancesGwei - - fmt.Printf("Loading Eigenpod ETH balances....\n") - podNativeEthBalances, err := multicall.DoMany( - mc, - utils.Map(allEigenpods, func(eigenpod string, index uint64) *multicall.MultiCallMetaData[big.Int] { - return mc.GetBalance(common.HexToAddress(eigenpod)) - })..., - ) - if err != nil || podNativeEthBalances == nil { - core.PanicOnError("failed to multicall eigenpod balances", err) - core.Panic("failed to load eigenpod balances") - } - - fmt.Printf("Loading EigenPod.withdrawableRestakedExecutionLayerGwei....\n") - withdrawableRestakedExecutionLayerGwei, err := multicall.DoMany( - mc, - utils.Map(allEigenpods, func(eigenpod string, index uint64) *multicall.MultiCallMetaData[uint64] { - call, err := multicall.Describe[uint64]( - common.HexToAddress(eigenpod), - eigenpodAbi, - "withdrawableRestakedExecutionLayerGwei", - ) - core.PanicOnError("failed to form multicall", err) - return call - })..., - ) - if err != nil || withdrawableRestakedExecutionLayerGwei == nil { - core.PanicOnError("failed to multicall eigenpod.withdrawableRestakedExecutionLayerGwei", err) - core.Panic("failed to load eigenpod withdrawableRestakedExecutionLayerGwei") - } - - allPendingExecutionWei := utils.Map(allEigenpods, func(eigenpod string, index uint64) *big.Int { - podCurrentNativeWei := (*podNativeEthBalances)[index] - podWithdrawableRestakedExecutionLayerWei := core.IGweiToWei(new(big.Int).SetUint64(*(*withdrawableRestakedExecutionLayerGwei)[index])) - return new(big.Int).Sub(podCurrentNativeWei, podWithdrawableRestakedExecutionLayerWei) - }) - - allValidatorsForEigenpod := utils.Reduce(allValidators, func(validatorsByPod map[string][]core.ValidatorWithIndex, validator core.ValidatorWithIndex) map[string][]core.ValidatorWithIndex { - withdrawalAddress := common.BytesToAddress(validator.Validator.WithdrawalCredentials[12:]) - eigenpod := strings.ToLower(withdrawalAddress.Hex()[2:]) // remove 0x - - if isEigenpodSet[eigenpod] == 1 { - if validatorsByPod[eigenpod] == nil { - validatorsByPod[eigenpod] = []core.ValidatorWithIndex{} - } - - validatorsByPod[eigenpod] = append(validatorsByPod[eigenpod], validator) - } - return validatorsByPod - }, map[string][]core.ValidatorWithIndex{}) - - type ValidatorPodPair struct { - Validator core.ValidatorWithIndex - Pod string - } - - allEigenlayerValidatorsWithPod := utils.Reduce(getKeys(allValidatorsForEigenpod), func(validators []ValidatorPodPair, eigenpod string) []ValidatorPodPair { - validators = append(validators, utils.Map(allValidatorsForEigenpod[eigenpod], func(validator core.ValidatorWithIndex, i uint64) ValidatorPodPair { - return ValidatorPodPair{ - Validator: validator, - Pod: eigenpod, - } - })...) - return validators - }, []ValidatorPodPair{}) - - allValidatorInfoRequests := utils.Map(allEigenlayerValidatorsWithPod, func(validatorPodPair ValidatorPodPair, index uint64) *multicall.MultiCallMetaData[onchain.IEigenPodValidatorInfo] { - res, err := core.FetchMultipleOnchainValidatorInfoMulticalls(validatorPodPair.Pod, []*phase0.Validator{validatorPodPair.Validator.Validator}) - core.PanicOnError("failed to form mc", err) - return res[0] - }) - allValidatorInfo, err := multicall.DoMany(mc, allValidatorInfoRequests...) - core.PanicOnError("failed to multicall validator info", err) - - i := 0 - allValidatorInfoLookupByIndex := utils.Reduce(*allValidatorInfo, func(validatorInfoLookup map[uint64]*onchain.IEigenPodValidatorInfo, cur *onchain.IEigenPodValidatorInfo) map[uint64]*onchain.IEigenPodValidatorInfo { - validatorInfoLookup[allEigenlayerValidatorsWithPod[i].Validator.Index] = cur - i++ - return validatorInfoLookup - }, map[uint64]*onchain.IEigenPodValidatorInfo{}) - - beaconBalancesWei := utils.Map(allEigenlayerValidatorsWithPod, func(validatorPodPair ValidatorPodPair, i uint64) *big.Int { - validatorInfo := (*allValidatorInfo)[i] - if validatorInfo.Status != core.ValidatorStatusActive { - return big.NewInt(0) - } - - balanceGwei := allBalances[validatorPodPair.Validator.Index] - return core.IGweiToWei(new(big.Int).SetUint64(uint64(balanceGwei))) - }) - - sumBeaconBalancesWei := utils.BigSum(beaconBalancesWei) - restakedBalancesByValidator := utils.Reduce(allEigenlayerValidatorsWithPod, func(accum map[uint64]*big.Int, next ValidatorPodPair) map[uint64]*big.Int { - info := allValidatorInfoLookupByIndex[next.Validator.Index] - if info.Status != core.ValidatorStatusActive { - accum[next.Validator.Index] = big.NewInt(0) - } else { - accum[next.Validator.Index] = core.IGweiToWei(new(big.Int).SetUint64(info.RestakedBalanceGwei)) - } - - return accum - }, map[uint64]*big.Int{}) - - sumRestakedBalancesWei := utils.BigSum(getValues(restakedBalancesByValidator)) - pendingBeaconWei := big.NewInt(0).Sub(sumBeaconBalancesWei, sumRestakedBalancesWei) - pendingExecutionWei := utils.BigSum(allPendingExecutionWei) - - totalPendingRewards := big.NewInt(0).Add(pendingExecutionWei, pendingBeaconWei) - - totalRewards := map[string]*big.Float{ - // `podBalanceGwei` - `withdrawableRestakedExecutionLayerGwei` - "pending_execution_wei": new(big.Float).SetInt(pendingExecutionWei), - "pending_execution_eth": core.GweiToEther(core.WeiToGwei(pendingExecutionWei)), - - // sumBeaconBalances - sum(activeValidators.info.restakedBalanceGwei) - "pending_beacon_wei": new(big.Float).SetInt(pendingBeaconWei), - "pending_beacon_eth": core.GweiToEther(core.WeiToGwei(pendingBeaconWei)), - - "total_pending_shares_wei": new(big.Float).SetInt(totalPendingRewards), - "total_pending_shares_gwei": core.WeiToGwei(totalPendingRewards), - "total_pending_shares_eth": core.GweiToEther(core.WeiToGwei(totalPendingRewards)), - } - printAsJSON(totalRewards) - return nil -} diff --git a/cli/commands/queueWithdrawal.go b/cli/commands/queueWithdrawal.go new file mode 100644 index 00000000..eeaed4f2 --- /dev/null +++ b/cli/commands/queueWithdrawal.go @@ -0,0 +1,123 @@ +package commands + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/IDelegationManager" + "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/fatih/color" +) + +type TQueueWithdrawallArgs struct { + EthNode string + EigenPod string + Sender string + EstimateGas bool + AmountWei uint64 +} + +func QueueWithdrawalCommand(args TQueueWithdrawallArgs) error { + ctx := context.Background() + + isSimulation := args.EstimateGas + + eth, err := ethclient.DialContext(ctx, args.EthNode) + core.PanicOnError("failed to reach eth node", err) + + chainId, err := eth.ChainID(ctx) + core.PanicOnError("failed to load chainId", err) + + acc, err := core.PrepareAccount(&args.Sender, chainId, args.EstimateGas) + core.PanicOnError("failed to parse private key", err) + + dm, err := IDelegationManager.NewIDelegationManager(DelegationManager(chainId), eth) + core.PanicOnError("failed to reach delegation manager", err) + + pod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenPod), eth) + core.PanicOnError("failed to reach eigenpod", err) + + _reg, err := pod.WithdrawableRestakedExecutionLayerGwei(nil) + core.PanicOnError("failed to load REG", err) + + // [withdrawable]RestakedExecutionlayerWei + rew := core.GweiToWei(new(big.Float).SetUint64(_reg)) + if args.AmountWei > 0 && new(big.Float).SetUint64(args.AmountWei).Cmp(rew) > 0 { + return errors.New("invalid --amountWei. must be in the range (0, pod.withdrawableRestakedExecutionLayerGwei() as wei]") + } + + podOwner, err := pod.PodOwner(nil) + core.PanicOnError("failed to read podOwner", err) + + reg := new(big.Int).SetUint64(_reg) + + // TODO: maximumWithdrawalSizeGwei = reg - gwei(sumQueuedWithdrawals) + maximumWithdrawalSizeWei := core.IGweiToWei(reg) + var requestedWithdrawalSizeWei *big.Int + if args.AmountWei == 0 { + // default to the number of withdrawable shares in the beacon strategy + requestedWithdrawalSizeWei = maximumWithdrawalSizeWei + } else { + // if it is specified, we withdraw the specific amount. + requestedWithdrawalSizeWei = new(big.Int).SetUint64(args.AmountWei) + } + + if requestedWithdrawalSizeWei.Cmp(maximumWithdrawalSizeWei) > 0 { + color.Red( + "Error: the amount to withdraw from the native ETH strategy (%sETH) is larger than the total withdrawable amount from the pod (%sETH). Will attempt a smaller withdrawal.\n", + core.IweiToEther(requestedWithdrawalSizeWei).String(), + core.IweiToEther(maximumWithdrawalSizeWei).String(), + ) + return errors.New("requested to withdraw too many shares") + } + + _depositShares, err := dm.ConvertToDepositShares(nil, podOwner, []common.Address{core.BeaconStrategy()}, []*big.Int{requestedWithdrawalSizeWei}) + core.PanicOnError("failed to compute deposit shares", err) + depositShares := _depositShares[0] + + minWithdrawalDelay, err := dm.MinWithdrawalDelayBlocks(nil) + core.PanicOnError("failed to load minWithdrawalDelay", err) + + curBlock, err := eth.BlockNumber(ctx) + core.PanicOnError("failed to load current block number", err) + + requestedWithdrawalSizeEth := core.GweiToEther(core.WeiToGwei(requestedWithdrawalSizeWei)) + color.Blue("Withdrawing: %sETH.\n", requestedWithdrawalSizeEth.String()) + color.Yellow("NOTE: If you were or become slashed on EigenLayer during the withdrawal period, the total amount received will be less any slashed amount.\n") + + if !isSimulation { + core.PanicIfNoConsent(fmt.Sprintf("Would you like to queue a withdrawal %sETH from the Native ETH strategy? This will be withdrawable after approximately block #%d (current block: %d)\n", requestedWithdrawalSizeEth.String(), curBlock+uint64(minWithdrawalDelay), curBlock)) + } else { + fmt.Printf("THIS IS A SIMULATION. No transaction will be recorded onchain.\n") + } + txn, err := dm.QueueWithdrawals(acc.TransactionOptions, []IDelegationManager.IDelegationManagerTypesQueuedWithdrawalParams{ + { + Strategies: []common.Address{core.BeaconStrategy()}, + DepositShares: []*big.Int{depositShares}, + Withdrawer: podOwner, + }, + }) + core.PanicOnError("failed to queue withdrawal", err) + if !isSimulation { + txnReceipt, err := bind.WaitMined(ctx, eth, txn) + core.PanicOnError("failed to wait for txn", err) + color.Green("%s\n", txnReceipt.TxHash.Hex()) + } else { + printAsJSON(Transaction{ + Type: "queue-withdrawal", + To: txn.To().Hex(), + CallData: common.Bytes2Hex(txn.Data()), + GasEstimateGwei: func() *uint64 { + gas := txn.Gas() + return &gas + }(), + }) + } + return nil +} diff --git a/cli/commands/showWithdrawals.go b/cli/commands/showWithdrawals.go new file mode 100644 index 00000000..943b4faa --- /dev/null +++ b/cli/commands/showWithdrawals.go @@ -0,0 +1,75 @@ +package commands + +import ( + "context" + "math/big" + + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/IDelegationManager" + "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" + "github.com/ethereum/go-ethereum/common" +) + +type TShowWithdrawalArgs struct { + EthNode string + EigenPod string + Strategies common.Address +} + +func ShowWithdrawalsCommand(args TShowWithdrawalArgs) error { + ctx := context.Background() + eth, chainId, err := core.GetEthClient(ctx, args.EthNode) + core.PanicOnError("failed to reach eth and beacon node", err) + + curBlock, err := eth.BlockByNumber(ctx, nil) /* head */ + core.PanicOnError("failed to load curBlock", err) + + dm, err := IDelegationManager.NewIDelegationManager(DelegationManager(chainId), eth) + core.PanicOnError("failed to reach delegation manager", err) + + pod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenPod), eth) + core.PanicOnError("failed to reach eigenpod manager", err) + + podOwner, err := pod.PodOwner(nil) + core.PanicOnError("failed to load podOwner", err) + + allWithdrawals, err := dm.GetQueuedWithdrawals(nil, podOwner) + core.PanicOnError("failed to get queued withdrawals", err) + + type TWithdrawalInfo struct { + Staker string + Strategy common.Address + CurrentBlock uint64 + AvailableAfterBlock *big.Int + Ready bool + TotalAmountETH *big.Float + } + + minDelay, err := dm.MinWithdrawalDelayBlocks(nil) + core.PanicOnError("failed to get minWithdrawalDelay", err) + + withdrawalInfo := []TWithdrawalInfo{} + + for i, shares := range allWithdrawals.Shares { + withdrawal := allWithdrawals.Withdrawals[i] + + // this cli is only for withdrawals of beaconstrategy for a single strategy + if withdrawal.Strategies[0].Cmp(core.BeaconStrategy()) != 0 || len(withdrawal.Strategies) != 1 { + continue + } + + targetBlock := new(big.Int).SetUint64(uint64(allWithdrawals.Withdrawals[i].StartBlock + minDelay)) + + withdrawalInfo = append(withdrawalInfo, TWithdrawalInfo{ + TotalAmountETH: core.GweiToEther(core.WeiToGwei(shares[0])), + Strategy: allWithdrawals.Withdrawals[i].Strategies[0], + Staker: allWithdrawals.Withdrawals[i].Staker.Hex(), + CurrentBlock: curBlock.NumberU64(), + AvailableAfterBlock: targetBlock, + Ready: targetBlock.Uint64() < curBlock.NumberU64(), + }) + } + + printAsJSON(withdrawalInfo) + return nil +} diff --git a/cli/commands/staleBalance.go b/cli/commands/staleBalance.go index 41f1f4c5..e172bf46 100644 --- a/cli/commands/staleBalance.go +++ b/cli/commands/staleBalance.go @@ -5,9 +5,9 @@ import ( "fmt" "math/big" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" eigenpodproofs "github.com/Layr-Labs/eigenpod-proofs-generation" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/fatih/color" @@ -57,7 +57,7 @@ func FixStaleBalance(args TFixStaleBalanceArgs) error { ownerAccount, err := core.PrepareAccount(&args.Sender, chainId, false /* noSend */) core.PanicOnError("failed to parse sender PK", err) - eigenpod, err := onchain.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) + eigenpod, err := EigenPod.NewEigenPod(common.HexToAddress(args.EigenpodAddress), eth) core.PanicOnError("failed to reach eigenpod", err) currentCheckpointTimestamp, err := eigenpod.CurrentCheckpointTimestamp(nil) @@ -97,11 +97,11 @@ func FixStaleBalance(args TFixStaleBalanceArgs) error { txn, err := eigenpod.VerifyStaleBalance( ownerAccount.TransactionOptions, oracleBeaconTimesetamp, - onchain.BeaconChainProofsStateRootProof{ + EigenPod.BeaconChainProofsStateRootProof{ Proof: proof.StateRootProof.Proof.ToByteSlice(), BeaconStateRoot: proof.StateRootProof.BeaconStateRoot, }, - onchain.BeaconChainProofsValidatorProof{ + EigenPod.BeaconChainProofsValidatorProof{ ValidatorFields: proofCast(proof.ValidatorFields[0]), Proof: proof.ValidatorFieldsProofs[0].ToByteSlice(), }, diff --git a/cli/core/checkpoint.go b/cli/core/checkpoint.go index d8ab7f88..5bd2db41 100644 --- a/cli/core/checkpoint.go +++ b/cli/core/checkpoint.go @@ -9,8 +9,8 @@ import ( "os" "strconv" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" eigenpodproofs "github.com/Layr-Labs/eigenpod-proofs-generation" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" v1 "github.com/attestantio/go-eth2-client/api/v1" "github.com/attestantio/go-eth2-client/spec" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -79,7 +79,7 @@ func SubmitCheckpointProofBatch(ctx context.Context, owner, eigenpodAddress stri fmt.Printf("Using account(0x%s) to submit onchain\n", common.Bytes2Hex(ownerAccount.FromAddress[:])) } - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) if err != nil { return nil, err } @@ -89,7 +89,7 @@ func SubmitCheckpointProofBatch(ctx context.Context, owner, eigenpodAddress stri }) txn, err := eigenPod.VerifyCheckpointProofs( ownerAccount.TransactionOptions, - onchain.BeaconChainProofsBalanceContainerProof{ + EigenPod.BeaconChainProofsBalanceContainerProof{ BalanceContainerRoot: proof.ValidatorBalancesRoot, Proof: proof.Proof.ToByteSlice(), }, diff --git a/cli/core/findStalePods.go b/cli/core/findStalePods.go index 2aeddbce..af6c2be2 100644 --- a/cli/core/findStalePods.go +++ b/cli/core/findStalePods.go @@ -7,14 +7,18 @@ import ( "math/big" "strings" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" + "github.com/ethereum/go-ethereum/accounts/abi" + + "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/eigenlayer-contracts/pkg/bindings/IEigenPod" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils" + "github.com/attestantio/go-eth2-client/spec" "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/params" - "github.com/pkg/errors" + "github.com/jbrower95/multicall-go" ) func PodManagerContracts() map[uint64]string { @@ -24,111 +28,212 @@ func PodManagerContracts() map[uint64]string { } } -type Cache struct { - PodOwnerShares map[string]PodOwnerShare -} - // multiply by a fraction func FracMul(a *big.Int, x *big.Int, y *big.Int) *big.Int { _a := new(big.Int).Mul(a, x) return _a.Div(_a, y) } -func keys[A comparable, B any](coll map[A]B) []A { - if len(coll) == 0 { - return []A{} - } - out := make([]A, len(coll)) - i := 0 - for key := range coll { - out[i] = key - i++ +func executionWithdrawalAddress(withdrawalCredentials []byte) *string { + if withdrawalCredentials[0] != 1 { + return nil } - return out -} - -type PodOwnerShare struct { - SharesWei *big.Int - ExecutionLayerBalanceWei *big.Int - IsEigenpod bool + addr := common.Bytes2Hex(withdrawalCredentials[12:]) + return &addr } -var cache Cache // valid for the duration of a command. - -func isEigenpod(eth *ethclient.Client, chainId uint64, eigenpodAddress string) (bool, error) { - if cache.PodOwnerShares == nil { - cache.PodOwnerShares = make(map[string]PodOwnerShare) +func validEigenpodsOnly(candidateAddresses []common.Address, mc *multicall.MulticallClient, chainId uint64) ([]common.Address, error) { + EigenPodAbi, err := abi.JSON(strings.NewReader(EigenPod.EigenPodABI)) + if err != nil { + return nil, fmt.Errorf("failed to load eigenpod abi: %s", err) } - - if val, ok := cache.PodOwnerShares[eigenpodAddress]; ok { - return val.IsEigenpod, nil + EigenPodManagerAbi, err := abi.JSON(strings.NewReader(EigenPodManager.EigenPodManagerABI)) + if err != nil { + return nil, fmt.Errorf("failed to load eigenpod manager abi: %s", err) } - // default to false - cache.PodOwnerShares[eigenpodAddress] = PodOwnerShare{ - SharesWei: big.NewInt(0), - ExecutionLayerBalanceWei: big.NewInt(0), - IsEigenpod: false, + podManagerAddress, ok := PodManagerContracts()[chainId] + if !ok { + return nil, fmt.Errorf("unsupported chainId: %d", chainId) } - podManAddress, ok := PodManagerContracts()[chainId] - if !ok { - return false, fmt.Errorf("chain %d not supported", chainId) + ////// step 1: cast all addresses to EigenPod, and attempt to read the pod owner. + var lastError error + + calls := utils.Map(candidateAddresses, func(addr common.Address, i uint64) *multicall.MultiCallMetaData[common.Address] { + mc, err := multicall.Describe[common.Address]( + addr, + EigenPodAbi, + "podOwner", + ) + if err != nil { + lastError = err + return nil + } + return mc + }) + if lastError != nil { + return nil, lastError } - podMan, err := onchain.NewEigenPodManager(common.HexToAddress(podManAddress), eth) - if err != nil { - return false, fmt.Errorf("error contacting eigenpod manager: %w", err) + + reportedPodOwners, err := multicall.DoManyAllowFailures( + mc, + calls..., + ) + if err != nil || reportedPodOwners == nil { + return nil, fmt.Errorf("failed to load podOwners: %w", err) } - if podMan == nil { - return false, errors.New("failed to find eigenpod manager") + type PodOwnerResult struct { + Query common.Address + Response multicall.TypedMulticall3Result[*common.Address] } - pod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) - if err != nil { - return false, fmt.Errorf("error contacting eigenpod: %w", err) + podOwnerPairs := utils.Filter(utils.Map(*reportedPodOwners, func(res multicall.TypedMulticall3Result[*common.Address], i uint64) PodOwnerResult { + return PodOwnerResult{ + Query: candidateAddresses[i], + Response: res, + } + }), func(m PodOwnerResult) bool { + return m.Response.Success + }) + + ////// step 2: using the pod manager, check `ownerToPod` and validate which ones point back at the same address. + authoritativeOwnerToPodCalls := utils.Map(podOwnerPairs, func(res PodOwnerResult, i uint64) *multicall.MultiCallMetaData[common.Address] { + mc, err := multicall.Describe[common.Address]( + common.HexToAddress(podManagerAddress), + EigenPodManagerAbi, + "ownerToPod", + res.Response.Value, + ) + if err != nil { + lastError = err + return nil + } + return mc + }) + if lastError != nil { + return nil, lastError } - owner, err := pod.PodOwner(nil) + authoritativeOwnerToPod, err := multicall.DoMany(mc, authoritativeOwnerToPodCalls...) if err != nil { - return false, fmt.Errorf("error loading podowner: %w", err) + return nil, err } - expectedPod, err := podMan.OwnerToPod(&bind.CallOpts{}, owner) + nullAddress := common.BigToAddress(big.NewInt(0)) + + ////// step 3: the valid eigenrestpods are the ones where authoritativeOwnerToPod[i] == candidateAddresses[i]. + return utils.Map(utils.FilterI(podOwnerPairs, func(res PodOwnerResult, i uint64) bool { + return (res.Query.Cmp(*(*authoritativeOwnerToPod)[i]) == 0) && (*authoritativeOwnerToPod)[i].Cmp(nullAddress) != 0 + }), func(v PodOwnerResult, i uint64) common.Address { + return v.Query + }), nil +} + +func ComputeBalanceDeviationSync(ctx context.Context, eth *ethclient.Client, state *spec.VersionedBeaconState, eigenpod common.Address) (*big.Float, error) { + pod, err := IEigenPod.NewIEigenPod(eigenpod, eth) if err != nil { - return false, fmt.Errorf("ownerToPod() failed: %s", err.Error()) - } - if expectedPod.Cmp(common.HexToAddress(eigenpodAddress)) != 0 { - return false, nil + return nil, err } - podOwnerShares, err := podMan.PodOwnerShares(nil, owner) + allValidators, err := state.Validators() + PanicOnError("failed to read validators", err) + + allValidatorsWithIndexes := utils.Map(allValidators, func(v *phase0.Validator, i uint64) ValidatorWithIndex { + return ValidatorWithIndex{ + Validator: v, + Index: i, + } + }) + + podValidators := utils.FilterI[ValidatorWithIndex](allValidatorsWithIndexes, func(v ValidatorWithIndex, u uint64) bool { + addr := executionWithdrawalAddress(v.Validator.WithdrawalCredentials) + return addr != nil && eigenpod.Cmp(common.HexToAddress(*addr)) == 0 + }) + + validatorBalances, err := state.ValidatorBalances() + PanicOnError("failed to read beacon state validator balances", err) + + validatorInfo, err := FetchMultipleOnchainValidatorInfoWithFailures(ctx, eth, eigenpod.Hex(), podValidators) if err != nil { - return false, fmt.Errorf("PodOwnerShares() failed: %s", err.Error()) + return nil, err } - balance, err := eth.BalanceAt(context.Background(), common.HexToAddress(eigenpodAddress), nil) + podBalanceWei, err := eth.BalanceAt(ctx, eigenpod, nil) if err != nil { - return false, fmt.Errorf("balance check failed: %s", err.Error()) + return nil, err } - // Simulate fetching from contracts - // Implement contract fetching logic here - cache.PodOwnerShares[eigenpodAddress] = PodOwnerShare{ - SharesWei: podOwnerShares, - ExecutionLayerBalanceWei: balance, - IsEigenpod: true, + sumCurrentBeaconBalancesGwei := utils.BigSum( + utils.Map(podValidators, func(v ValidatorWithIndex, i uint64) *big.Int { + if validatorInfo[i].Info != nil && validatorInfo[i].Info.Status == 1 /* ACTIVE */ { + return new(big.Int).SetUint64(uint64(validatorBalances[v.Index])) + } + return big.NewInt(0) + }), + ) + + eigenPodManagerAddr, err := pod.EigenPodManager(nil) + PanicOnError("failed to load eigenpod manager", err) + + eigenPodManager, err := EigenPodManager.NewEigenPodManager(eigenPodManagerAddr, eth) + PanicOnError("failed to load eigenpod manager", err) + + delegationManagerAddress, err := eigenPodManager.DelegationManager(nil) + PanicOnError("failed to read delegationManager", err) + + delegationManager, err := DelegationManager.NewDelegationManager(delegationManagerAddress, eth) + PanicOnError("failed to reach delegationManager", err) + + podOwner, err := pod.PodOwner(nil) + PanicOnError("failed to load pod owner", err) + + activeShares, err := delegationManager.GetWithdrawableShares(nil, podOwner, []common.Address{ + BeaconStrategy(), + }) + PanicOnError("failed to load owner shares", err) + + var sharesPendingWithdrawal *big.Int + withdrawalInfo, err := delegationManager.GetQueuedWithdrawals(nil, podOwner) + PanicOnError("failed to load queued withdrawals", err) + + for i, withdrawal := range withdrawalInfo.Withdrawals { + for j, strategy := range withdrawal.Strategies { + if strategy.Cmp(BeaconStrategy()) == 0 { + sharesPendingWithdrawal = new(big.Int).Add(sharesPendingWithdrawal, withdrawalInfo.Shares[i][j]) + } + } } - return true, nil -} + totalSharesInEigenLayer := new(big.Int).Add(activeShares.WithdrawableShares[0], sharesPendingWithdrawal) -func executionWithdrawalAddress(withdrawalCredentials []byte) *string { - if withdrawalCredentials[0] != 1 { - return nil + // fmt.Printf("# validators: %d\n", len(podValidators)) + // fmt.Printf("# active validators: %d\n", len(activeValidators)) + // fmt.Printf("delta := 1 - ((podBalanceGwei + sumCurrentBeaconBalancesGwei) / (regGwei + sumPreviousBeaconBalancesGwei)\n") + // fmt.Printf("delta := 1 - ((%s + %s) / (%d + %s)\n", WeiToGwei(podBalanceWei).String(), sumCurrentBeaconBalancesGwei.String(), regGwei, sumPreviousBeaconBalancesGwei.String()) + + currentState := new(big.Float).Add(WeiToGwei(podBalanceWei), new(big.Float).SetInt(sumCurrentBeaconBalancesGwei)) + prevState := WeiToGwei(totalSharesInEigenLayer) + + var delta *big.Float + + if prevState.Cmp(big.NewFloat(0)) == 0 { + delta = big.NewFloat(0) + } else { + delta = new(big.Float).Sub( + big.NewFloat(1), + new(big.Float).Quo( + currentState, + prevState, + ), + ) } - addr := common.Bytes2Hex(withdrawalCredentials[12:]) - return &addr + + // fmt.Printf("(delta=%s%%)\n", new(big.Float).Mul(delta, big.NewFloat(100)).String()) + // fmt.Printf("-----------------------------------\n\n") + + return delta, nil } func FindStaleEigenpods(ctx context.Context, eth *ethclient.Client, nodeUrl string, beacon BeaconClient, chainId *big.Int, verbose bool, tolerance float64) (map[string][]ValidatorWithIndex, error) { @@ -137,6 +242,11 @@ func FindStaleEigenpods(ctx context.Context, eth *ethclient.Client, nodeUrl stri return nil, fmt.Errorf("error downloading beacon state: %s", err.Error()) } + mc, err := multicall.NewMulticallClient(ctx, eth, nil) + if err != nil { + return nil, err + } + // Simulate fetching validators _allValidators, err := beaconState.Validators() if err != nil { @@ -161,149 +271,34 @@ func FindStaleEigenpods(ctx context.Context, eth *ethclient.Client, nodeUrl stri return true }) - withdrawalAddressesToCheck := make(map[uint64]string) - for _, validator := range allSlashedValidators { - withdrawalAddressesToCheck[validator.Index] = *executionWithdrawalAddress(validator.Validator.WithdrawalCredentials) - } - - if len(withdrawalAddressesToCheck) == 0 { - log.Println("No EigenValidators were slashed.") - return map[string][]ValidatorWithIndex{}, nil - } + allSlashedWithdrawalAddresses := utils.Unique( + utils.Map(allSlashedValidators, func(v ValidatorWithIndex, i uint64) common.Address { + return common.HexToAddress(*executionWithdrawalAddress(v.Validator.WithdrawalCredentials)) + }), + ) - allSlashedValidatorsBelongingToEigenpods := utils.Filter(allSlashedValidators, func(validator ValidatorWithIndex) bool { - podAddr := *executionWithdrawalAddress(validator.Validator.WithdrawalCredentials) - isPod, err := isEigenpod(eth, chainId.Uint64(), podAddr) - if err != nil { - if verbose { - if !strings.Contains(err.Error(), "no contract code at given address") { - log.Printf("error checking whether contract(%s) was eigenpod: %s\n", podAddr, err.Error()) - } - } - return false - } else if verbose && isPod { - log.Printf("Detected slashed pod: %s", podAddr) - } - return isPod - }) - - allValidatorInfo := make(map[uint64]onchain.IEigenPodValidatorInfo) - for _, validator := range allSlashedValidatorsBelongingToEigenpods { - eigenpodAddress := *executionWithdrawalAddress(validator.Validator.WithdrawalCredentials) - pod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) - if err != nil { - // failed to load validator info. - return map[string][]ValidatorWithIndex{}, fmt.Errorf("failed to dial eigenpod: %s", err.Error()) - } - - info, err := pod.ValidatorPubkeyToInfo(nil, validator.Validator.PublicKey[:]) - if err != nil { - // failed to load validator info. - return map[string][]ValidatorWithIndex{}, err - } - allValidatorInfo[validator.Index] = info - } - - allActiveSlashedValidatorsBelongingToEigenpods := utils.Filter(allSlashedValidatorsBelongingToEigenpods, func(validator ValidatorWithIndex) bool { - validatorInfo := allValidatorInfo[validator.Index] - return validatorInfo.Status == 1 // "ACTIVE" - }) - - if verbose { - log.Printf("%d EigenValidators have been slashed\n", len(allSlashedValidatorsBelongingToEigenpods)) - log.Printf("%d EigenValidators have been slashed + active\n", len(allActiveSlashedValidatorsBelongingToEigenpods)) - } - - slashedEigenpods := utils.Reduce(allActiveSlashedValidatorsBelongingToEigenpods, func(pods map[string][]ValidatorWithIndex, validator ValidatorWithIndex) map[string][]ValidatorWithIndex { - podAddress := executionWithdrawalAddress(validator.Validator.WithdrawalCredentials) - if podAddress != nil { - if pods[*podAddress] == nil { - pods[*podAddress] = []ValidatorWithIndex{} - } - pods[*podAddress] = append(pods[*podAddress], validator) - } - return pods - }, map[string][]ValidatorWithIndex{}) - - allValidatorBalances, err := beaconState.ValidatorBalances() + // fmt.Printf("Checking %d slashed withdrawal addresses for eigenpod status\n", len(allSlashedWithdrawalAddresses)) + slashedEigenpods, err := validEigenpodsOnly(allSlashedWithdrawalAddresses, mc, chainId.Uint64()) if err != nil { return nil, err } - totalAssetsWeiByEigenpod := utils.Reduce(keys(slashedEigenpods), func(allBalances map[string]*big.Int, eigenpod string) map[string]*big.Int { - // total assets of an eigenpod are determined as; - // SUM( - // - native ETH in the pod - // - any active validators and their associated balances - // ) - validatorsForEigenpod := utils.Filter(allValidatorsWithIndices, func(v ValidatorWithIndex) bool { - withdrawal := executionWithdrawalAddress(v.Validator.WithdrawalCredentials) - return withdrawal != nil && strings.EqualFold(*withdrawal, eigenpod) - }) - - podValidatorInfo, err := FetchMultipleOnchainValidatorInfo(ctx, eth, eigenpod, validatorsForEigenpod) - if err != nil { - return allBalances - } - - allActiveValidatorsForEigenpod := utils.Filter(podValidatorInfo, func(v ValidatorWithOnchainInfo) bool { - if v.Info.Status != 1 { // ignore any inactive validators - return false - } - - withdrawal := executionWithdrawalAddress(v.Validator.WithdrawalCredentials) - return withdrawal != nil && strings.EqualFold(*withdrawal, eigenpod) - }) - - allActiveValidatorBalancesSummedGwei := utils.Reduce(allActiveValidatorsForEigenpod, func(accum phase0.Gwei, validator ValidatorWithOnchainInfo) phase0.Gwei { - return accum + allValidatorBalances[validator.Index] - }, phase0.Gwei(0)) - activeValidatorBalancesSum := new(big.Int).Mul( - new(big.Int).SetUint64(uint64(allActiveValidatorBalancesSummedGwei)), - new(big.Int).SetUint64(params.GWei), - ) - - if verbose { - log.Printf("[%s] podOwnerShares(%sETH), anticipated balance = beacon(%s across %d validators) + executionBalance(%sETH)\n", - eigenpod, - IweiToEther(cache.PodOwnerShares[eigenpod].SharesWei).String(), - IweiToEther(activeValidatorBalancesSum).String(), - len(allActiveValidatorsForEigenpod), - IweiToEther(cache.PodOwnerShares[eigenpod].ExecutionLayerBalanceWei).String(), - ) // converting gwei to wei - } + if len(slashedEigenpods) == 0 { + log.Println("No eigenpods were slashed.") + return map[string][]ValidatorWithIndex{}, nil + } - allBalances[eigenpod] = new(big.Int).Add(cache.PodOwnerShares[eigenpod].ExecutionLayerBalanceWei, activeValidatorBalancesSum) - return allBalances - }, map[string]*big.Int{}) + // 2. given the set of slashed eigenpods, determine which are unhealthy. if verbose { log.Printf("%d EigenPods were slashed\n", len(slashedEigenpods)) } - unhealthyEigenpods := utils.Filter(keys(slashedEigenpods), func(eigenpod string) bool { - currentTotalAssets, ok := totalAssetsWeiByEigenpod[eigenpod] - if !ok { - return false - } - currentShares := cache.PodOwnerShares[eigenpod].SharesWei - - delta := new(big.Int).Sub(currentShares, currentTotalAssets) - allowableDelta := FracMul(currentShares, big.NewInt(int64(tolerance)), big.NewInt(100)) - if delta.Cmp(allowableDelta) >= 0 { - if verbose { - log.Printf("[%s] %sETH drop in assets (max drop allowed: %sETH, current shares: %sETH, anticipated shares: %sETH)\n", - eigenpod, - IweiToEther(delta).String(), - IweiToEther(allowableDelta).String(), - IweiToEther(currentShares).String(), - IweiToEther(currentTotalAssets).String(), - ) - } - return true - } + unhealthyEigenpods := utils.Filter(slashedEigenpods, func(eigenpod common.Address) bool { + deviation, err := ComputeBalanceDeviationSync(ctx, eth, beaconState, eigenpod) + PanicOnError("failed to compute balance deviation for eigenpod", err) - return false + return deviation.Cmp(big.NewFloat(tolerance)) > 0 }) if len(unhealthyEigenpods) == 0 { @@ -319,7 +314,10 @@ func FindStaleEigenpods(ctx context.Context, eth *ethclient.Client, nodeUrl stri var entries map[string][]ValidatorWithIndex = make(map[string][]ValidatorWithIndex) for _, val := range unhealthyEigenpods { - entries[val] = slashedEigenpods[val] + entries[val.Hex()] = utils.Filter(allValidatorsWithIndices, func(v ValidatorWithIndex) bool { + execAddr := executionWithdrawalAddress(v.Validator.WithdrawalCredentials) + return execAddr != nil && common.HexToAddress(*execAddr).Cmp(val) == 0 + }) } return entries, nil diff --git a/cli/core/onchain/EigenPod.go b/cli/core/onchain/EigenPod.go deleted file mode 100644 index 87f51385..00000000 --- a/cli/core/onchain/EigenPod.go +++ /dev/null @@ -1,2485 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package onchain - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// BeaconChainProofsBalanceContainerProof is an auto generated low-level Go binding around an user-defined struct. -type BeaconChainProofsBalanceContainerProof struct { - BalanceContainerRoot [32]byte - Proof []byte -} - -// BeaconChainProofsBalanceProof is an auto generated low-level Go binding around an user-defined struct. -type BeaconChainProofsBalanceProof struct { - PubkeyHash [32]byte - BalanceRoot [32]byte - Proof []byte -} - -// BeaconChainProofsStateRootProof is an auto generated low-level Go binding around an user-defined struct. -type BeaconChainProofsStateRootProof struct { - BeaconStateRoot [32]byte - Proof []byte -} - -// BeaconChainProofsValidatorProof is an auto generated low-level Go binding around an user-defined struct. -type BeaconChainProofsValidatorProof struct { - ValidatorFields [][32]byte - Proof []byte -} - -// IEigenPodCheckpoint is an auto generated low-level Go binding around an user-defined struct. -type IEigenPodCheckpoint struct { - BeaconBlockRoot [32]byte - ProofsRemaining *big.Int - PodBalanceGwei uint64 - BalanceDeltasGwei *big.Int -} - -// IEigenPodValidatorInfo is an auto generated low-level Go binding around an user-defined struct. -type IEigenPodValidatorInfo struct { - ValidatorIndex uint64 - RestakedBalanceGwei uint64 - LastCheckpointedAt uint64 - Status uint8 -} - -// EigenPodMetaData contains all meta data concerning the EigenPod contract. -var EigenPodMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ethPOS\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"},{\"name\":\"_eigenPodManager\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"},{\"name\":\"_GENESIS_TIME\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"GENESIS_TIME\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"activeValidatorCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"checkpointBalanceExitedGwei\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpoint\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.Checkpoint\",\"components\":[{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proofsRemaining\",\"type\":\"uint24\",\"internalType\":\"uint24\"},{\"name\":\"podBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"balanceDeltasGwei\",\"type\":\"int128\",\"internalType\":\"int128\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"currentCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPodManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getParentBlockRoot\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"_podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"lastCheckpointTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"podOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proofSubmitter\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recoverTokens\",\"inputs\":[{\"name\":\"tokenList\",\"type\":\"address[]\",\"internalType\":\"contractIERC20[]\"},{\"name\":\"amountsToWithdraw\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setProofSubmitter\",\"inputs\":[{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"startCheckpoint\",\"inputs\":[{\"name\":\"revertIfNoBalance\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validatorPubkeyHashToInfo\",\"inputs\":[{\"name\":\"validatorPubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorPubkeyToInfo\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIEigenPod.ValidatorInfo\",\"components\":[{\"name\":\"validatorIndex\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"restakedBalanceGwei\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"lastCheckpointedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"validatorPubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validatorStatus\",\"inputs\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIEigenPod.VALIDATOR_STATUS\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyCheckpointProofs\",\"inputs\":[{\"name\":\"balanceContainerProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.BalanceContainerProof\",\"components\":[{\"name\":\"balanceContainerRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proofs\",\"type\":\"tuple[]\",\"internalType\":\"structBeaconChainProofs.BalanceProof[]\",\"components\":[{\"name\":\"pubkeyHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"balanceRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyStaleBalance\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.ValidatorProof\",\"components\":[{\"name\":\"validatorFields\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyWithdrawalCredentials\",\"inputs\":[{\"name\":\"beaconTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stateRootProof\",\"type\":\"tuple\",\"internalType\":\"structBeaconChainProofs.StateRootProof\",\"components\":[{\"name\":\"beaconStateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"validatorIndices\",\"type\":\"uint40[]\",\"internalType\":\"uint40[]\"},{\"name\":\"validatorFieldsProofs\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"validatorFields\",\"type\":\"bytes32[][]\",\"internalType\":\"bytes32[][]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawRestakedBeaconChainETH\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountWei\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawableRestakedExecutionLayerGwei\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"CheckpointCreated\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"beaconBlockRoot\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validatorCount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"CheckpointFinalized\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"totalShareDeltaWei\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EigenPodStaked\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NonBeaconChainETHReceived\",\"inputs\":[{\"name\":\"amountReceived\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ProofSubmitterUpdated\",\"inputs\":[{\"name\":\"prevProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"newProofSubmitter\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RestakedBeaconChainETHWithdrawn\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorBalanceUpdated\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"},{\"name\":\"balanceTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"newValidatorBalanceGwei\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorCheckpointed\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRestaked\",\"inputs\":[{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":false,\"internalType\":\"uint40\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWithdrawn\",\"inputs\":[{\"name\":\"checkpointTimestamp\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorIndex\",\"type\":\"uint40\",\"indexed\":true,\"internalType\":\"uint40\"}],\"anonymous\":false}]", -} - -// EigenPodABI is the input ABI used to generate the binding from. -// Deprecated: Use EigenPodMetaData.ABI instead. -var EigenPodABI = EigenPodMetaData.ABI - -// EigenPod is an auto generated Go binding around an Ethereum contract. -type EigenPod struct { - EigenPodCaller // Read-only binding to the contract - EigenPodTransactor // Write-only binding to the contract - EigenPodFilterer // Log filterer for contract events -} - -// EigenPodCaller is an auto generated read-only Go binding around an Ethereum contract. -type EigenPodCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodTransactor is an auto generated write-only Go binding around an Ethereum contract. -type EigenPodTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type EigenPodFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type EigenPodSession struct { - Contract *EigenPod // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EigenPodCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type EigenPodCallerSession struct { - Contract *EigenPodCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// EigenPodTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type EigenPodTransactorSession struct { - Contract *EigenPodTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EigenPodRaw is an auto generated low-level Go binding around an Ethereum contract. -type EigenPodRaw struct { - Contract *EigenPod // Generic contract binding to access the raw methods on -} - -// EigenPodCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type EigenPodCallerRaw struct { - Contract *EigenPodCaller // Generic read-only contract binding to access the raw methods on -} - -// EigenPodTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type EigenPodTransactorRaw struct { - Contract *EigenPodTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewEigenPod creates a new instance of EigenPod, bound to a specific deployed contract. -func NewEigenPod(address common.Address, backend bind.ContractBackend) (*EigenPod, error) { - contract, err := bindEigenPod(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &EigenPod{EigenPodCaller: EigenPodCaller{contract: contract}, EigenPodTransactor: EigenPodTransactor{contract: contract}, EigenPodFilterer: EigenPodFilterer{contract: contract}}, nil -} - -// NewEigenPodCaller creates a new read-only instance of EigenPod, bound to a specific deployed contract. -func NewEigenPodCaller(address common.Address, caller bind.ContractCaller) (*EigenPodCaller, error) { - contract, err := bindEigenPod(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &EigenPodCaller{contract: contract}, nil -} - -// NewEigenPodTransactor creates a new write-only instance of EigenPod, bound to a specific deployed contract. -func NewEigenPodTransactor(address common.Address, transactor bind.ContractTransactor) (*EigenPodTransactor, error) { - contract, err := bindEigenPod(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &EigenPodTransactor{contract: contract}, nil -} - -// NewEigenPodFilterer creates a new log filterer instance of EigenPod, bound to a specific deployed contract. -func NewEigenPodFilterer(address common.Address, filterer bind.ContractFilterer) (*EigenPodFilterer, error) { - contract, err := bindEigenPod(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &EigenPodFilterer{contract: contract}, nil -} - -// bindEigenPod binds a generic wrapper to an already deployed contract. -func bindEigenPod(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := EigenPodMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EigenPod *EigenPodRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EigenPod.Contract.EigenPodCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EigenPod *EigenPodRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPod.Contract.EigenPodTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EigenPod *EigenPodRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EigenPod.Contract.EigenPodTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EigenPod *EigenPodCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EigenPod.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EigenPod *EigenPodTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPod.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EigenPod *EigenPodTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EigenPod.Contract.contract.Transact(opts, method, params...) -} - -// GENESISTIME is a free data retrieval call binding the contract method 0xf2882461. -// -// Solidity: function GENESIS_TIME() view returns(uint64) -func (_EigenPod *EigenPodCaller) GENESISTIME(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "GENESIS_TIME") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// GENESISTIME is a free data retrieval call binding the contract method 0xf2882461. -// -// Solidity: function GENESIS_TIME() view returns(uint64) -func (_EigenPod *EigenPodSession) GENESISTIME() (uint64, error) { - return _EigenPod.Contract.GENESISTIME(&_EigenPod.CallOpts) -} - -// GENESISTIME is a free data retrieval call binding the contract method 0xf2882461. -// -// Solidity: function GENESIS_TIME() view returns(uint64) -func (_EigenPod *EigenPodCallerSession) GENESISTIME() (uint64, error) { - return _EigenPod.Contract.GENESISTIME(&_EigenPod.CallOpts) -} - -// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. -// -// Solidity: function activeValidatorCount() view returns(uint256) -func (_EigenPod *EigenPodCaller) ActiveValidatorCount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "activeValidatorCount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. -// -// Solidity: function activeValidatorCount() view returns(uint256) -func (_EigenPod *EigenPodSession) ActiveValidatorCount() (*big.Int, error) { - return _EigenPod.Contract.ActiveValidatorCount(&_EigenPod.CallOpts) -} - -// ActiveValidatorCount is a free data retrieval call binding the contract method 0x2340e8d3. -// -// Solidity: function activeValidatorCount() view returns(uint256) -func (_EigenPod *EigenPodCallerSession) ActiveValidatorCount() (*big.Int, error) { - return _EigenPod.Contract.ActiveValidatorCount(&_EigenPod.CallOpts) -} - -// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. -// -// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) -func (_EigenPod *EigenPodCaller) CheckpointBalanceExitedGwei(opts *bind.CallOpts, arg0 uint64) (uint64, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "checkpointBalanceExitedGwei", arg0) - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. -// -// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) -func (_EigenPod *EigenPodSession) CheckpointBalanceExitedGwei(arg0 uint64) (uint64, error) { - return _EigenPod.Contract.CheckpointBalanceExitedGwei(&_EigenPod.CallOpts, arg0) -} - -// CheckpointBalanceExitedGwei is a free data retrieval call binding the contract method 0x52396a59. -// -// Solidity: function checkpointBalanceExitedGwei(uint64 ) view returns(uint64) -func (_EigenPod *EigenPodCallerSession) CheckpointBalanceExitedGwei(arg0 uint64) (uint64, error) { - return _EigenPod.Contract.CheckpointBalanceExitedGwei(&_EigenPod.CallOpts, arg0) -} - -// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. -// -// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) -func (_EigenPod *EigenPodCaller) CurrentCheckpoint(opts *bind.CallOpts) (IEigenPodCheckpoint, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "currentCheckpoint") - - if err != nil { - return *new(IEigenPodCheckpoint), err - } - - out0 := *abi.ConvertType(out[0], new(IEigenPodCheckpoint)).(*IEigenPodCheckpoint) - - return out0, err - -} - -// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. -// -// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) -func (_EigenPod *EigenPodSession) CurrentCheckpoint() (IEigenPodCheckpoint, error) { - return _EigenPod.Contract.CurrentCheckpoint(&_EigenPod.CallOpts) -} - -// CurrentCheckpoint is a free data retrieval call binding the contract method 0x47d28372. -// -// Solidity: function currentCheckpoint() view returns((bytes32,uint24,uint64,int128)) -func (_EigenPod *EigenPodCallerSession) CurrentCheckpoint() (IEigenPodCheckpoint, error) { - return _EigenPod.Contract.CurrentCheckpoint(&_EigenPod.CallOpts) -} - -// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. -// -// Solidity: function currentCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodCaller) CurrentCheckpointTimestamp(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "currentCheckpointTimestamp") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. -// -// Solidity: function currentCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodSession) CurrentCheckpointTimestamp() (uint64, error) { - return _EigenPod.Contract.CurrentCheckpointTimestamp(&_EigenPod.CallOpts) -} - -// CurrentCheckpointTimestamp is a free data retrieval call binding the contract method 0x42ecff2a. -// -// Solidity: function currentCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodCallerSession) CurrentCheckpointTimestamp() (uint64, error) { - return _EigenPod.Contract.CurrentCheckpointTimestamp(&_EigenPod.CallOpts) -} - -// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. -// -// Solidity: function eigenPodManager() view returns(address) -func (_EigenPod *EigenPodCaller) EigenPodManager(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "eigenPodManager") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. -// -// Solidity: function eigenPodManager() view returns(address) -func (_EigenPod *EigenPodSession) EigenPodManager() (common.Address, error) { - return _EigenPod.Contract.EigenPodManager(&_EigenPod.CallOpts) -} - -// EigenPodManager is a free data retrieval call binding the contract method 0x4665bcda. -// -// Solidity: function eigenPodManager() view returns(address) -func (_EigenPod *EigenPodCallerSession) EigenPodManager() (common.Address, error) { - return _EigenPod.Contract.EigenPodManager(&_EigenPod.CallOpts) -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPod *EigenPodCaller) EthPOS(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "ethPOS") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPod *EigenPodSession) EthPOS() (common.Address, error) { - return _EigenPod.Contract.EthPOS(&_EigenPod.CallOpts) -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPod *EigenPodCallerSession) EthPOS() (common.Address, error) { - return _EigenPod.Contract.EthPOS(&_EigenPod.CallOpts) -} - -// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. -// -// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) -func (_EigenPod *EigenPodCaller) GetParentBlockRoot(opts *bind.CallOpts, timestamp uint64) ([32]byte, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "getParentBlockRoot", timestamp) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. -// -// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) -func (_EigenPod *EigenPodSession) GetParentBlockRoot(timestamp uint64) ([32]byte, error) { - return _EigenPod.Contract.GetParentBlockRoot(&_EigenPod.CallOpts, timestamp) -} - -// GetParentBlockRoot is a free data retrieval call binding the contract method 0x6c0d2d5a. -// -// Solidity: function getParentBlockRoot(uint64 timestamp) view returns(bytes32) -func (_EigenPod *EigenPodCallerSession) GetParentBlockRoot(timestamp uint64) ([32]byte, error) { - return _EigenPod.Contract.GetParentBlockRoot(&_EigenPod.CallOpts, timestamp) -} - -// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. -// -// Solidity: function lastCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodCaller) LastCheckpointTimestamp(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "lastCheckpointTimestamp") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. -// -// Solidity: function lastCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodSession) LastCheckpointTimestamp() (uint64, error) { - return _EigenPod.Contract.LastCheckpointTimestamp(&_EigenPod.CallOpts) -} - -// LastCheckpointTimestamp is a free data retrieval call binding the contract method 0xee94d67c. -// -// Solidity: function lastCheckpointTimestamp() view returns(uint64) -func (_EigenPod *EigenPodCallerSession) LastCheckpointTimestamp() (uint64, error) { - return _EigenPod.Contract.LastCheckpointTimestamp(&_EigenPod.CallOpts) -} - -// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. -// -// Solidity: function podOwner() view returns(address) -func (_EigenPod *EigenPodCaller) PodOwner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "podOwner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. -// -// Solidity: function podOwner() view returns(address) -func (_EigenPod *EigenPodSession) PodOwner() (common.Address, error) { - return _EigenPod.Contract.PodOwner(&_EigenPod.CallOpts) -} - -// PodOwner is a free data retrieval call binding the contract method 0x0b18ff66. -// -// Solidity: function podOwner() view returns(address) -func (_EigenPod *EigenPodCallerSession) PodOwner() (common.Address, error) { - return _EigenPod.Contract.PodOwner(&_EigenPod.CallOpts) -} - -// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. -// -// Solidity: function proofSubmitter() view returns(address) -func (_EigenPod *EigenPodCaller) ProofSubmitter(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "proofSubmitter") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. -// -// Solidity: function proofSubmitter() view returns(address) -func (_EigenPod *EigenPodSession) ProofSubmitter() (common.Address, error) { - return _EigenPod.Contract.ProofSubmitter(&_EigenPod.CallOpts) -} - -// ProofSubmitter is a free data retrieval call binding the contract method 0x58753357. -// -// Solidity: function proofSubmitter() view returns(address) -func (_EigenPod *EigenPodCallerSession) ProofSubmitter() (common.Address, error) { - return _EigenPod.Contract.ProofSubmitter(&_EigenPod.CallOpts) -} - -// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. -// -// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodCaller) ValidatorPubkeyHashToInfo(opts *bind.CallOpts, validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "validatorPubkeyHashToInfo", validatorPubkeyHash) - - if err != nil { - return *new(IEigenPodValidatorInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IEigenPodValidatorInfo)).(*IEigenPodValidatorInfo) - - return out0, err - -} - -// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. -// -// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodSession) ValidatorPubkeyHashToInfo(validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { - return _EigenPod.Contract.ValidatorPubkeyHashToInfo(&_EigenPod.CallOpts, validatorPubkeyHash) -} - -// ValidatorPubkeyHashToInfo is a free data retrieval call binding the contract method 0x6fcd0e53. -// -// Solidity: function validatorPubkeyHashToInfo(bytes32 validatorPubkeyHash) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodCallerSession) ValidatorPubkeyHashToInfo(validatorPubkeyHash [32]byte) (IEigenPodValidatorInfo, error) { - return _EigenPod.Contract.ValidatorPubkeyHashToInfo(&_EigenPod.CallOpts, validatorPubkeyHash) -} - -// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. -// -// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodCaller) ValidatorPubkeyToInfo(opts *bind.CallOpts, validatorPubkey []byte) (IEigenPodValidatorInfo, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "validatorPubkeyToInfo", validatorPubkey) - - if err != nil { - return *new(IEigenPodValidatorInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IEigenPodValidatorInfo)).(*IEigenPodValidatorInfo) - - return out0, err - -} - -// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. -// -// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodSession) ValidatorPubkeyToInfo(validatorPubkey []byte) (IEigenPodValidatorInfo, error) { - return _EigenPod.Contract.ValidatorPubkeyToInfo(&_EigenPod.CallOpts, validatorPubkey) -} - -// ValidatorPubkeyToInfo is a free data retrieval call binding the contract method 0xb522538a. -// -// Solidity: function validatorPubkeyToInfo(bytes validatorPubkey) view returns((uint64,uint64,uint64,uint8)) -func (_EigenPod *EigenPodCallerSession) ValidatorPubkeyToInfo(validatorPubkey []byte) (IEigenPodValidatorInfo, error) { - return _EigenPod.Contract.ValidatorPubkeyToInfo(&_EigenPod.CallOpts, validatorPubkey) -} - -// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. -// -// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) -func (_EigenPod *EigenPodCaller) ValidatorStatus(opts *bind.CallOpts, validatorPubkey []byte) (uint8, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "validatorStatus", validatorPubkey) - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. -// -// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) -func (_EigenPod *EigenPodSession) ValidatorStatus(validatorPubkey []byte) (uint8, error) { - return _EigenPod.Contract.ValidatorStatus(&_EigenPod.CallOpts, validatorPubkey) -} - -// ValidatorStatus is a free data retrieval call binding the contract method 0x58eaee79. -// -// Solidity: function validatorStatus(bytes validatorPubkey) view returns(uint8) -func (_EigenPod *EigenPodCallerSession) ValidatorStatus(validatorPubkey []byte) (uint8, error) { - return _EigenPod.Contract.ValidatorStatus(&_EigenPod.CallOpts, validatorPubkey) -} - -// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. -// -// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) -func (_EigenPod *EigenPodCaller) ValidatorStatus0(opts *bind.CallOpts, pubkeyHash [32]byte) (uint8, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "validatorStatus0", pubkeyHash) - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. -// -// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) -func (_EigenPod *EigenPodSession) ValidatorStatus0(pubkeyHash [32]byte) (uint8, error) { - return _EigenPod.Contract.ValidatorStatus0(&_EigenPod.CallOpts, pubkeyHash) -} - -// ValidatorStatus0 is a free data retrieval call binding the contract method 0x7439841f. -// -// Solidity: function validatorStatus(bytes32 pubkeyHash) view returns(uint8) -func (_EigenPod *EigenPodCallerSession) ValidatorStatus0(pubkeyHash [32]byte) (uint8, error) { - return _EigenPod.Contract.ValidatorStatus0(&_EigenPod.CallOpts, pubkeyHash) -} - -// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. -// -// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) -func (_EigenPod *EigenPodCaller) WithdrawableRestakedExecutionLayerGwei(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _EigenPod.contract.Call(opts, &out, "withdrawableRestakedExecutionLayerGwei") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. -// -// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) -func (_EigenPod *EigenPodSession) WithdrawableRestakedExecutionLayerGwei() (uint64, error) { - return _EigenPod.Contract.WithdrawableRestakedExecutionLayerGwei(&_EigenPod.CallOpts) -} - -// WithdrawableRestakedExecutionLayerGwei is a free data retrieval call binding the contract method 0x3474aa16. -// -// Solidity: function withdrawableRestakedExecutionLayerGwei() view returns(uint64) -func (_EigenPod *EigenPodCallerSession) WithdrawableRestakedExecutionLayerGwei() (uint64, error) { - return _EigenPod.Contract.WithdrawableRestakedExecutionLayerGwei(&_EigenPod.CallOpts) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _podOwner) returns() -func (_EigenPod *EigenPodTransactor) Initialize(opts *bind.TransactOpts, _podOwner common.Address) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "initialize", _podOwner) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _podOwner) returns() -func (_EigenPod *EigenPodSession) Initialize(_podOwner common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.Initialize(&_EigenPod.TransactOpts, _podOwner) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _podOwner) returns() -func (_EigenPod *EigenPodTransactorSession) Initialize(_podOwner common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.Initialize(&_EigenPod.TransactOpts, _podOwner) -} - -// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. -// -// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() -func (_EigenPod *EigenPodTransactor) RecoverTokens(opts *bind.TransactOpts, tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "recoverTokens", tokenList, amountsToWithdraw, recipient) -} - -// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. -// -// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() -func (_EigenPod *EigenPodSession) RecoverTokens(tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.RecoverTokens(&_EigenPod.TransactOpts, tokenList, amountsToWithdraw, recipient) -} - -// RecoverTokens is a paid mutator transaction binding the contract method 0xdda3346c. -// -// Solidity: function recoverTokens(address[] tokenList, uint256[] amountsToWithdraw, address recipient) returns() -func (_EigenPod *EigenPodTransactorSession) RecoverTokens(tokenList []common.Address, amountsToWithdraw []*big.Int, recipient common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.RecoverTokens(&_EigenPod.TransactOpts, tokenList, amountsToWithdraw, recipient) -} - -// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. -// -// Solidity: function setProofSubmitter(address newProofSubmitter) returns() -func (_EigenPod *EigenPodTransactor) SetProofSubmitter(opts *bind.TransactOpts, newProofSubmitter common.Address) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "setProofSubmitter", newProofSubmitter) -} - -// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. -// -// Solidity: function setProofSubmitter(address newProofSubmitter) returns() -func (_EigenPod *EigenPodSession) SetProofSubmitter(newProofSubmitter common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.SetProofSubmitter(&_EigenPod.TransactOpts, newProofSubmitter) -} - -// SetProofSubmitter is a paid mutator transaction binding the contract method 0xd06d5587. -// -// Solidity: function setProofSubmitter(address newProofSubmitter) returns() -func (_EigenPod *EigenPodTransactorSession) SetProofSubmitter(newProofSubmitter common.Address) (*types.Transaction, error) { - return _EigenPod.Contract.SetProofSubmitter(&_EigenPod.TransactOpts, newProofSubmitter) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPod *EigenPodTransactor) Stake(opts *bind.TransactOpts, pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "stake", pubkey, signature, depositDataRoot) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPod *EigenPodSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPod.Contract.Stake(&_EigenPod.TransactOpts, pubkey, signature, depositDataRoot) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPod *EigenPodTransactorSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPod.Contract.Stake(&_EigenPod.TransactOpts, pubkey, signature, depositDataRoot) -} - -// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. -// -// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() -func (_EigenPod *EigenPodTransactor) StartCheckpoint(opts *bind.TransactOpts, revertIfNoBalance bool) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "startCheckpoint", revertIfNoBalance) -} - -// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. -// -// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() -func (_EigenPod *EigenPodSession) StartCheckpoint(revertIfNoBalance bool) (*types.Transaction, error) { - return _EigenPod.Contract.StartCheckpoint(&_EigenPod.TransactOpts, revertIfNoBalance) -} - -// StartCheckpoint is a paid mutator transaction binding the contract method 0x88676cad. -// -// Solidity: function startCheckpoint(bool revertIfNoBalance) returns() -func (_EigenPod *EigenPodTransactorSession) StartCheckpoint(revertIfNoBalance bool) (*types.Transaction, error) { - return _EigenPod.Contract.StartCheckpoint(&_EigenPod.TransactOpts, revertIfNoBalance) -} - -// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. -// -// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() -func (_EigenPod *EigenPodTransactor) VerifyCheckpointProofs(opts *bind.TransactOpts, balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "verifyCheckpointProofs", balanceContainerProof, proofs) -} - -// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. -// -// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() -func (_EigenPod *EigenPodSession) VerifyCheckpointProofs(balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyCheckpointProofs(&_EigenPod.TransactOpts, balanceContainerProof, proofs) -} - -// VerifyCheckpointProofs is a paid mutator transaction binding the contract method 0xf074ba62. -// -// Solidity: function verifyCheckpointProofs((bytes32,bytes) balanceContainerProof, (bytes32,bytes32,bytes)[] proofs) returns() -func (_EigenPod *EigenPodTransactorSession) VerifyCheckpointProofs(balanceContainerProof BeaconChainProofsBalanceContainerProof, proofs []BeaconChainProofsBalanceProof) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyCheckpointProofs(&_EigenPod.TransactOpts, balanceContainerProof, proofs) -} - -// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. -// -// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() -func (_EigenPod *EigenPodTransactor) VerifyStaleBalance(opts *bind.TransactOpts, beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "verifyStaleBalance", beaconTimestamp, stateRootProof, proof) -} - -// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. -// -// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() -func (_EigenPod *EigenPodSession) VerifyStaleBalance(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyStaleBalance(&_EigenPod.TransactOpts, beaconTimestamp, stateRootProof, proof) -} - -// VerifyStaleBalance is a paid mutator transaction binding the contract method 0x039157d2. -// -// Solidity: function verifyStaleBalance(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, (bytes32[],bytes) proof) returns() -func (_EigenPod *EigenPodTransactorSession) VerifyStaleBalance(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, proof BeaconChainProofsValidatorProof) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyStaleBalance(&_EigenPod.TransactOpts, beaconTimestamp, stateRootProof, proof) -} - -// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. -// -// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() -func (_EigenPod *EigenPodTransactor) VerifyWithdrawalCredentials(opts *bind.TransactOpts, beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "verifyWithdrawalCredentials", beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) -} - -// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. -// -// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() -func (_EigenPod *EigenPodSession) VerifyWithdrawalCredentials(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyWithdrawalCredentials(&_EigenPod.TransactOpts, beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) -} - -// VerifyWithdrawalCredentials is a paid mutator transaction binding the contract method 0x3f65cf19. -// -// Solidity: function verifyWithdrawalCredentials(uint64 beaconTimestamp, (bytes32,bytes) stateRootProof, uint40[] validatorIndices, bytes[] validatorFieldsProofs, bytes32[][] validatorFields) returns() -func (_EigenPod *EigenPodTransactorSession) VerifyWithdrawalCredentials(beaconTimestamp uint64, stateRootProof BeaconChainProofsStateRootProof, validatorIndices []*big.Int, validatorFieldsProofs [][]byte, validatorFields [][][32]byte) (*types.Transaction, error) { - return _EigenPod.Contract.VerifyWithdrawalCredentials(&_EigenPod.TransactOpts, beaconTimestamp, stateRootProof, validatorIndices, validatorFieldsProofs, validatorFields) -} - -// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. -// -// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amountWei) returns() -func (_EigenPod *EigenPodTransactor) WithdrawRestakedBeaconChainETH(opts *bind.TransactOpts, recipient common.Address, amountWei *big.Int) (*types.Transaction, error) { - return _EigenPod.contract.Transact(opts, "withdrawRestakedBeaconChainETH", recipient, amountWei) -} - -// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. -// -// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amountWei) returns() -func (_EigenPod *EigenPodSession) WithdrawRestakedBeaconChainETH(recipient common.Address, amountWei *big.Int) (*types.Transaction, error) { - return _EigenPod.Contract.WithdrawRestakedBeaconChainETH(&_EigenPod.TransactOpts, recipient, amountWei) -} - -// WithdrawRestakedBeaconChainETH is a paid mutator transaction binding the contract method 0xc4907442. -// -// Solidity: function withdrawRestakedBeaconChainETH(address recipient, uint256 amountWei) returns() -func (_EigenPod *EigenPodTransactorSession) WithdrawRestakedBeaconChainETH(recipient common.Address, amountWei *big.Int) (*types.Transaction, error) { - return _EigenPod.Contract.WithdrawRestakedBeaconChainETH(&_EigenPod.TransactOpts, recipient, amountWei) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_EigenPod *EigenPodTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPod.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_EigenPod *EigenPodSession) Receive() (*types.Transaction, error) { - return _EigenPod.Contract.Receive(&_EigenPod.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_EigenPod *EigenPodTransactorSession) Receive() (*types.Transaction, error) { - return _EigenPod.Contract.Receive(&_EigenPod.TransactOpts) -} - -// EigenPodCheckpointCreatedIterator is returned from FilterCheckpointCreated and is used to iterate over the raw logs and unpacked data for CheckpointCreated events raised by the EigenPod contract. -type EigenPodCheckpointCreatedIterator struct { - Event *EigenPodCheckpointCreated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodCheckpointCreatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodCheckpointCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodCheckpointCreated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodCheckpointCreatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodCheckpointCreatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodCheckpointCreated represents a CheckpointCreated event raised by the EigenPod contract. -type EigenPodCheckpointCreated struct { - CheckpointTimestamp uint64 - BeaconBlockRoot [32]byte - ValidatorCount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCheckpointCreated is a free log retrieval operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. -// -// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) -func (_EigenPod *EigenPodFilterer) FilterCheckpointCreated(opts *bind.FilterOpts, checkpointTimestamp []uint64, beaconBlockRoot [][32]byte) (*EigenPodCheckpointCreatedIterator, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var beaconBlockRootRule []interface{} - for _, beaconBlockRootItem := range beaconBlockRoot { - beaconBlockRootRule = append(beaconBlockRootRule, beaconBlockRootItem) - } - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "CheckpointCreated", checkpointTimestampRule, beaconBlockRootRule) - if err != nil { - return nil, err - } - return &EigenPodCheckpointCreatedIterator{contract: _EigenPod.contract, event: "CheckpointCreated", logs: logs, sub: sub}, nil -} - -// WatchCheckpointCreated is a free log subscription operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. -// -// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) -func (_EigenPod *EigenPodFilterer) WatchCheckpointCreated(opts *bind.WatchOpts, sink chan<- *EigenPodCheckpointCreated, checkpointTimestamp []uint64, beaconBlockRoot [][32]byte) (event.Subscription, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var beaconBlockRootRule []interface{} - for _, beaconBlockRootItem := range beaconBlockRoot { - beaconBlockRootRule = append(beaconBlockRootRule, beaconBlockRootItem) - } - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "CheckpointCreated", checkpointTimestampRule, beaconBlockRootRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodCheckpointCreated) - if err := _EigenPod.contract.UnpackLog(event, "CheckpointCreated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseCheckpointCreated is a log parse operation binding the contract event 0x575796133bbed337e5b39aa49a30dc2556a91e0c6c2af4b7b886ae77ebef1076. -// -// Solidity: event CheckpointCreated(uint64 indexed checkpointTimestamp, bytes32 indexed beaconBlockRoot, uint256 validatorCount) -func (_EigenPod *EigenPodFilterer) ParseCheckpointCreated(log types.Log) (*EigenPodCheckpointCreated, error) { - event := new(EigenPodCheckpointCreated) - if err := _EigenPod.contract.UnpackLog(event, "CheckpointCreated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodCheckpointFinalizedIterator is returned from FilterCheckpointFinalized and is used to iterate over the raw logs and unpacked data for CheckpointFinalized events raised by the EigenPod contract. -type EigenPodCheckpointFinalizedIterator struct { - Event *EigenPodCheckpointFinalized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodCheckpointFinalizedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodCheckpointFinalized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodCheckpointFinalized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodCheckpointFinalizedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodCheckpointFinalizedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodCheckpointFinalized represents a CheckpointFinalized event raised by the EigenPod contract. -type EigenPodCheckpointFinalized struct { - CheckpointTimestamp uint64 - TotalShareDeltaWei *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCheckpointFinalized is a free log retrieval operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. -// -// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) -func (_EigenPod *EigenPodFilterer) FilterCheckpointFinalized(opts *bind.FilterOpts, checkpointTimestamp []uint64) (*EigenPodCheckpointFinalizedIterator, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "CheckpointFinalized", checkpointTimestampRule) - if err != nil { - return nil, err - } - return &EigenPodCheckpointFinalizedIterator{contract: _EigenPod.contract, event: "CheckpointFinalized", logs: logs, sub: sub}, nil -} - -// WatchCheckpointFinalized is a free log subscription operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. -// -// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) -func (_EigenPod *EigenPodFilterer) WatchCheckpointFinalized(opts *bind.WatchOpts, sink chan<- *EigenPodCheckpointFinalized, checkpointTimestamp []uint64) (event.Subscription, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "CheckpointFinalized", checkpointTimestampRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodCheckpointFinalized) - if err := _EigenPod.contract.UnpackLog(event, "CheckpointFinalized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseCheckpointFinalized is a log parse operation binding the contract event 0x525408c201bc1576eb44116f6478f1c2a54775b19a043bcfdc708364f74f8e44. -// -// Solidity: event CheckpointFinalized(uint64 indexed checkpointTimestamp, int256 totalShareDeltaWei) -func (_EigenPod *EigenPodFilterer) ParseCheckpointFinalized(log types.Log) (*EigenPodCheckpointFinalized, error) { - event := new(EigenPodCheckpointFinalized) - if err := _EigenPod.contract.UnpackLog(event, "CheckpointFinalized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodEigenPodStakedIterator is returned from FilterEigenPodStaked and is used to iterate over the raw logs and unpacked data for EigenPodStaked events raised by the EigenPod contract. -type EigenPodEigenPodStakedIterator struct { - Event *EigenPodEigenPodStaked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodEigenPodStakedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodEigenPodStaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodEigenPodStaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodEigenPodStakedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodEigenPodStakedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodEigenPodStaked represents a EigenPodStaked event raised by the EigenPod contract. -type EigenPodEigenPodStaked struct { - Pubkey []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterEigenPodStaked is a free log retrieval operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. -// -// Solidity: event EigenPodStaked(bytes pubkey) -func (_EigenPod *EigenPodFilterer) FilterEigenPodStaked(opts *bind.FilterOpts) (*EigenPodEigenPodStakedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "EigenPodStaked") - if err != nil { - return nil, err - } - return &EigenPodEigenPodStakedIterator{contract: _EigenPod.contract, event: "EigenPodStaked", logs: logs, sub: sub}, nil -} - -// WatchEigenPodStaked is a free log subscription operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. -// -// Solidity: event EigenPodStaked(bytes pubkey) -func (_EigenPod *EigenPodFilterer) WatchEigenPodStaked(opts *bind.WatchOpts, sink chan<- *EigenPodEigenPodStaked) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "EigenPodStaked") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodEigenPodStaked) - if err := _EigenPod.contract.UnpackLog(event, "EigenPodStaked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseEigenPodStaked is a log parse operation binding the contract event 0x606865b7934a25d4aed43f6cdb426403353fa4b3009c4d228407474581b01e23. -// -// Solidity: event EigenPodStaked(bytes pubkey) -func (_EigenPod *EigenPodFilterer) ParseEigenPodStaked(log types.Log) (*EigenPodEigenPodStaked, error) { - event := new(EigenPodEigenPodStaked) - if err := _EigenPod.contract.UnpackLog(event, "EigenPodStaked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the EigenPod contract. -type EigenPodInitializedIterator struct { - Event *EigenPodInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodInitializedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodInitialized represents a Initialized event raised by the EigenPod contract. -type EigenPodInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPod *EigenPodFilterer) FilterInitialized(opts *bind.FilterOpts) (*EigenPodInitializedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &EigenPodInitializedIterator{contract: _EigenPod.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPod *EigenPodFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EigenPodInitialized) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodInitialized) - if err := _EigenPod.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPod *EigenPodFilterer) ParseInitialized(log types.Log) (*EigenPodInitialized, error) { - event := new(EigenPodInitialized) - if err := _EigenPod.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodNonBeaconChainETHReceivedIterator is returned from FilterNonBeaconChainETHReceived and is used to iterate over the raw logs and unpacked data for NonBeaconChainETHReceived events raised by the EigenPod contract. -type EigenPodNonBeaconChainETHReceivedIterator struct { - Event *EigenPodNonBeaconChainETHReceived // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodNonBeaconChainETHReceivedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodNonBeaconChainETHReceived) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodNonBeaconChainETHReceived) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodNonBeaconChainETHReceivedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodNonBeaconChainETHReceivedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodNonBeaconChainETHReceived represents a NonBeaconChainETHReceived event raised by the EigenPod contract. -type EigenPodNonBeaconChainETHReceived struct { - AmountReceived *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNonBeaconChainETHReceived is a free log retrieval operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. -// -// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) -func (_EigenPod *EigenPodFilterer) FilterNonBeaconChainETHReceived(opts *bind.FilterOpts) (*EigenPodNonBeaconChainETHReceivedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "NonBeaconChainETHReceived") - if err != nil { - return nil, err - } - return &EigenPodNonBeaconChainETHReceivedIterator{contract: _EigenPod.contract, event: "NonBeaconChainETHReceived", logs: logs, sub: sub}, nil -} - -// WatchNonBeaconChainETHReceived is a free log subscription operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. -// -// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) -func (_EigenPod *EigenPodFilterer) WatchNonBeaconChainETHReceived(opts *bind.WatchOpts, sink chan<- *EigenPodNonBeaconChainETHReceived) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "NonBeaconChainETHReceived") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodNonBeaconChainETHReceived) - if err := _EigenPod.contract.UnpackLog(event, "NonBeaconChainETHReceived", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseNonBeaconChainETHReceived is a log parse operation binding the contract event 0x6fdd3dbdb173299608c0aa9f368735857c8842b581f8389238bf05bd04b3bf49. -// -// Solidity: event NonBeaconChainETHReceived(uint256 amountReceived) -func (_EigenPod *EigenPodFilterer) ParseNonBeaconChainETHReceived(log types.Log) (*EigenPodNonBeaconChainETHReceived, error) { - event := new(EigenPodNonBeaconChainETHReceived) - if err := _EigenPod.contract.UnpackLog(event, "NonBeaconChainETHReceived", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodProofSubmitterUpdatedIterator is returned from FilterProofSubmitterUpdated and is used to iterate over the raw logs and unpacked data for ProofSubmitterUpdated events raised by the EigenPod contract. -type EigenPodProofSubmitterUpdatedIterator struct { - Event *EigenPodProofSubmitterUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodProofSubmitterUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodProofSubmitterUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodProofSubmitterUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodProofSubmitterUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodProofSubmitterUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodProofSubmitterUpdated represents a ProofSubmitterUpdated event raised by the EigenPod contract. -type EigenPodProofSubmitterUpdated struct { - PrevProofSubmitter common.Address - NewProofSubmitter common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterProofSubmitterUpdated is a free log retrieval operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. -// -// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) -func (_EigenPod *EigenPodFilterer) FilterProofSubmitterUpdated(opts *bind.FilterOpts) (*EigenPodProofSubmitterUpdatedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "ProofSubmitterUpdated") - if err != nil { - return nil, err - } - return &EigenPodProofSubmitterUpdatedIterator{contract: _EigenPod.contract, event: "ProofSubmitterUpdated", logs: logs, sub: sub}, nil -} - -// WatchProofSubmitterUpdated is a free log subscription operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. -// -// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) -func (_EigenPod *EigenPodFilterer) WatchProofSubmitterUpdated(opts *bind.WatchOpts, sink chan<- *EigenPodProofSubmitterUpdated) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "ProofSubmitterUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodProofSubmitterUpdated) - if err := _EigenPod.contract.UnpackLog(event, "ProofSubmitterUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseProofSubmitterUpdated is a log parse operation binding the contract event 0xfb8129080a19d34dceac04ba253fc50304dc86c729bd63cdca4a969ad19a5eac. -// -// Solidity: event ProofSubmitterUpdated(address prevProofSubmitter, address newProofSubmitter) -func (_EigenPod *EigenPodFilterer) ParseProofSubmitterUpdated(log types.Log) (*EigenPodProofSubmitterUpdated, error) { - event := new(EigenPodProofSubmitterUpdated) - if err := _EigenPod.contract.UnpackLog(event, "ProofSubmitterUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodRestakedBeaconChainETHWithdrawnIterator is returned from FilterRestakedBeaconChainETHWithdrawn and is used to iterate over the raw logs and unpacked data for RestakedBeaconChainETHWithdrawn events raised by the EigenPod contract. -type EigenPodRestakedBeaconChainETHWithdrawnIterator struct { - Event *EigenPodRestakedBeaconChainETHWithdrawn // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodRestakedBeaconChainETHWithdrawnIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodRestakedBeaconChainETHWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodRestakedBeaconChainETHWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodRestakedBeaconChainETHWithdrawnIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodRestakedBeaconChainETHWithdrawnIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodRestakedBeaconChainETHWithdrawn represents a RestakedBeaconChainETHWithdrawn event raised by the EigenPod contract. -type EigenPodRestakedBeaconChainETHWithdrawn struct { - Recipient common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRestakedBeaconChainETHWithdrawn is a free log retrieval operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. -// -// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) -func (_EigenPod *EigenPodFilterer) FilterRestakedBeaconChainETHWithdrawn(opts *bind.FilterOpts, recipient []common.Address) (*EigenPodRestakedBeaconChainETHWithdrawnIterator, error) { - - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "RestakedBeaconChainETHWithdrawn", recipientRule) - if err != nil { - return nil, err - } - return &EigenPodRestakedBeaconChainETHWithdrawnIterator{contract: _EigenPod.contract, event: "RestakedBeaconChainETHWithdrawn", logs: logs, sub: sub}, nil -} - -// WatchRestakedBeaconChainETHWithdrawn is a free log subscription operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. -// -// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) -func (_EigenPod *EigenPodFilterer) WatchRestakedBeaconChainETHWithdrawn(opts *bind.WatchOpts, sink chan<- *EigenPodRestakedBeaconChainETHWithdrawn, recipient []common.Address) (event.Subscription, error) { - - var recipientRule []interface{} - for _, recipientItem := range recipient { - recipientRule = append(recipientRule, recipientItem) - } - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "RestakedBeaconChainETHWithdrawn", recipientRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodRestakedBeaconChainETHWithdrawn) - if err := _EigenPod.contract.UnpackLog(event, "RestakedBeaconChainETHWithdrawn", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRestakedBeaconChainETHWithdrawn is a log parse operation binding the contract event 0x8947fd2ce07ef9cc302c4e8f0461015615d91ce851564839e91cc804c2f49d8e. -// -// Solidity: event RestakedBeaconChainETHWithdrawn(address indexed recipient, uint256 amount) -func (_EigenPod *EigenPodFilterer) ParseRestakedBeaconChainETHWithdrawn(log types.Log) (*EigenPodRestakedBeaconChainETHWithdrawn, error) { - event := new(EigenPodRestakedBeaconChainETHWithdrawn) - if err := _EigenPod.contract.UnpackLog(event, "RestakedBeaconChainETHWithdrawn", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodValidatorBalanceUpdatedIterator is returned from FilterValidatorBalanceUpdated and is used to iterate over the raw logs and unpacked data for ValidatorBalanceUpdated events raised by the EigenPod contract. -type EigenPodValidatorBalanceUpdatedIterator struct { - Event *EigenPodValidatorBalanceUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodValidatorBalanceUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorBalanceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorBalanceUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodValidatorBalanceUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodValidatorBalanceUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodValidatorBalanceUpdated represents a ValidatorBalanceUpdated event raised by the EigenPod contract. -type EigenPodValidatorBalanceUpdated struct { - ValidatorIndex *big.Int - BalanceTimestamp uint64 - NewValidatorBalanceGwei uint64 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterValidatorBalanceUpdated is a free log retrieval operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. -// -// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) -func (_EigenPod *EigenPodFilterer) FilterValidatorBalanceUpdated(opts *bind.FilterOpts) (*EigenPodValidatorBalanceUpdatedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "ValidatorBalanceUpdated") - if err != nil { - return nil, err - } - return &EigenPodValidatorBalanceUpdatedIterator{contract: _EigenPod.contract, event: "ValidatorBalanceUpdated", logs: logs, sub: sub}, nil -} - -// WatchValidatorBalanceUpdated is a free log subscription operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. -// -// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) -func (_EigenPod *EigenPodFilterer) WatchValidatorBalanceUpdated(opts *bind.WatchOpts, sink chan<- *EigenPodValidatorBalanceUpdated) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "ValidatorBalanceUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodValidatorBalanceUpdated) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorBalanceUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseValidatorBalanceUpdated is a log parse operation binding the contract event 0x0e5fac175b83177cc047381e030d8fb3b42b37bd1c025e22c280facad62c32df. -// -// Solidity: event ValidatorBalanceUpdated(uint40 validatorIndex, uint64 balanceTimestamp, uint64 newValidatorBalanceGwei) -func (_EigenPod *EigenPodFilterer) ParseValidatorBalanceUpdated(log types.Log) (*EigenPodValidatorBalanceUpdated, error) { - event := new(EigenPodValidatorBalanceUpdated) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorBalanceUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodValidatorCheckpointedIterator is returned from FilterValidatorCheckpointed and is used to iterate over the raw logs and unpacked data for ValidatorCheckpointed events raised by the EigenPod contract. -type EigenPodValidatorCheckpointedIterator struct { - Event *EigenPodValidatorCheckpointed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodValidatorCheckpointedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorCheckpointed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorCheckpointed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodValidatorCheckpointedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodValidatorCheckpointedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodValidatorCheckpointed represents a ValidatorCheckpointed event raised by the EigenPod contract. -type EigenPodValidatorCheckpointed struct { - CheckpointTimestamp uint64 - ValidatorIndex *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterValidatorCheckpointed is a free log retrieval operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. -// -// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) FilterValidatorCheckpointed(opts *bind.FilterOpts, checkpointTimestamp []uint64, validatorIndex []*big.Int) (*EigenPodValidatorCheckpointedIterator, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var validatorIndexRule []interface{} - for _, validatorIndexItem := range validatorIndex { - validatorIndexRule = append(validatorIndexRule, validatorIndexItem) - } - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "ValidatorCheckpointed", checkpointTimestampRule, validatorIndexRule) - if err != nil { - return nil, err - } - return &EigenPodValidatorCheckpointedIterator{contract: _EigenPod.contract, event: "ValidatorCheckpointed", logs: logs, sub: sub}, nil -} - -// WatchValidatorCheckpointed is a free log subscription operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. -// -// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) WatchValidatorCheckpointed(opts *bind.WatchOpts, sink chan<- *EigenPodValidatorCheckpointed, checkpointTimestamp []uint64, validatorIndex []*big.Int) (event.Subscription, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var validatorIndexRule []interface{} - for _, validatorIndexItem := range validatorIndex { - validatorIndexRule = append(validatorIndexRule, validatorIndexItem) - } - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "ValidatorCheckpointed", checkpointTimestampRule, validatorIndexRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodValidatorCheckpointed) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorCheckpointed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseValidatorCheckpointed is a log parse operation binding the contract event 0xa91c59033c3423e18b54d0acecebb4972f9ea95aedf5f4cae3b677b02eaf3a3f. -// -// Solidity: event ValidatorCheckpointed(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) ParseValidatorCheckpointed(log types.Log) (*EigenPodValidatorCheckpointed, error) { - event := new(EigenPodValidatorCheckpointed) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorCheckpointed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodValidatorRestakedIterator is returned from FilterValidatorRestaked and is used to iterate over the raw logs and unpacked data for ValidatorRestaked events raised by the EigenPod contract. -type EigenPodValidatorRestakedIterator struct { - Event *EigenPodValidatorRestaked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodValidatorRestakedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorRestaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorRestaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodValidatorRestakedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodValidatorRestakedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodValidatorRestaked represents a ValidatorRestaked event raised by the EigenPod contract. -type EigenPodValidatorRestaked struct { - ValidatorIndex *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterValidatorRestaked is a free log retrieval operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. -// -// Solidity: event ValidatorRestaked(uint40 validatorIndex) -func (_EigenPod *EigenPodFilterer) FilterValidatorRestaked(opts *bind.FilterOpts) (*EigenPodValidatorRestakedIterator, error) { - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "ValidatorRestaked") - if err != nil { - return nil, err - } - return &EigenPodValidatorRestakedIterator{contract: _EigenPod.contract, event: "ValidatorRestaked", logs: logs, sub: sub}, nil -} - -// WatchValidatorRestaked is a free log subscription operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. -// -// Solidity: event ValidatorRestaked(uint40 validatorIndex) -func (_EigenPod *EigenPodFilterer) WatchValidatorRestaked(opts *bind.WatchOpts, sink chan<- *EigenPodValidatorRestaked) (event.Subscription, error) { - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "ValidatorRestaked") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodValidatorRestaked) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorRestaked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseValidatorRestaked is a log parse operation binding the contract event 0x2d0800bbc377ea54a08c5db6a87aafff5e3e9c8fead0eda110e40e0c10441449. -// -// Solidity: event ValidatorRestaked(uint40 validatorIndex) -func (_EigenPod *EigenPodFilterer) ParseValidatorRestaked(log types.Log) (*EigenPodValidatorRestaked, error) { - event := new(EigenPodValidatorRestaked) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorRestaked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodValidatorWithdrawnIterator is returned from FilterValidatorWithdrawn and is used to iterate over the raw logs and unpacked data for ValidatorWithdrawn events raised by the EigenPod contract. -type EigenPodValidatorWithdrawnIterator struct { - Event *EigenPodValidatorWithdrawn // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodValidatorWithdrawnIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodValidatorWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodValidatorWithdrawnIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodValidatorWithdrawnIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodValidatorWithdrawn represents a ValidatorWithdrawn event raised by the EigenPod contract. -type EigenPodValidatorWithdrawn struct { - CheckpointTimestamp uint64 - ValidatorIndex *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterValidatorWithdrawn is a free log retrieval operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. -// -// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) FilterValidatorWithdrawn(opts *bind.FilterOpts, checkpointTimestamp []uint64, validatorIndex []*big.Int) (*EigenPodValidatorWithdrawnIterator, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var validatorIndexRule []interface{} - for _, validatorIndexItem := range validatorIndex { - validatorIndexRule = append(validatorIndexRule, validatorIndexItem) - } - - logs, sub, err := _EigenPod.contract.FilterLogs(opts, "ValidatorWithdrawn", checkpointTimestampRule, validatorIndexRule) - if err != nil { - return nil, err - } - return &EigenPodValidatorWithdrawnIterator{contract: _EigenPod.contract, event: "ValidatorWithdrawn", logs: logs, sub: sub}, nil -} - -// WatchValidatorWithdrawn is a free log subscription operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. -// -// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) WatchValidatorWithdrawn(opts *bind.WatchOpts, sink chan<- *EigenPodValidatorWithdrawn, checkpointTimestamp []uint64, validatorIndex []*big.Int) (event.Subscription, error) { - - var checkpointTimestampRule []interface{} - for _, checkpointTimestampItem := range checkpointTimestamp { - checkpointTimestampRule = append(checkpointTimestampRule, checkpointTimestampItem) - } - var validatorIndexRule []interface{} - for _, validatorIndexItem := range validatorIndex { - validatorIndexRule = append(validatorIndexRule, validatorIndexItem) - } - - logs, sub, err := _EigenPod.contract.WatchLogs(opts, "ValidatorWithdrawn", checkpointTimestampRule, validatorIndexRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodValidatorWithdrawn) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorWithdrawn", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseValidatorWithdrawn is a log parse operation binding the contract event 0x2a02361ffa66cf2c2da4682c2355a6adcaa9f6c227b6e6563e68480f9587626a. -// -// Solidity: event ValidatorWithdrawn(uint64 indexed checkpointTimestamp, uint40 indexed validatorIndex) -func (_EigenPod *EigenPodFilterer) ParseValidatorWithdrawn(log types.Log) (*EigenPodValidatorWithdrawn, error) { - event := new(EigenPodValidatorWithdrawn) - if err := _EigenPod.contract.UnpackLog(event, "ValidatorWithdrawn", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/cli/core/onchain/EigenPodManager.go b/cli/core/onchain/EigenPodManager.go deleted file mode 100644 index 8878bb32..00000000 --- a/cli/core/onchain/EigenPodManager.go +++ /dev/null @@ -1,2368 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package onchain - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// EigenPodManagerMetaData contains all meta data concerning the EigenPodManager contract. -var EigenPodManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ethPOS\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"},{\"name\":\"_eigenPodBeacon\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"},{\"name\":\"_strategyManager\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"},{\"name\":\"_slasher\",\"type\":\"address\",\"internalType\":\"contractISlasher\"},{\"name\":\"_delegationManager\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"addShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"beaconChainETHStrategy\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategy\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"createPod\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"delegationManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIDelegationManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"eigenPodBeacon\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBeacon\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ethPOS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIETHPOSDeposit\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasPod\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_pauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"_initPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"numPods\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownerToPod\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEigenPod\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"pauseAll\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pauserRegistry\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"podOwnerShares\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recordBeaconChainETHBalanceUpdate\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"internalType\":\"int256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPauserRegistry\",\"inputs\":[{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"internalType\":\"contractIPauserRegistry\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"slasher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISlasher\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"stake\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"depositDataRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"strategyManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIStrategyManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdrawSharesAsTokens\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"destination\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"BeaconChainETHDeposited\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"BeaconChainETHWithdrawalCompleted\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint96\",\"indexed\":false,\"internalType\":\"uint96\"},{\"name\":\"delegatedAddress\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"withdrawalRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewTotalShares\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newTotalShares\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PauserRegistrySet\",\"inputs\":[{\"name\":\"pauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"},{\"name\":\"newPauserRegistry\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"contractIPauserRegistry\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodDeployed\",\"inputs\":[{\"name\":\"eigenPod\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"PodSharesUpdated\",\"inputs\":[{\"name\":\"podOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"sharesDelta\",\"type\":\"int256\",\"indexed\":false,\"internalType\":\"int256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newPausedStatus\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", -} - -// EigenPodManagerABI is the input ABI used to generate the binding from. -// Deprecated: Use EigenPodManagerMetaData.ABI instead. -var EigenPodManagerABI = EigenPodManagerMetaData.ABI - -// EigenPodManager is an auto generated Go binding around an Ethereum contract. -type EigenPodManager struct { - EigenPodManagerCaller // Read-only binding to the contract - EigenPodManagerTransactor // Write-only binding to the contract - EigenPodManagerFilterer // Log filterer for contract events -} - -// EigenPodManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type EigenPodManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type EigenPodManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type EigenPodManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EigenPodManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type EigenPodManagerSession struct { - Contract *EigenPodManager // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EigenPodManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type EigenPodManagerCallerSession struct { - Contract *EigenPodManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// EigenPodManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type EigenPodManagerTransactorSession struct { - Contract *EigenPodManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EigenPodManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type EigenPodManagerRaw struct { - Contract *EigenPodManager // Generic contract binding to access the raw methods on -} - -// EigenPodManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type EigenPodManagerCallerRaw struct { - Contract *EigenPodManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// EigenPodManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type EigenPodManagerTransactorRaw struct { - Contract *EigenPodManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewEigenPodManager creates a new instance of EigenPodManager, bound to a specific deployed contract. -func NewEigenPodManager(address common.Address, backend bind.ContractBackend) (*EigenPodManager, error) { - contract, err := bindEigenPodManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &EigenPodManager{EigenPodManagerCaller: EigenPodManagerCaller{contract: contract}, EigenPodManagerTransactor: EigenPodManagerTransactor{contract: contract}, EigenPodManagerFilterer: EigenPodManagerFilterer{contract: contract}}, nil -} - -// NewEigenPodManagerCaller creates a new read-only instance of EigenPodManager, bound to a specific deployed contract. -func NewEigenPodManagerCaller(address common.Address, caller bind.ContractCaller) (*EigenPodManagerCaller, error) { - contract, err := bindEigenPodManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &EigenPodManagerCaller{contract: contract}, nil -} - -// NewEigenPodManagerTransactor creates a new write-only instance of EigenPodManager, bound to a specific deployed contract. -func NewEigenPodManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*EigenPodManagerTransactor, error) { - contract, err := bindEigenPodManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &EigenPodManagerTransactor{contract: contract}, nil -} - -// NewEigenPodManagerFilterer creates a new log filterer instance of EigenPodManager, bound to a specific deployed contract. -func NewEigenPodManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*EigenPodManagerFilterer, error) { - contract, err := bindEigenPodManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &EigenPodManagerFilterer{contract: contract}, nil -} - -// bindEigenPodManager binds a generic wrapper to an already deployed contract. -func bindEigenPodManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := EigenPodManagerMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EigenPodManager *EigenPodManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EigenPodManager.Contract.EigenPodManagerCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EigenPodManager *EigenPodManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPodManager.Contract.EigenPodManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EigenPodManager *EigenPodManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EigenPodManager.Contract.EigenPodManagerTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EigenPodManager *EigenPodManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EigenPodManager.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EigenPodManager *EigenPodManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPodManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EigenPodManager *EigenPodManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EigenPodManager.Contract.contract.Transact(opts, method, params...) -} - -// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. -// -// Solidity: function beaconChainETHStrategy() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) BeaconChainETHStrategy(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "beaconChainETHStrategy") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. -// -// Solidity: function beaconChainETHStrategy() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) BeaconChainETHStrategy() (common.Address, error) { - return _EigenPodManager.Contract.BeaconChainETHStrategy(&_EigenPodManager.CallOpts) -} - -// BeaconChainETHStrategy is a free data retrieval call binding the contract method 0x9104c319. -// -// Solidity: function beaconChainETHStrategy() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) BeaconChainETHStrategy() (common.Address, error) { - return _EigenPodManager.Contract.BeaconChainETHStrategy(&_EigenPodManager.CallOpts) -} - -// DelegationManager is a free data retrieval call binding the contract method 0xea4d3c9b. -// -// Solidity: function delegationManager() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) DelegationManager(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "delegationManager") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// DelegationManager is a free data retrieval call binding the contract method 0xea4d3c9b. -// -// Solidity: function delegationManager() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) DelegationManager() (common.Address, error) { - return _EigenPodManager.Contract.DelegationManager(&_EigenPodManager.CallOpts) -} - -// DelegationManager is a free data retrieval call binding the contract method 0xea4d3c9b. -// -// Solidity: function delegationManager() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) DelegationManager() (common.Address, error) { - return _EigenPodManager.Contract.DelegationManager(&_EigenPodManager.CallOpts) -} - -// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. -// -// Solidity: function eigenPodBeacon() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) EigenPodBeacon(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "eigenPodBeacon") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. -// -// Solidity: function eigenPodBeacon() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) EigenPodBeacon() (common.Address, error) { - return _EigenPodManager.Contract.EigenPodBeacon(&_EigenPodManager.CallOpts) -} - -// EigenPodBeacon is a free data retrieval call binding the contract method 0x292b7b2b. -// -// Solidity: function eigenPodBeacon() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) EigenPodBeacon() (common.Address, error) { - return _EigenPodManager.Contract.EigenPodBeacon(&_EigenPodManager.CallOpts) -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) EthPOS(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "ethPOS") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) EthPOS() (common.Address, error) { - return _EigenPodManager.Contract.EthPOS(&_EigenPodManager.CallOpts) -} - -// EthPOS is a free data retrieval call binding the contract method 0x74cdd798. -// -// Solidity: function ethPOS() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) EthPOS() (common.Address, error) { - return _EigenPodManager.Contract.EthPOS(&_EigenPodManager.CallOpts) -} - -// GetPod is a free data retrieval call binding the contract method 0xa38406a3. -// -// Solidity: function getPod(address podOwner) view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) GetPod(opts *bind.CallOpts, podOwner common.Address) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "getPod", podOwner) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetPod is a free data retrieval call binding the contract method 0xa38406a3. -// -// Solidity: function getPod(address podOwner) view returns(address) -func (_EigenPodManager *EigenPodManagerSession) GetPod(podOwner common.Address) (common.Address, error) { - return _EigenPodManager.Contract.GetPod(&_EigenPodManager.CallOpts, podOwner) -} - -// GetPod is a free data retrieval call binding the contract method 0xa38406a3. -// -// Solidity: function getPod(address podOwner) view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) GetPod(podOwner common.Address) (common.Address, error) { - return _EigenPodManager.Contract.GetPod(&_EigenPodManager.CallOpts, podOwner) -} - -// HasPod is a free data retrieval call binding the contract method 0xf6848d24. -// -// Solidity: function hasPod(address podOwner) view returns(bool) -func (_EigenPodManager *EigenPodManagerCaller) HasPod(opts *bind.CallOpts, podOwner common.Address) (bool, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "hasPod", podOwner) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasPod is a free data retrieval call binding the contract method 0xf6848d24. -// -// Solidity: function hasPod(address podOwner) view returns(bool) -func (_EigenPodManager *EigenPodManagerSession) HasPod(podOwner common.Address) (bool, error) { - return _EigenPodManager.Contract.HasPod(&_EigenPodManager.CallOpts, podOwner) -} - -// HasPod is a free data retrieval call binding the contract method 0xf6848d24. -// -// Solidity: function hasPod(address podOwner) view returns(bool) -func (_EigenPodManager *EigenPodManagerCallerSession) HasPod(podOwner common.Address) (bool, error) { - return _EigenPodManager.Contract.HasPod(&_EigenPodManager.CallOpts, podOwner) -} - -// NumPods is a free data retrieval call binding the contract method 0xa6a509be. -// -// Solidity: function numPods() view returns(uint256) -func (_EigenPodManager *EigenPodManagerCaller) NumPods(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "numPods") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// NumPods is a free data retrieval call binding the contract method 0xa6a509be. -// -// Solidity: function numPods() view returns(uint256) -func (_EigenPodManager *EigenPodManagerSession) NumPods() (*big.Int, error) { - return _EigenPodManager.Contract.NumPods(&_EigenPodManager.CallOpts) -} - -// NumPods is a free data retrieval call binding the contract method 0xa6a509be. -// -// Solidity: function numPods() view returns(uint256) -func (_EigenPodManager *EigenPodManagerCallerSession) NumPods() (*big.Int, error) { - return _EigenPodManager.Contract.NumPods(&_EigenPodManager.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) Owner() (common.Address, error) { - return _EigenPodManager.Contract.Owner(&_EigenPodManager.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) Owner() (common.Address, error) { - return _EigenPodManager.Contract.Owner(&_EigenPodManager.CallOpts) -} - -// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. -// -// Solidity: function ownerToPod(address ) view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) OwnerToPod(opts *bind.CallOpts, arg0 common.Address) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "ownerToPod", arg0) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. -// -// Solidity: function ownerToPod(address ) view returns(address) -func (_EigenPodManager *EigenPodManagerSession) OwnerToPod(arg0 common.Address) (common.Address, error) { - return _EigenPodManager.Contract.OwnerToPod(&_EigenPodManager.CallOpts, arg0) -} - -// OwnerToPod is a free data retrieval call binding the contract method 0x9ba06275. -// -// Solidity: function ownerToPod(address ) view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) OwnerToPod(arg0 common.Address) (common.Address, error) { - return _EigenPodManager.Contract.OwnerToPod(&_EigenPodManager.CallOpts, arg0) -} - -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. -// -// Solidity: function paused(uint8 index) view returns(bool) -func (_EigenPodManager *EigenPodManagerCaller) Paused(opts *bind.CallOpts, index uint8) (bool, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "paused", index) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. -// -// Solidity: function paused(uint8 index) view returns(bool) -func (_EigenPodManager *EigenPodManagerSession) Paused(index uint8) (bool, error) { - return _EigenPodManager.Contract.Paused(&_EigenPodManager.CallOpts, index) -} - -// Paused is a free data retrieval call binding the contract method 0x5ac86ab7. -// -// Solidity: function paused(uint8 index) view returns(bool) -func (_EigenPodManager *EigenPodManagerCallerSession) Paused(index uint8) (bool, error) { - return _EigenPodManager.Contract.Paused(&_EigenPodManager.CallOpts, index) -} - -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(uint256) -func (_EigenPodManager *EigenPodManagerCaller) Paused0(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "paused0") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(uint256) -func (_EigenPodManager *EigenPodManagerSession) Paused0() (*big.Int, error) { - return _EigenPodManager.Contract.Paused0(&_EigenPodManager.CallOpts) -} - -// Paused0 is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(uint256) -func (_EigenPodManager *EigenPodManagerCallerSession) Paused0() (*big.Int, error) { - return _EigenPodManager.Contract.Paused0(&_EigenPodManager.CallOpts) -} - -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. -// -// Solidity: function pauserRegistry() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) PauserRegistry(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "pauserRegistry") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. -// -// Solidity: function pauserRegistry() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) PauserRegistry() (common.Address, error) { - return _EigenPodManager.Contract.PauserRegistry(&_EigenPodManager.CallOpts) -} - -// PauserRegistry is a free data retrieval call binding the contract method 0x886f1195. -// -// Solidity: function pauserRegistry() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) PauserRegistry() (common.Address, error) { - return _EigenPodManager.Contract.PauserRegistry(&_EigenPodManager.CallOpts) -} - -// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. -// -// Solidity: function podOwnerShares(address ) view returns(int256) -func (_EigenPodManager *EigenPodManagerCaller) PodOwnerShares(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "podOwnerShares", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. -// -// Solidity: function podOwnerShares(address ) view returns(int256) -func (_EigenPodManager *EigenPodManagerSession) PodOwnerShares(arg0 common.Address) (*big.Int, error) { - return _EigenPodManager.Contract.PodOwnerShares(&_EigenPodManager.CallOpts, arg0) -} - -// PodOwnerShares is a free data retrieval call binding the contract method 0x60f4062b. -// -// Solidity: function podOwnerShares(address ) view returns(int256) -func (_EigenPodManager *EigenPodManagerCallerSession) PodOwnerShares(arg0 common.Address) (*big.Int, error) { - return _EigenPodManager.Contract.PodOwnerShares(&_EigenPodManager.CallOpts, arg0) -} - -// Slasher is a free data retrieval call binding the contract method 0xb1344271. -// -// Solidity: function slasher() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) Slasher(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "slasher") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Slasher is a free data retrieval call binding the contract method 0xb1344271. -// -// Solidity: function slasher() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) Slasher() (common.Address, error) { - return _EigenPodManager.Contract.Slasher(&_EigenPodManager.CallOpts) -} - -// Slasher is a free data retrieval call binding the contract method 0xb1344271. -// -// Solidity: function slasher() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) Slasher() (common.Address, error) { - return _EigenPodManager.Contract.Slasher(&_EigenPodManager.CallOpts) -} - -// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. -// -// Solidity: function strategyManager() view returns(address) -func (_EigenPodManager *EigenPodManagerCaller) StrategyManager(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EigenPodManager.contract.Call(opts, &out, "strategyManager") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. -// -// Solidity: function strategyManager() view returns(address) -func (_EigenPodManager *EigenPodManagerSession) StrategyManager() (common.Address, error) { - return _EigenPodManager.Contract.StrategyManager(&_EigenPodManager.CallOpts) -} - -// StrategyManager is a free data retrieval call binding the contract method 0x39b70e38. -// -// Solidity: function strategyManager() view returns(address) -func (_EigenPodManager *EigenPodManagerCallerSession) StrategyManager() (common.Address, error) { - return _EigenPodManager.Contract.StrategyManager(&_EigenPodManager.CallOpts) -} - -// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. -// -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) -func (_EigenPodManager *EigenPodManagerTransactor) AddShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "addShares", podOwner, shares) -} - -// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. -// -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) -func (_EigenPodManager *EigenPodManagerSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.AddShares(&_EigenPodManager.TransactOpts, podOwner, shares) -} - -// AddShares is a paid mutator transaction binding the contract method 0x0e81073c. -// -// Solidity: function addShares(address podOwner, uint256 shares) returns(uint256) -func (_EigenPodManager *EigenPodManagerTransactorSession) AddShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.AddShares(&_EigenPodManager.TransactOpts, podOwner, shares) -} - -// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. -// -// Solidity: function createPod() returns(address) -func (_EigenPodManager *EigenPodManagerTransactor) CreatePod(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "createPod") -} - -// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. -// -// Solidity: function createPod() returns(address) -func (_EigenPodManager *EigenPodManagerSession) CreatePod() (*types.Transaction, error) { - return _EigenPodManager.Contract.CreatePod(&_EigenPodManager.TransactOpts) -} - -// CreatePod is a paid mutator transaction binding the contract method 0x84d81062. -// -// Solidity: function createPod() returns(address) -func (_EigenPodManager *EigenPodManagerTransactorSession) CreatePod() (*types.Transaction, error) { - return _EigenPodManager.Contract.CreatePod(&_EigenPodManager.TransactOpts) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 _initPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactor) Initialize(opts *bind.TransactOpts, initialOwner common.Address, _pauserRegistry common.Address, _initPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "initialize", initialOwner, _pauserRegistry, _initPausedStatus) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 _initPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerSession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, _initPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Initialize(&_EigenPodManager.TransactOpts, initialOwner, _pauserRegistry, _initPausedStatus) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address initialOwner, address _pauserRegistry, uint256 _initPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) Initialize(initialOwner common.Address, _pauserRegistry common.Address, _initPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Initialize(&_EigenPodManager.TransactOpts, initialOwner, _pauserRegistry, _initPausedStatus) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactor) Pause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "pause", newPausedStatus) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Pause(&_EigenPodManager.TransactOpts, newPausedStatus) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) Pause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Pause(&_EigenPodManager.TransactOpts, newPausedStatus) -} - -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. -// -// Solidity: function pauseAll() returns() -func (_EigenPodManager *EigenPodManagerTransactor) PauseAll(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "pauseAll") -} - -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. -// -// Solidity: function pauseAll() returns() -func (_EigenPodManager *EigenPodManagerSession) PauseAll() (*types.Transaction, error) { - return _EigenPodManager.Contract.PauseAll(&_EigenPodManager.TransactOpts) -} - -// PauseAll is a paid mutator transaction binding the contract method 0x595c6a67. -// -// Solidity: function pauseAll() returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) PauseAll() (*types.Transaction, error) { - return _EigenPodManager.Contract.PauseAll(&_EigenPodManager.TransactOpts) -} - -// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. -// -// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() -func (_EigenPodManager *EigenPodManagerTransactor) RecordBeaconChainETHBalanceUpdate(opts *bind.TransactOpts, podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "recordBeaconChainETHBalanceUpdate", podOwner, sharesDelta) -} - -// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. -// -// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() -func (_EigenPodManager *EigenPodManagerSession) RecordBeaconChainETHBalanceUpdate(podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.RecordBeaconChainETHBalanceUpdate(&_EigenPodManager.TransactOpts, podOwner, sharesDelta) -} - -// RecordBeaconChainETHBalanceUpdate is a paid mutator transaction binding the contract method 0xc2c51c40. -// -// Solidity: function recordBeaconChainETHBalanceUpdate(address podOwner, int256 sharesDelta) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) RecordBeaconChainETHBalanceUpdate(podOwner common.Address, sharesDelta *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.RecordBeaconChainETHBalanceUpdate(&_EigenPodManager.TransactOpts, podOwner, sharesDelta) -} - -// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. -// -// Solidity: function removeShares(address podOwner, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerTransactor) RemoveShares(opts *bind.TransactOpts, podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "removeShares", podOwner, shares) -} - -// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. -// -// Solidity: function removeShares(address podOwner, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerSession) RemoveShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.RemoveShares(&_EigenPodManager.TransactOpts, podOwner, shares) -} - -// RemoveShares is a paid mutator transaction binding the contract method 0xbeffbb89. -// -// Solidity: function removeShares(address podOwner, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) RemoveShares(podOwner common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.RemoveShares(&_EigenPodManager.TransactOpts, podOwner, shares) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_EigenPodManager *EigenPodManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_EigenPodManager *EigenPodManagerSession) RenounceOwnership() (*types.Transaction, error) { - return _EigenPodManager.Contract.RenounceOwnership(&_EigenPodManager.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _EigenPodManager.Contract.RenounceOwnership(&_EigenPodManager.TransactOpts) -} - -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_EigenPodManager *EigenPodManagerTransactor) SetPauserRegistry(opts *bind.TransactOpts, newPauserRegistry common.Address) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "setPauserRegistry", newPauserRegistry) -} - -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_EigenPodManager *EigenPodManagerSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { - return _EigenPodManager.Contract.SetPauserRegistry(&_EigenPodManager.TransactOpts, newPauserRegistry) -} - -// SetPauserRegistry is a paid mutator transaction binding the contract method 0x10d67a2f. -// -// Solidity: function setPauserRegistry(address newPauserRegistry) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) SetPauserRegistry(newPauserRegistry common.Address) (*types.Transaction, error) { - return _EigenPodManager.Contract.SetPauserRegistry(&_EigenPodManager.TransactOpts, newPauserRegistry) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPodManager *EigenPodManagerTransactor) Stake(opts *bind.TransactOpts, pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "stake", pubkey, signature, depositDataRoot) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPodManager *EigenPodManagerSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPodManager.Contract.Stake(&_EigenPodManager.TransactOpts, pubkey, signature, depositDataRoot) -} - -// Stake is a paid mutator transaction binding the contract method 0x9b4e4634. -// -// Solidity: function stake(bytes pubkey, bytes signature, bytes32 depositDataRoot) payable returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) Stake(pubkey []byte, signature []byte, depositDataRoot [32]byte) (*types.Transaction, error) { - return _EigenPodManager.Contract.Stake(&_EigenPodManager.TransactOpts, pubkey, signature, depositDataRoot) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_EigenPodManager *EigenPodManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_EigenPodManager *EigenPodManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _EigenPodManager.Contract.TransferOwnership(&_EigenPodManager.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _EigenPodManager.Contract.TransferOwnership(&_EigenPodManager.TransactOpts, newOwner) -} - -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. -// -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactor) Unpause(opts *bind.TransactOpts, newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "unpause", newPausedStatus) -} - -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. -// -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Unpause(&_EigenPodManager.TransactOpts, newPausedStatus) -} - -// Unpause is a paid mutator transaction binding the contract method 0xfabc1cbc. -// -// Solidity: function unpause(uint256 newPausedStatus) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) Unpause(newPausedStatus *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.Unpause(&_EigenPodManager.TransactOpts, newPausedStatus) -} - -// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. -// -// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerTransactor) WithdrawSharesAsTokens(opts *bind.TransactOpts, podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.contract.Transact(opts, "withdrawSharesAsTokens", podOwner, destination, shares) -} - -// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. -// -// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerSession) WithdrawSharesAsTokens(podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.WithdrawSharesAsTokens(&_EigenPodManager.TransactOpts, podOwner, destination, shares) -} - -// WithdrawSharesAsTokens is a paid mutator transaction binding the contract method 0x387b1300. -// -// Solidity: function withdrawSharesAsTokens(address podOwner, address destination, uint256 shares) returns() -func (_EigenPodManager *EigenPodManagerTransactorSession) WithdrawSharesAsTokens(podOwner common.Address, destination common.Address, shares *big.Int) (*types.Transaction, error) { - return _EigenPodManager.Contract.WithdrawSharesAsTokens(&_EigenPodManager.TransactOpts, podOwner, destination, shares) -} - -// EigenPodManagerBeaconChainETHDepositedIterator is returned from FilterBeaconChainETHDeposited and is used to iterate over the raw logs and unpacked data for BeaconChainETHDeposited events raised by the EigenPodManager contract. -type EigenPodManagerBeaconChainETHDepositedIterator struct { - Event *EigenPodManagerBeaconChainETHDeposited // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerBeaconChainETHDepositedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerBeaconChainETHDeposited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerBeaconChainETHDeposited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerBeaconChainETHDepositedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerBeaconChainETHDepositedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerBeaconChainETHDeposited represents a BeaconChainETHDeposited event raised by the EigenPodManager contract. -type EigenPodManagerBeaconChainETHDeposited struct { - PodOwner common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBeaconChainETHDeposited is a free log retrieval operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. -// -// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) -func (_EigenPodManager *EigenPodManagerFilterer) FilterBeaconChainETHDeposited(opts *bind.FilterOpts, podOwner []common.Address) (*EigenPodManagerBeaconChainETHDepositedIterator, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "BeaconChainETHDeposited", podOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerBeaconChainETHDepositedIterator{contract: _EigenPodManager.contract, event: "BeaconChainETHDeposited", logs: logs, sub: sub}, nil -} - -// WatchBeaconChainETHDeposited is a free log subscription operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. -// -// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) -func (_EigenPodManager *EigenPodManagerFilterer) WatchBeaconChainETHDeposited(opts *bind.WatchOpts, sink chan<- *EigenPodManagerBeaconChainETHDeposited, podOwner []common.Address) (event.Subscription, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "BeaconChainETHDeposited", podOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerBeaconChainETHDeposited) - if err := _EigenPodManager.contract.UnpackLog(event, "BeaconChainETHDeposited", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBeaconChainETHDeposited is a log parse operation binding the contract event 0x35a85cabc603f48abb2b71d9fbd8adea7c449d7f0be900ae7a2986ea369c3d0d. -// -// Solidity: event BeaconChainETHDeposited(address indexed podOwner, uint256 amount) -func (_EigenPodManager *EigenPodManagerFilterer) ParseBeaconChainETHDeposited(log types.Log) (*EigenPodManagerBeaconChainETHDeposited, error) { - event := new(EigenPodManagerBeaconChainETHDeposited) - if err := _EigenPodManager.contract.UnpackLog(event, "BeaconChainETHDeposited", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerBeaconChainETHWithdrawalCompletedIterator is returned from FilterBeaconChainETHWithdrawalCompleted and is used to iterate over the raw logs and unpacked data for BeaconChainETHWithdrawalCompleted events raised by the EigenPodManager contract. -type EigenPodManagerBeaconChainETHWithdrawalCompletedIterator struct { - Event *EigenPodManagerBeaconChainETHWithdrawalCompleted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerBeaconChainETHWithdrawalCompleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerBeaconChainETHWithdrawalCompleted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerBeaconChainETHWithdrawalCompletedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerBeaconChainETHWithdrawalCompleted represents a BeaconChainETHWithdrawalCompleted event raised by the EigenPodManager contract. -type EigenPodManagerBeaconChainETHWithdrawalCompleted struct { - PodOwner common.Address - Shares *big.Int - Nonce *big.Int - DelegatedAddress common.Address - Withdrawer common.Address - WithdrawalRoot [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBeaconChainETHWithdrawalCompleted is a free log retrieval operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. -// -// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) -func (_EigenPodManager *EigenPodManagerFilterer) FilterBeaconChainETHWithdrawalCompleted(opts *bind.FilterOpts, podOwner []common.Address) (*EigenPodManagerBeaconChainETHWithdrawalCompletedIterator, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "BeaconChainETHWithdrawalCompleted", podOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerBeaconChainETHWithdrawalCompletedIterator{contract: _EigenPodManager.contract, event: "BeaconChainETHWithdrawalCompleted", logs: logs, sub: sub}, nil -} - -// WatchBeaconChainETHWithdrawalCompleted is a free log subscription operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. -// -// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) -func (_EigenPodManager *EigenPodManagerFilterer) WatchBeaconChainETHWithdrawalCompleted(opts *bind.WatchOpts, sink chan<- *EigenPodManagerBeaconChainETHWithdrawalCompleted, podOwner []common.Address) (event.Subscription, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "BeaconChainETHWithdrawalCompleted", podOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerBeaconChainETHWithdrawalCompleted) - if err := _EigenPodManager.contract.UnpackLog(event, "BeaconChainETHWithdrawalCompleted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBeaconChainETHWithdrawalCompleted is a log parse operation binding the contract event 0xa6bab1d55a361fcea2eee2bc9491e4f01e6cf333df03c9c4f2c144466429f7d6. -// -// Solidity: event BeaconChainETHWithdrawalCompleted(address indexed podOwner, uint256 shares, uint96 nonce, address delegatedAddress, address withdrawer, bytes32 withdrawalRoot) -func (_EigenPodManager *EigenPodManagerFilterer) ParseBeaconChainETHWithdrawalCompleted(log types.Log) (*EigenPodManagerBeaconChainETHWithdrawalCompleted, error) { - event := new(EigenPodManagerBeaconChainETHWithdrawalCompleted) - if err := _EigenPodManager.contract.UnpackLog(event, "BeaconChainETHWithdrawalCompleted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the EigenPodManager contract. -type EigenPodManagerInitializedIterator struct { - Event *EigenPodManagerInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerInitializedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerInitialized represents a Initialized event raised by the EigenPodManager contract. -type EigenPodManagerInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPodManager *EigenPodManagerFilterer) FilterInitialized(opts *bind.FilterOpts) (*EigenPodManagerInitializedIterator, error) { - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &EigenPodManagerInitializedIterator{contract: _EigenPodManager.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPodManager *EigenPodManagerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EigenPodManagerInitialized) (event.Subscription, error) { - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerInitialized) - if err := _EigenPodManager.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_EigenPodManager *EigenPodManagerFilterer) ParseInitialized(log types.Log) (*EigenPodManagerInitialized, error) { - event := new(EigenPodManagerInitialized) - if err := _EigenPodManager.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerNewTotalSharesIterator is returned from FilterNewTotalShares and is used to iterate over the raw logs and unpacked data for NewTotalShares events raised by the EigenPodManager contract. -type EigenPodManagerNewTotalSharesIterator struct { - Event *EigenPodManagerNewTotalShares // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerNewTotalSharesIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerNewTotalShares) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerNewTotalShares) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerNewTotalSharesIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerNewTotalSharesIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerNewTotalShares represents a NewTotalShares event raised by the EigenPodManager contract. -type EigenPodManagerNewTotalShares struct { - PodOwner common.Address - NewTotalShares *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNewTotalShares is a free log retrieval operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. -// -// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) -func (_EigenPodManager *EigenPodManagerFilterer) FilterNewTotalShares(opts *bind.FilterOpts, podOwner []common.Address) (*EigenPodManagerNewTotalSharesIterator, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "NewTotalShares", podOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerNewTotalSharesIterator{contract: _EigenPodManager.contract, event: "NewTotalShares", logs: logs, sub: sub}, nil -} - -// WatchNewTotalShares is a free log subscription operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. -// -// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) -func (_EigenPodManager *EigenPodManagerFilterer) WatchNewTotalShares(opts *bind.WatchOpts, sink chan<- *EigenPodManagerNewTotalShares, podOwner []common.Address) (event.Subscription, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "NewTotalShares", podOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerNewTotalShares) - if err := _EigenPodManager.contract.UnpackLog(event, "NewTotalShares", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseNewTotalShares is a log parse operation binding the contract event 0xd4def76d6d2bed6f14d5cd9af73cc2913d618d00edde42432e81c09bfe077098. -// -// Solidity: event NewTotalShares(address indexed podOwner, int256 newTotalShares) -func (_EigenPodManager *EigenPodManagerFilterer) ParseNewTotalShares(log types.Log) (*EigenPodManagerNewTotalShares, error) { - event := new(EigenPodManagerNewTotalShares) - if err := _EigenPodManager.contract.UnpackLog(event, "NewTotalShares", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the EigenPodManager contract. -type EigenPodManagerOwnershipTransferredIterator struct { - Event *EigenPodManagerOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerOwnershipTransferred represents a OwnershipTransferred event raised by the EigenPodManager contract. -type EigenPodManagerOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_EigenPodManager *EigenPodManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EigenPodManagerOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerOwnershipTransferredIterator{contract: _EigenPodManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_EigenPodManager *EigenPodManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EigenPodManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerOwnershipTransferred) - if err := _EigenPodManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_EigenPodManager *EigenPodManagerFilterer) ParseOwnershipTransferred(log types.Log) (*EigenPodManagerOwnershipTransferred, error) { - event := new(EigenPodManagerOwnershipTransferred) - if err := _EigenPodManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the EigenPodManager contract. -type EigenPodManagerPausedIterator struct { - Event *EigenPodManagerPaused // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerPausedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPaused) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPaused) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerPausedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerPausedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerPaused represents a Paused event raised by the EigenPodManager contract. -type EigenPodManagerPaused struct { - Account common.Address - NewPausedStatus *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPaused is a free log retrieval operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. -// -// Solidity: event Paused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) FilterPaused(opts *bind.FilterOpts, account []common.Address) (*EigenPodManagerPausedIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "Paused", accountRule) - if err != nil { - return nil, err - } - return &EigenPodManagerPausedIterator{contract: _EigenPodManager.contract, event: "Paused", logs: logs, sub: sub}, nil -} - -// WatchPaused is a free log subscription operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. -// -// Solidity: event Paused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *EigenPodManagerPaused, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "Paused", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerPaused) - if err := _EigenPodManager.contract.UnpackLog(event, "Paused", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePaused is a log parse operation binding the contract event 0xab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d. -// -// Solidity: event Paused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) ParsePaused(log types.Log) (*EigenPodManagerPaused, error) { - event := new(EigenPodManagerPaused) - if err := _EigenPodManager.contract.UnpackLog(event, "Paused", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerPauserRegistrySetIterator is returned from FilterPauserRegistrySet and is used to iterate over the raw logs and unpacked data for PauserRegistrySet events raised by the EigenPodManager contract. -type EigenPodManagerPauserRegistrySetIterator struct { - Event *EigenPodManagerPauserRegistrySet // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerPauserRegistrySetIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPauserRegistrySet) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPauserRegistrySet) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerPauserRegistrySetIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerPauserRegistrySetIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerPauserRegistrySet represents a PauserRegistrySet event raised by the EigenPodManager contract. -type EigenPodManagerPauserRegistrySet struct { - PauserRegistry common.Address - NewPauserRegistry common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPauserRegistrySet is a free log retrieval operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. -// -// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) -func (_EigenPodManager *EigenPodManagerFilterer) FilterPauserRegistrySet(opts *bind.FilterOpts) (*EigenPodManagerPauserRegistrySetIterator, error) { - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "PauserRegistrySet") - if err != nil { - return nil, err - } - return &EigenPodManagerPauserRegistrySetIterator{contract: _EigenPodManager.contract, event: "PauserRegistrySet", logs: logs, sub: sub}, nil -} - -// WatchPauserRegistrySet is a free log subscription operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. -// -// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) -func (_EigenPodManager *EigenPodManagerFilterer) WatchPauserRegistrySet(opts *bind.WatchOpts, sink chan<- *EigenPodManagerPauserRegistrySet) (event.Subscription, error) { - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "PauserRegistrySet") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerPauserRegistrySet) - if err := _EigenPodManager.contract.UnpackLog(event, "PauserRegistrySet", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePauserRegistrySet is a log parse operation binding the contract event 0x6e9fcd539896fca60e8b0f01dd580233e48a6b0f7df013b89ba7f565869acdb6. -// -// Solidity: event PauserRegistrySet(address pauserRegistry, address newPauserRegistry) -func (_EigenPodManager *EigenPodManagerFilterer) ParsePauserRegistrySet(log types.Log) (*EigenPodManagerPauserRegistrySet, error) { - event := new(EigenPodManagerPauserRegistrySet) - if err := _EigenPodManager.contract.UnpackLog(event, "PauserRegistrySet", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerPodDeployedIterator is returned from FilterPodDeployed and is used to iterate over the raw logs and unpacked data for PodDeployed events raised by the EigenPodManager contract. -type EigenPodManagerPodDeployedIterator struct { - Event *EigenPodManagerPodDeployed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerPodDeployedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPodDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPodDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerPodDeployedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerPodDeployedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerPodDeployed represents a PodDeployed event raised by the EigenPodManager contract. -type EigenPodManagerPodDeployed struct { - EigenPod common.Address - PodOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPodDeployed is a free log retrieval operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. -// -// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) -func (_EigenPodManager *EigenPodManagerFilterer) FilterPodDeployed(opts *bind.FilterOpts, eigenPod []common.Address, podOwner []common.Address) (*EigenPodManagerPodDeployedIterator, error) { - - var eigenPodRule []interface{} - for _, eigenPodItem := range eigenPod { - eigenPodRule = append(eigenPodRule, eigenPodItem) - } - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "PodDeployed", eigenPodRule, podOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerPodDeployedIterator{contract: _EigenPodManager.contract, event: "PodDeployed", logs: logs, sub: sub}, nil -} - -// WatchPodDeployed is a free log subscription operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. -// -// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) -func (_EigenPodManager *EigenPodManagerFilterer) WatchPodDeployed(opts *bind.WatchOpts, sink chan<- *EigenPodManagerPodDeployed, eigenPod []common.Address, podOwner []common.Address) (event.Subscription, error) { - - var eigenPodRule []interface{} - for _, eigenPodItem := range eigenPod { - eigenPodRule = append(eigenPodRule, eigenPodItem) - } - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "PodDeployed", eigenPodRule, podOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerPodDeployed) - if err := _EigenPodManager.contract.UnpackLog(event, "PodDeployed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePodDeployed is a log parse operation binding the contract event 0x21c99d0db02213c32fff5b05cf0a718ab5f858802b91498f80d82270289d856a. -// -// Solidity: event PodDeployed(address indexed eigenPod, address indexed podOwner) -func (_EigenPodManager *EigenPodManagerFilterer) ParsePodDeployed(log types.Log) (*EigenPodManagerPodDeployed, error) { - event := new(EigenPodManagerPodDeployed) - if err := _EigenPodManager.contract.UnpackLog(event, "PodDeployed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerPodSharesUpdatedIterator is returned from FilterPodSharesUpdated and is used to iterate over the raw logs and unpacked data for PodSharesUpdated events raised by the EigenPodManager contract. -type EigenPodManagerPodSharesUpdatedIterator struct { - Event *EigenPodManagerPodSharesUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerPodSharesUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPodSharesUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerPodSharesUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerPodSharesUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerPodSharesUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerPodSharesUpdated represents a PodSharesUpdated event raised by the EigenPodManager contract. -type EigenPodManagerPodSharesUpdated struct { - PodOwner common.Address - SharesDelta *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPodSharesUpdated is a free log retrieval operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. -// -// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) -func (_EigenPodManager *EigenPodManagerFilterer) FilterPodSharesUpdated(opts *bind.FilterOpts, podOwner []common.Address) (*EigenPodManagerPodSharesUpdatedIterator, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "PodSharesUpdated", podOwnerRule) - if err != nil { - return nil, err - } - return &EigenPodManagerPodSharesUpdatedIterator{contract: _EigenPodManager.contract, event: "PodSharesUpdated", logs: logs, sub: sub}, nil -} - -// WatchPodSharesUpdated is a free log subscription operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. -// -// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) -func (_EigenPodManager *EigenPodManagerFilterer) WatchPodSharesUpdated(opts *bind.WatchOpts, sink chan<- *EigenPodManagerPodSharesUpdated, podOwner []common.Address) (event.Subscription, error) { - - var podOwnerRule []interface{} - for _, podOwnerItem := range podOwner { - podOwnerRule = append(podOwnerRule, podOwnerItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "PodSharesUpdated", podOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerPodSharesUpdated) - if err := _EigenPodManager.contract.UnpackLog(event, "PodSharesUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParsePodSharesUpdated is a log parse operation binding the contract event 0x4e2b791dedccd9fb30141b088cabf5c14a8912b52f59375c95c010700b8c6193. -// -// Solidity: event PodSharesUpdated(address indexed podOwner, int256 sharesDelta) -func (_EigenPodManager *EigenPodManagerFilterer) ParsePodSharesUpdated(log types.Log) (*EigenPodManagerPodSharesUpdated, error) { - event := new(EigenPodManagerPodSharesUpdated) - if err := _EigenPodManager.contract.UnpackLog(event, "PodSharesUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EigenPodManagerUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the EigenPodManager contract. -type EigenPodManagerUnpausedIterator struct { - Event *EigenPodManagerUnpaused // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *EigenPodManagerUnpausedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerUnpaused) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(EigenPodManagerUnpaused) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *EigenPodManagerUnpausedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EigenPodManagerUnpausedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EigenPodManagerUnpaused represents a Unpaused event raised by the EigenPodManager contract. -type EigenPodManagerUnpaused struct { - Account common.Address - NewPausedStatus *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUnpaused is a free log retrieval operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. -// -// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) FilterUnpaused(opts *bind.FilterOpts, account []common.Address) (*EigenPodManagerUnpausedIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _EigenPodManager.contract.FilterLogs(opts, "Unpaused", accountRule) - if err != nil { - return nil, err - } - return &EigenPodManagerUnpausedIterator{contract: _EigenPodManager.contract, event: "Unpaused", logs: logs, sub: sub}, nil -} - -// WatchUnpaused is a free log subscription operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. -// -// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *EigenPodManagerUnpaused, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _EigenPodManager.contract.WatchLogs(opts, "Unpaused", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(EigenPodManagerUnpaused) - if err := _EigenPodManager.contract.UnpackLog(event, "Unpaused", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUnpaused is a log parse operation binding the contract event 0x3582d1828e26bf56bd801502bc021ac0bc8afb57c826e4986b45593c8fad389c. -// -// Solidity: event Unpaused(address indexed account, uint256 newPausedStatus) -func (_EigenPodManager *EigenPodManagerFilterer) ParseUnpaused(log types.Log) (*EigenPodManagerUnpaused, error) { - event := new(EigenPodManagerUnpaused) - if err := _EigenPodManager.contract.UnpackLog(event, "Unpaused", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/cli/core/status.go b/cli/core/status.go index bffd1937..b6fe1b86 100644 --- a/cli/core/status.go +++ b/cli/core/status.go @@ -5,7 +5,9 @@ import ( "fmt" "math/big" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" + "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/attestantio/go-eth2-client/spec" "github.com/attestantio/go-eth2-client/spec/phase0" gethCommon "github.com/ethereum/go-ethereum/common" @@ -28,6 +30,10 @@ type Validator struct { CurrentBalance uint64 } +func BeaconStrategy() gethCommon.Address { + return gethCommon.HexToAddress("0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0") +} + type EigenpodStatus struct { Validators map[string]Validator @@ -89,7 +95,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien validators := map[string]Validator{} var activeCheckpoint *Checkpoint = nil - eigenPod, err := onchain.NewEigenPod(gethCommon.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(gethCommon.HexToAddress(eigenpodAddress), eth) PanicOnError("failed to reach eigenpod", err) checkpoint, err := eigenPod.CurrentCheckpoint(nil) @@ -135,7 +141,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien eigenpodManagerContractAddress, err := eigenPod.EigenPodManager(nil) PanicOnError("failed to get manager address", err) - eigenPodManager, err := onchain.NewEigenPodManager(eigenpodManagerContractAddress, eth) + eigenPodManager, err := EigenPodManager.NewEigenPodManager(eigenpodManagerContractAddress, eth) PanicOnError("failed to get manager instance", err) eigenPodOwner, err := eigenPod.PodOwner(nil) @@ -144,11 +150,19 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien proofSubmitter, err := eigenPod.ProofSubmitter(nil) PanicOnError("failed to get eigenpod proof submitter", err) - currentOwnerShares, err := eigenPodManager.PodOwnerShares(nil, eigenPodOwner) - // currentOwnerShares = big.NewInt(0) - PanicOnError("failed to load pod owner shares", err) - currentOwnerSharesETH := IweiToEther(currentOwnerShares) - currentOwnerSharesWei := currentOwnerShares + delegationManagerAddress, err := eigenPodManager.DelegationManager(nil) + PanicOnError("failed to read delegationManager", err) + + delegationManager, err := DelegationManager.NewDelegationManager(delegationManagerAddress, eth) + PanicOnError("failed to reach delegationManager", err) + + shares, err := delegationManager.GetWithdrawableShares(nil, eigenPodOwner, []gethCommon.Address{ + BeaconStrategy(), + }) + PanicOnError("failed to load owner shares", err) + + currentOwnerSharesETH := IweiToEther(shares.WithdrawableShares[0]) + currentOwnerSharesWei := shares.WithdrawableShares[0] withdrawableRestakedExecutionLayerGwei, err := eigenPod.WithdrawableRestakedExecutionLayerGwei(nil) PanicOnError("failed to fetch withdrawableRestakedExecutionLayerGwei", err) @@ -168,7 +182,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien // Remove already-computed delta from an in-progress checkpoint sumRestakedBalancesWei = new(big.Int).Sub( sumRestakedBalancesWei, - IGweiToWei(checkpoint.BalanceDeltasGwei), + IGweiToWei(big.NewInt(checkpoint.BalanceDeltasGwei)), ) activeCheckpoint = &Checkpoint{ diff --git a/cli/core/utils.go b/cli/core/utils.go index 583d29bb..34a55930 100644 --- a/cli/core/utils.go +++ b/cli/core/utils.go @@ -15,8 +15,8 @@ import ( "strconv" "strings" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" eigenpodproofs "github.com/Layr-Labs/eigenpod-proofs-generation" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils" "github.com/attestantio/go-eth2-client/spec" "github.com/attestantio/go-eth2-client/spec/phase0" @@ -105,7 +105,13 @@ type ValidatorWithIndex = struct { } type ValidatorWithOnchainInfo = struct { - Info onchain.IEigenPodValidatorInfo + Info EigenPod.IEigenPodTypesValidatorInfo + Validator *phase0.Validator + Index uint64 +} + +type ValidatorWithMaybeOnchainInfo = struct { + Info *EigenPod.IEigenPodTypesValidatorInfo Validator *phase0.Validator Index uint64 } @@ -123,7 +129,7 @@ func StartCheckpoint(ctx context.Context, eigenpodAddress string, ownerPrivateKe return nil, fmt.Errorf("failed to parse private key: %w", err) } - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) if err != nil { return nil, fmt.Errorf("failed to reach eigenpod: %w", err) } @@ -148,7 +154,7 @@ func GetBeaconClient(beaconUri string, verbose bool) (BeaconClient, error) { } func GetCurrentCheckpoint(eigenpodAddress string, client *ethclient.Client) (uint64, error) { - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), client) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), client) if err != nil { return 0, fmt.Errorf("failed to locate eigenpod. is your address correct?: %w", err) } @@ -287,14 +293,14 @@ func FindAllValidatorsForEigenpod(eigenpodAddress string, beaconState *spec.Vers var zeroes = [16]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} -func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allValidators []*phase0.Validator) ([]*multicall.MultiCallMetaData[onchain.IEigenPodValidatorInfo], error) { - eigenpodAbi, err := abi.JSON(strings.NewReader(onchain.EigenPodABI)) +func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allValidators []*phase0.Validator) ([]*multicall.MultiCallMetaData[EigenPod.IEigenPodTypesValidatorInfo], error) { + eigenpodAbi, err := abi.JSON(strings.NewReader(EigenPod.EigenPodABI)) if err != nil { return nil, fmt.Errorf("failed to load eigenpod abi: %s", err) } type MulticallAndError struct { - Multicall *multicall.MultiCallMetaData[onchain.IEigenPodValidatorInfo] + Multicall *multicall.MultiCallMetaData[EigenPod.IEigenPodTypesValidatorInfo] Error error } @@ -306,7 +312,7 @@ func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allVali ), ) - mc, err := multicall.Describe[onchain.IEigenPodValidatorInfo]( + mc, err := multicall.Describe[EigenPod.IEigenPodTypesValidatorInfo]( common.HexToAddress(eigenpodAddress), eigenpodAbi, "validatorPubkeyHashToInfo", @@ -329,7 +335,7 @@ func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allVali return nil, fmt.Errorf("failed to form request for validator info: %s", errors.Join(errs...)) } - allMulticalls := utils.Map(requests, func(mc MulticallAndError, _ uint64) *multicall.MultiCallMetaData[onchain.IEigenPodValidatorInfo] { + allMulticalls := utils.Map(requests, func(mc MulticallAndError, _ uint64) *multicall.MultiCallMetaData[EigenPod.IEigenPodTypesValidatorInfo] { return mc.Multicall }) return allMulticalls, nil @@ -357,7 +363,7 @@ func FetchMultipleOnchainValidatorInfo(ctx context.Context, client *ethclient.Cl return nil, errors.New("no results returned fetching validator info") } - return utils.Map(*results, func(info *onchain.IEigenPodValidatorInfo, i uint64) ValidatorWithOnchainInfo { + return utils.Map(*results, func(info *EigenPod.IEigenPodTypesValidatorInfo, i uint64) ValidatorWithOnchainInfo { return ValidatorWithOnchainInfo{ Info: *info, Validator: allValidators[i].Validator, @@ -366,8 +372,39 @@ func FetchMultipleOnchainValidatorInfo(ctx context.Context, client *ethclient.Cl }), nil } +func FetchMultipleOnchainValidatorInfoWithFailures(ctx context.Context, client *ethclient.Client, eigenpodAddress string, allValidators []ValidatorWithIndex) ([]ValidatorWithMaybeOnchainInfo, error) { + allMulticalls, err := FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress, utils.Map(allValidators, func(validator ValidatorWithIndex, i uint64) *phase0.Validator { return validator.Validator })) + if err != nil { + return nil, fmt.Errorf("failed to form multicalls: %s", err.Error()) + } + + mc, err := multicall.NewMulticallClient(ctx, client, &multicall.TMulticallClientOptions{ + MaxBatchSizeBytes: 4096, + }) + if err != nil { + return nil, fmt.Errorf("failed to contact multicall: %s", err.Error()) + } + + results, err := multicall.DoManyAllowFailures(mc, allMulticalls...) + if err != nil { + return nil, fmt.Errorf("failed to fetch validator info: %s", err.Error()) + } + + if results == nil { + return nil, errors.New("no results returned fetching validator info") + } + + return utils.Map(*results, func(info multicall.TypedMulticall3Result[*EigenPod.IEigenPodTypesValidatorInfo], i uint64) ValidatorWithMaybeOnchainInfo { + return ValidatorWithMaybeOnchainInfo{ + Info: info.Value, + Validator: allValidators[i].Validator, + Index: allValidators[i].Index, + } + }), nil +} + func GetCurrentCheckpointBlockRoot(eigenpodAddress string, eth *ethclient.Client) (*[32]byte, error) { - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) if err != nil { return nil, fmt.Errorf("failed to locate Eigenpod. Is your address correct?: %w", err) } @@ -380,7 +417,7 @@ func GetCurrentCheckpointBlockRoot(eigenpodAddress string, eth *ethclient.Client return &checkpoint.BeaconBlockRoot, nil } -func IsAwaitingWithdrawalCredentialProof(validatorInfo onchain.IEigenPodValidatorInfo, validator *phase0.Validator) bool { +func IsAwaitingWithdrawalCredentialProof(validatorInfo EigenPod.IEigenPodTypesValidatorInfo, validator *phase0.Validator) bool { return (validatorInfo.Status == ValidatorStatusInactive) && validator.ExitEpoch == FAR_FUTURE_EPOCH && validator.ActivationEpoch != FAR_FUTURE_EPOCH } @@ -393,19 +430,27 @@ func ForkVersions() map[uint64]string { } } -func GetClients(ctx context.Context, node, beaconNodeUri string, enableLogs bool) (*ethclient.Client, BeaconClient, *big.Int, error) { +func GetEthClient(ctx context.Context, node string) (*ethclient.Client, *big.Int, error) { eth, err := ethclient.Dial(node) if err != nil { - return nil, nil, nil, fmt.Errorf("failed to reach eth --node: %w", err) + return nil, nil, fmt.Errorf("failed to reach eth --node: %w", err) } chainId, err := eth.ChainID(ctx) if err != nil { - return nil, nil, nil, fmt.Errorf("failed to fetch chain id: %w", err) + return nil, nil, fmt.Errorf("failed to fetch chain id: %w", err) } if chainId == nil || (chainId.Int64() != 17000 && chainId.Int64() != 1) { - return nil, nil, nil, errors.New("this tool only supports the Holesky and Mainnet Ethereum Networks") + return nil, nil, errors.New("this tool only supports the Holesky and Mainnet Ethereum Networks") + } + return eth, chainId, nil +} + +func GetClients(ctx context.Context, node, beaconNodeUri string, enableLogs bool) (*ethclient.Client, BeaconClient, *big.Int, error) { + eth, chainId, err := GetEthClient(ctx, node) + if err != nil { + return nil, nil, nil, fmt.Errorf("failed to reach eth --node: %w", err) } beaconClient, err := GetBeaconClient(beaconNodeUri, enableLogs) @@ -423,12 +468,12 @@ func GetClients(ctx context.Context, node, beaconNodeUri string, enableLogs bool return eth, beaconClient, chainId, nil } -func CastBalanceProofs(proofs []*eigenpodproofs.BalanceProof) []onchain.BeaconChainProofsBalanceProof { - out := []onchain.BeaconChainProofsBalanceProof{} +func CastBalanceProofs(proofs []*eigenpodproofs.BalanceProof) []EigenPod.BeaconChainProofsBalanceProof { + out := []EigenPod.BeaconChainProofsBalanceProof{} for i := 0; i < len(proofs); i++ { proof := proofs[i] - out = append(out, onchain.BeaconChainProofsBalanceProof{ + out = append(out, EigenPod.BeaconChainProofsBalanceProof{ PubkeyHash: proof.PubkeyHash, BalanceRoot: proof.BalanceRoot, Proof: proof.Proof.ToByteSlice(), diff --git a/cli/core/validator.go b/cli/core/validator.go index 3ffc5b28..0de9abd8 100644 --- a/cli/core/validator.go +++ b/cli/core/validator.go @@ -8,8 +8,8 @@ import ( "os" "strconv" + "github.com/Layr-Labs/eigenlayer-contracts/pkg/bindings/EigenPod" eigenpodproofs "github.com/Layr-Labs/eigenpod-proofs-generation" - "github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain" "github.com/Layr-Labs/eigenpod-proofs-generation/cli/utils" v1 "github.com/attestantio/go-eth2-client/api/v1" "github.com/attestantio/go-eth2-client/spec" @@ -46,7 +46,7 @@ func SubmitValidatorProof(ctx context.Context, owner, eigenpodAddress string, ch } PanicOnError("failed to parse private key", err) - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) if err != nil { return nil, [][]*big.Int{}, err } @@ -98,14 +98,14 @@ func SubmitValidatorProof(ctx context.Context, owner, eigenpodAddress string, ch return transactions, validatorIndicesChunks, err } -func SubmitValidatorProofChunk(ctx context.Context, ownerAccount *Owner, eigenPod *onchain.EigenPod, chainId *big.Int, eth *ethclient.Client, indices []*big.Int, validatorFields [][][32]byte, stateRootProofs *eigenpodproofs.StateRootProof, validatorFieldsProofs [][]byte, oracleBeaconTimesetamp uint64, verbose bool) (*types.Transaction, error) { +func SubmitValidatorProofChunk(ctx context.Context, ownerAccount *Owner, eigenPod *EigenPod.EigenPod, chainId *big.Int, eth *ethclient.Client, indices []*big.Int, validatorFields [][][32]byte, stateRootProofs *eigenpodproofs.StateRootProof, validatorFieldsProofs [][]byte, oracleBeaconTimesetamp uint64, verbose bool) (*types.Transaction, error) { if verbose { - color.Green("submitting onchain...") + color.Green("submitting...") } txn, err := eigenPod.VerifyWithdrawalCredentials( ownerAccount.TransactionOptions, oracleBeaconTimesetamp, - onchain.BeaconChainProofsStateRootProof{ + EigenPod.BeaconChainProofsStateRootProof{ Proof: stateRootProofs.Proof.ToByteSlice(), BeaconStateRoot: stateRootProofs.BeaconStateRoot, }, @@ -127,7 +127,7 @@ func GenerateValidatorProof(ctx context.Context, eigenpodAddress string, eth *et return nil, 0, fmt.Errorf("failed to load latest block: %w", err) } - eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) + eigenPod, err := EigenPod.NewEigenPod(common.HexToAddress(eigenpodAddress), eth) if err != nil { return nil, 0, fmt.Errorf("failed to reach eigenpod: %w", err) } diff --git a/cli/flags.go b/cli/flags.go index 31e02ef0..27335e2b 100644 --- a/cli/flags.go +++ b/cli/flags.go @@ -12,6 +12,15 @@ var PodAddressFlag = &cli.StringFlag{ Destination: &eigenpodAddress, } +var PodOwnerFlag = &cli.StringFlag{ + Name: "podOwner", + Aliases: []string{"p", "podOwner"}, + Value: "", + Usage: "[required] The onchain `address` of your eigenpod's owner (0x123123123123)", + Required: true, + Destination: &eigenpodOwner, +} + // Required for commands that need a beacon chain RPC var BeaconNodeFlag = &cli.StringFlag{ Name: "beaconNode", @@ -51,6 +60,14 @@ var EstimateGasFlag = &cli.BoolFlag{ Destination: &estimateGas, } +var AmountWeiFlag = &cli.Uint64Flag{ + Name: "amountWei", + Aliases: []string{}, + Value: 0, + Usage: "The amount, in Wei.", + Destination: &amountWei, +} + // Optional use for commands that support JSON output var PrintJSONFlag = &cli.BoolFlag{ Name: "json", diff --git a/cli/main.go b/cli/main.go index c88cfb16..0dfb46e8 100644 --- a/cli/main.go +++ b/cli/main.go @@ -10,11 +10,12 @@ import ( ) // Destinations for values set by various flags -var eigenpodAddress, beacon, node, sender string +var eigenpodAddress, beacon, node, sender, eigenpodOwner string var useJSON = false var specificValidator uint64 = math.MaxUint64 var estimateGas = false var slashedValidatorIndex uint64 +var amountWei uint64 const DefaultHealthcheckTolerance = float64(5.0) @@ -33,21 +34,6 @@ func main() { EnableBashCompletion: true, UseShortOptionHandling: true, Commands: []*cli.Command{ - { - Name: "total-checkpointable-value", - Args: true, - Usage: "Computes the sum of all shares that would be minted if every EigenPod on the network ran a checkpoint right now.", - Flags: []cli.Flag{ - ExecNodeFlag, - BeaconNodeFlag, - }, - Action: func(_ *cli.Context) error { - return commands.ComputeCheckpointableValueCommand(commands.TComputeCheckpointableValueCommandArgs{ - Node: node, - BeaconNode: beacon, - }) - }, - }, { Name: "find-stale-pods", Args: true, @@ -211,6 +197,61 @@ func main() { }) }, }, + { + Name: "complete-all-withdrawals", + Args: true, + Usage: "Completes all withdrawals queued on the podOwner, for which Native ETH is the sole strategy in the withdrawal. Attempts to execute a group of withdrawals whose sum does not exceed Pod.withdrawableRestakedExecutionLayerGwei() in value.", + Flags: []cli.Flag{ + ExecNodeFlag, + PodAddressFlag, + SenderPkFlag, + EstimateGasFlag, + }, + Action: func(_ *cli.Context) error { + return commands.CompleteAllWithdrawalsCommand(commands.TCompleteWithdrawalArgs{ + EthNode: node, + EigenPod: eigenpodAddress, + Sender: sender, + EstimateGas: estimateGas, + }) + }, + }, + { + Name: "queue-withdrawal", + Args: true, + Usage: "Queues a withdrawal for shares associated with the native ETH strategy. Queues a withdrawal whose size does not exceed Pod.withdrawableRestakedExecutionLayerGwei() in value.", + Flags: []cli.Flag{ + ExecNodeFlag, + PodAddressFlag, + SenderPkFlag, + EstimateGasFlag, + AmountWeiFlag, + }, + Action: func(_ *cli.Context) error { + return commands.QueueWithdrawalCommand(commands.TQueueWithdrawallArgs{ + EthNode: node, + EigenPod: eigenpodAddress, + Sender: sender, + EstimateGas: estimateGas, + AmountWei: amountWei, + }) + }, + }, + { + Name: "show-withdrawals", + Args: true, + Usage: "Shows all pending withdrawals for the podOwner.", + Flags: []cli.Flag{ + ExecNodeFlag, + PodAddressFlag, + }, + Action: func(_ *cli.Context) error { + return commands.ShowWithdrawalsCommand(commands.TShowWithdrawalArgs{ + EthNode: node, + EigenPod: eigenpodAddress, + }) + }, + }, }, Flags: []cli.Flag{ &cli.BoolFlag{ diff --git a/cli/utils/utils.go b/cli/utils/utils.go index fc0abf92..ecbc4539 100644 --- a/cli/utils/utils.go +++ b/cli/utils/utils.go @@ -64,6 +64,15 @@ func Reduce[A any, B any](coll []A, processor func(accum B, next A) B, initialSt return val } +func Unique[A comparable](coll []A) []A { + values := map[A]bool{} + return Filter(coll, func(item A) bool { + isSet := values[item] + values[item] = true + return !isSet + }) +} + func Flatten[A any](coll [][]A) []A { out := []A{} for _, arr := range coll { diff --git a/go.mod b/go.mod index 25dd283e..560241c2 100644 --- a/go.mod +++ b/go.mod @@ -5,15 +5,17 @@ go 1.22.0 toolchain go1.22.4 require ( + github.com/Layr-Labs/eigenlayer-contracts v0.4.3-mainnet-rewards-foundation-incentives.0.20241218180135-1856b33e74ac github.com/attestantio/go-eth2-client v0.19.9 github.com/ethereum/go-ethereum v1.14.9 github.com/fatih/color v1.16.0 github.com/ferranbt/fastssz v0.1.3 github.com/hashicorp/golang-lru/v2 v2.0.7 - github.com/jbrower95/multicall-go v0.0.0-20240923010412-060e37b98d03 + github.com/jbrower95/multicall-go v0.0.0-20241012224745-7e9c19976cb5 github.com/minio/sha256-simd v1.0.1 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.29.1 + github.com/samber/lo v1.47.0 github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.27.1 ) @@ -70,6 +72,7 @@ require ( golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect diff --git a/go.sum b/go.sum index 252da2cf..5c73e8d2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/Layr-Labs/eigenlayer-contracts v0.4.3-mainnet-rewards-foundation-incentives.0.20241218180135-1856b33e74ac h1:YKNXU2HFHxdR7XyrUxeXyVWf2u5tMCwKA3/2YKT54Oo= +github.com/Layr-Labs/eigenlayer-contracts v0.4.3-mainnet-rewards-foundation-incentives.0.20241218180135-1856b33e74ac/go.mod h1:Ie8YE3EQkTHqG6/tnUS0He7/UPMkXPo/3OFXwSy0iRo= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= @@ -122,10 +124,8 @@ github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jbrower95/multicall-go v0.0.0-20240922171241-ac7c02a28686 h1:qF5gBTD/k6sBIR3suNzLuSnjWgePwVbnxxQIAMl2TpY= -github.com/jbrower95/multicall-go v0.0.0-20240922171241-ac7c02a28686/go.mod h1:cl6hJrk69g0EyKPgNySQbJE1nj29t2q7Pu0as27uC04= -github.com/jbrower95/multicall-go v0.0.0-20240923010412-060e37b98d03 h1:N9nayQNnI9v8HBOUEewiSwYK9/ovMQ8ousqAeKm6RQg= -github.com/jbrower95/multicall-go v0.0.0-20240923010412-060e37b98d03/go.mod h1:cl6hJrk69g0EyKPgNySQbJE1nj29t2q7Pu0as27uC04= +github.com/jbrower95/multicall-go v0.0.0-20241012224745-7e9c19976cb5 h1:MbF9mcEhOK8A1lphvcfh5Tg7Y2p4iUAtw2+yz3jUa94= +github.com/jbrower95/multicall-go v0.0.0-20241012224745-7e9c19976cb5/go.mod h1:cl6hJrk69g0EyKPgNySQbJE1nj29t2q7Pu0as27uC04= github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= @@ -189,6 +189,8 @@ github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= +github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=