Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 23 additions & 37 deletions cli/core/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,52 +595,30 @@ func PanicIfNoConsent(prompt string) {
}

func PrepareAccount(owner *string, chainID *big.Int, noSend bool) (*Owner, error) {
if noSend {
isSimulatingGas := owner != nil && *owner != ""
var senderPk = func() string {
if owner == nil || *owner == "" {
return "372d94b8645091147a5dfc10a454d0d539773d2431293bf0a195b44fa5ddbb33" // this is a RANDOM private key. Do not use this for anything.
isSimulatingGas := owner != nil && *owner != ""
senderPk, err := func() (string, error) {
// if we're trying to send a transaction, make sure we were supplied a private key
if owner == nil || *owner == "" {
if !noSend {
return "", errors.New("no private key supplied")
}
return *owner
}()

privateKey, err := crypto.HexToECDSA(senderPk)
if err != nil {
return nil, err
}

publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
}
fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
auth, err := bind.NewKeyedTransactorWithChainID(privateKey, chainID)
if err != nil {
return nil, err
return "372d94b8645091147a5dfc10a454d0d539773d2431293bf0a195b44fa5ddbb33", nil // this is a RANDOM private key used as a default value. do not use.
}

if !isSimulatingGas {
auth.GasPrice = nil // big.NewInt(10) // Gas price to use for the transaction execution (nil = gas price oracle)
auth.GasFeeCap = big.NewInt(10) // big.NewInt(10) // Gas fee cap to use for the 1559 transaction execution (nil = gas price oracle)
auth.GasTipCap = big.NewInt(2) // big.NewInt(2) // Gas priority fee cap to use for the 1559 transaction execution (nil = gas price oracle)
auth.GasLimit = 21000
}
auth.NoSend = true
return *owner, nil
}()

return &Owner{
FromAddress: fromAddress,
PublicKey: nil,
TransactionOptions: auth,
IsDryRun: true,
}, nil
if err != nil {
return nil, err
}

if owner == nil {
return nil, errors.New("no owner")
// trim leading "0x" if needed
if senderPk[0:2] == "0x" {
senderPk = senderPk[2:]
}

privateKey, err := crypto.HexToECDSA(*owner)
privateKey, err := crypto.HexToECDSA(senderPk)
if err != nil {
return nil, err
}
Expand All @@ -656,6 +634,14 @@ func PrepareAccount(owner *string, chainID *big.Int, noSend bool) (*Owner, error
return nil, err
}

auth.NoSend = noSend
if noSend && !isSimulatingGas {
auth.GasPrice = nil // big.NewInt(10) // Gas price to use for the transaction execution (nil = gas price oracle)
auth.GasFeeCap = big.NewInt(10) // big.NewInt(10) // Gas fee cap to use for the 1559 transaction execution (nil = gas price oracle)
auth.GasTipCap = big.NewInt(2) // big.NewInt(2) // Gas priority fee cap to use for the 1559 transaction execution (nil = gas price oracle)
auth.GasLimit = 21000
}

return &Owner{
FromAddress: fromAddress,
PublicKey: publicKeyECDSA,
Expand Down
42 changes: 19 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/Layr-Labs/eigenpod-proofs-generation

go 1.22.0
go 1.23.0

toolchain go1.22.4
toolchain go1.23.10

require (
github.com/Layr-Labs/eigenlayer-contracts v1.4.1-testnet-holeksy.0.20250515141756-179e268ddbff
github.com/Layr-Labs/eigenlayer-contracts v1.6.0
github.com/attestantio/go-eth2-client v0.24.0
github.com/ethereum/go-ethereum v1.14.9
github.com/ethereum/go-ethereum v1.16.1
github.com/fatih/color v1.18.0
github.com/ferranbt/fastssz v0.1.4
github.com/hashicorp/golang-lru/v2 v2.0.7
Expand All @@ -17,27 +17,25 @@ require (
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.32.0
github.com/samber/lo v1.47.0
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.1
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.5
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.14.3 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/consensys/bavard v0.1.16 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/consensys/gnark-crypto v0.18.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/crate-crypto/go-eth-kzg v1.3.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/emicklei/dot v1.6.4 // indirect
github.com/ethereum/c-kzg-4844 v1.0.3 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -51,7 +49,6 @@ require (
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/pk910/dynamic-ssz v0.0.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
Expand All @@ -62,24 +59,23 @@ require (
github.com/r3labs/sse/v2 v2.10.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading
Loading