Skip to content

Commit

Permalink
all fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrower95 committed Jul 15, 2024
1 parent 19f0cf9 commit 045dc08
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ WARNING: Please note that this repository is a work in progress and is currently

PEPE Changes how we prove balances to EigenLayer. For more information, check out some of the links below.

WARNING: You should only use this software with Holesky Testnet. When PePe goes to production, we will update this tool to support further networks. Thanks!

## Links

- [More about PEPE](https://hackmd.io/U36dE9lnQha3tbf7D0GtKw?view)
- [Contract Documentation](https://github.com/Layr-Labs/eigenlayer-contracts/blob/feat/partial-withdrawal-batching/docs/core/EigenPod.md)


# Usage

- If you want to produce and submit proofs onchain -- either immediately, or by writing to a file to submit later -- check out our [CLI](./cli/README.md). The CLI can produce both credential and checkpoint proofs, and submit them onchain if given a private key.
Expand Down
2 changes: 2 additions & 0 deletions cli/core/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func SubmitCheckpointProofBatch(owner, eigenpodAddress string, chainId *big.Int,
return nil, err
}

fmt.Printf("Using account(0x%s) to submit onchain\n", common.Bytes2Hex(ownerAccount.FromAddress[:]))

eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth)
if err != nil {
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions cli/core/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ func GetClients(ctx context.Context, node, beaconNodeUri string) (*ethclient.Cli
chainId, err := eth.ChainID(ctx)
PanicOnError("failed to fetch chain id", err)

if chainId == nil || chainId.Int64() != 17000 {
Panic("This tool only supports the Holesky network.")
}

beaconClient, err := GetBeaconClient(beaconNodeUri)
PanicOnError("failed to reach beacon chain.", err)

Expand Down
14 changes: 11 additions & 3 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ func main() {
proof, err := core.LoadCheckpointProofFromFile(checkpointProofPath)
core.PanicOnError("failed to parse checkpoint proof from file", err)

core.SubmitCheckpointProof(ctx, *owner, eigenpodAddress, chainId, proof, eth, batchSize, noPrompt)
txns, err := core.SubmitCheckpointProof(ctx, *owner, eigenpodAddress, chainId, proof, eth, batchSize, noPrompt)
for _, txn := range txns {
color.Green("submitted txn: %s", txn.Hash())
}
core.PanicOnError("an error occurred while submitting your checkpoint proofs", err)
return nil
}

Expand Down Expand Up @@ -222,7 +226,11 @@ func main() {
if out != nil {
core.WriteOutputToFileOrStdout(jsonString, out)
} else if owner != nil {
core.SubmitCheckpointProof(ctx, *owner, eigenpodAddress, chainId, proof, eth, batchSize, noPrompt)
txns, err := core.SubmitCheckpointProof(ctx, *owner, eigenpodAddress, chainId, proof, eth, batchSize, noPrompt)
for _, txn := range txns {
color.Green("submitted txn: %s", txn.Hash())
}
core.PanicOnError("an error occurred while submitting your checkpoint proofs", err)
}

return nil
Expand Down Expand Up @@ -255,10 +263,10 @@ func main() {

if owner != nil {
txns, err := core.SubmitValidatorProof(ctx, *owner, eigenpodAddress, chainId, eth, batchSize, validatorProofs, oracleBeaconTimestamp, noPrompt)
core.PanicOnError("failed to invoke verifyWithdrawalCredentials", err)
for i, txn := range txns {
color.Green("transaction(%d): %s", i, txn.Hash().Hex())
}
core.PanicOnError("failed to invoke verifyWithdrawalCredentials", err)
} else {
data := map[string]any{
"validatorProofs": validatorProofs,
Expand Down

0 comments on commit 045dc08

Please sign in to comment.