Skip to content

Commit bbbdf53

Browse files
authored
feat(sepolia/hoodi): adding support for Sepolia & Hoodi networks. (#322)
1 parent 2c5ed3a commit bbbdf53

18 files changed

+61
-46
lines changed

pkg/internal/common/constants.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

pkg/internal/common/helper.go

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,51 @@ import (
4242
const (
4343
mainnet = "mainnet"
4444
testnet = "testnet"
45+
sepolia = "sepolia"
46+
hoodi = "hoodi"
4547
local = "local"
4648
selectorHexIdLength = 10
4749
addressPrefix = "0x"
4850
)
4951

5052
var ChainMetadataMap = map[int64]types.ChainMetadata{
51-
MainnetChainId: {
52-
BlockExplorerUrl: "https://etherscan.io/tx",
53+
utils.MainnetChainId: {
54+
BlockExplorerUrl: utils.MainnetBlockExplorerUrl,
5355
ELDelegationManagerAddress: "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A",
5456
ELAVSDirectoryAddress: "0x135dda560e946695d6f155dacafc6f1f25c1f5af",
5557
ELRewardsCoordinatorAddress: "0x7750d328b314EfFa365A0402CcfD489B80B0adda",
5658
ELPermissionControllerAddress: "0x25E5F8B1E7aDf44518d35D5B2271f114e081f0E5",
5759
WebAppUrl: "https://app.eigenlayer.xyz/operator",
5860
SidecarHttpRpcURL: "https://sidecar-rpc.eigenlayer.xyz/mainnet",
5961
},
60-
HoleskyChainId: {
61-
BlockExplorerUrl: "https://holesky.etherscan.io/tx",
62+
utils.HoleskyChainId: {
63+
BlockExplorerUrl: utils.HoleskyBlockExplorerUrl,
6264
ELDelegationManagerAddress: "0xA44151489861Fe9e3055d95adC98FbD462B948e7",
6365
ELAVSDirectoryAddress: "0x055733000064333CaDDbC92763c58BF0192fFeBf",
6466
ELRewardsCoordinatorAddress: "0xAcc1fb458a1317E886dB376Fc8141540537E68fE",
6567
ELPermissionControllerAddress: "0x598cb226B591155F767dA17AfE7A2241a68C5C10",
6668
WebAppUrl: "https://holesky.eigenlayer.xyz/operator",
6769
SidecarHttpRpcURL: "https://sidecar-rpc.eigenlayer.xyz/holesky",
6870
},
69-
AnvilChainId: {
71+
utils.SepoliaChainId: {
72+
BlockExplorerUrl: utils.SepoliaBlockExplorerUrl,
73+
ELDelegationManagerAddress: "0xD4A7E1Bd8015057293f0D0A557088c286942e84b",
74+
ELAVSDirectoryAddress: "0xa789c91ECDdae96865913130B786140Ee17aF545",
75+
ELRewardsCoordinatorAddress: "0x5ae8152fb88c26ff9ca5C014c94fca3c68029349",
76+
ELPermissionControllerAddress: "0x44632dfBdCb6D3E21EF613B0ca8A6A0c618F5a37",
77+
WebAppUrl: "",
78+
SidecarHttpRpcURL: "",
79+
},
80+
utils.HoodiChainId: {
81+
BlockExplorerUrl: utils.HoodiBlockExplorerUrl,
82+
ELDelegationManagerAddress: "0x867837a9722C512e0862d8c2E15b8bE220E8b87d",
83+
ELAVSDirectoryAddress: "0xD58f6844f79eB1fbd9f7091d05f7cb30d3363926",
84+
ELRewardsCoordinatorAddress: "0x29e8572678e0c272350aa0b4B8f304E47EBcd5e7",
85+
ELPermissionControllerAddress: "0xdcCF401fD121d8C542E96BC1d0078884422aFAD2",
86+
WebAppUrl: "",
87+
SidecarHttpRpcURL: "",
88+
},
89+
utils.AnvilChainId: {
7090
BlockExplorerUrl: "",
7191
ELDelegationManagerAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
7292
ELAVSDirectoryAddress: "0x0165878A594ca255338adfa4d48449f69242Eb8F",
@@ -612,6 +632,10 @@ func GetEnvFromNetwork(network string) string {
612632
return testnet
613633
case utils.MainnetNetworkName:
614634
return mainnet
635+
case utils.SepoliaNetworkName:
636+
return sepolia
637+
case utils.HoodiNetworkName:
638+
return hoodi
615639
default:
616640
return local
617641
}

pkg/internal/common/helper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ func TestGetTransactionLink(t *testing.T) {
2424
name: "valid mainnet tx hash",
2525
chainID: big.NewInt(1),
2626
txHash: "0x123",
27-
expectedTxLink: fmt.Sprintf("%s/%s", "https://etherscan.io/tx", "0x123"),
27+
expectedTxLink: fmt.Sprintf("%s/%s", utils.MainnetBlockExplorerUrl, "0x123"),
2828
},
2929
{
3030
name: "valid holesky tx hash",
3131
chainID: big.NewInt(17000),
3232
txHash: "0x123",
33-
expectedTxLink: fmt.Sprintf("%s/%s", "https://holesky.etherscan.io/tx", "0x123"),
33+
expectedTxLink: fmt.Sprintf("%s/%s", utils.HoleskyBlockExplorerUrl, "0x123"),
3434
},
3535
{
3636
name: "valid custom chain tx hash",

pkg/operator/allocations/set_allocation_delay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func setDelayAction(cCtx *cli.Context, p utils.Prompter) error {
104104
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
105105
}
106106

107-
if config.outputType == string(common.OutputType_Calldata) {
107+
if config.outputType == utils.CallDataOutputType {
108108
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
109109
if !common.IsEmptyString(config.output) {
110110
err = common.WriteToFile([]byte(calldataHex), config.output)

pkg/operator/allocations/show.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func showAction(cCtx *cli.Context, p utils.Prompter) error {
191191
config.operatorAddress.String(),
192192
currBlockNumber,
193193
)
194-
if config.outputType == string(common.OutputType_Json) {
194+
if config.outputType == utils.JsonOutputType {
195195
slashableMagnitudeHolders.PrintJSON()
196196
} else {
197197
if !common.IsEmptyString(config.output) {
@@ -214,7 +214,7 @@ func showAction(cCtx *cli.Context, p utils.Prompter) error {
214214
"NOTE: You have %d deregistered operator sets which have nonzero allocations as listed below. Please deallocate to use those funds.\n",
215215
len(dergisteredOpsets),
216216
)
217-
if config.outputType == string(common.OutputType_Json) {
217+
if config.outputType == utils.JsonOutputType {
218218
dergisteredOpsets.PrintJSON()
219219
} else {
220220
dergisteredOpsets.PrintPretty()

pkg/operator/allocations/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func updateAllocations(cCtx *cli.Context, p utils.Prompter) error {
150150
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
151151
}
152152

153-
if config.outputType == string(common.OutputType_Calldata) {
153+
if config.outputType == utils.CallDataOutputType {
154154
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
155155
if !common.IsEmptyString(config.output) {
156156
err = common.WriteToFile([]byte(calldataHex), config.output)

pkg/operator/deregister_operator_sets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (d DeregisterOperatorSetsCmd) Execute(cCtx *cli.Context) error {
118118
return eigenSdkUtils.WrapError("failed to create unsigned transaction", err)
119119
}
120120

121-
if config.outputType == string(common.OutputType_Calldata) {
121+
if config.outputType == utils.CallDataOutputType {
122122
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
123123
if !common.IsEmptyString(config.output) {
124124
err = common.WriteToFile([]byte(calldataHex), config.output)

pkg/operator/register_operator_sets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (r RegisterOperatorSetCmd) Execute(cCtx *cli.Context) error {
113113
return eigenSdkUtils.WrapError("failed to create unsigned transaction", err)
114114
}
115115

116-
if config.outputType == string(common.OutputType_Calldata) {
116+
if config.outputType == utils.CallDataOutputType {
117117
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
118118
if !common.IsEmptyString(config.output) {
119119
err = common.WriteToFile([]byte(calldataHex), config.output)

pkg/operator/set_operator_split.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func SetOperatorSplit(cCtx *cli.Context, p utils.Prompter, isProgrammaticIncenti
136136
if err != nil {
137137
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
138138
}
139-
if config.OutputType == string(common.OutputType_Calldata) {
139+
if config.OutputType == utils.CallDataOutputType {
140140
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
141141

142142
if !common.IsEmptyString(config.OutputFile) {

pkg/rewards/claim.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func broadcastClaims(
394394
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
395395
}
396396

397-
if config.OutputType == string(common.OutputType_Calldata) {
397+
if config.OutputType == utils.CallDataOutputType {
398398
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
399399

400400
if !common.IsEmptyString(config.Output) {
@@ -406,7 +406,7 @@ func broadcastClaims(
406406
} else {
407407
fmt.Println(calldataHex)
408408
}
409-
} else if config.OutputType == string(common.OutputType_Json) {
409+
} else if config.OutputType == utils.JsonOutputType {
410410
for _, claim := range proofs {
411411
solidityClaim := formatProofForSolidity(claim)
412412
jsonData, err := json.MarshalIndent(solidityClaim, "", " ")

pkg/rewards/setclaimer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (s SetClaimerCmd) Execute(cCtx *cli.Context) error {
8282
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
8383
}
8484

85-
if config.OutputType == string(common.OutputType_Calldata) {
85+
if config.OutputType == utils.CallDataOutputType {
8686
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
8787
if !common.IsEmptyString(config.Output) {
8888
err := common.WriteToFile([]byte(calldataHex), config.Output)
@@ -92,7 +92,7 @@ func (s SetClaimerCmd) Execute(cCtx *cli.Context) error {
9292
} else {
9393
fmt.Println(calldataHex)
9494
}
95-
} else if config.OutputType == string(common.OutputType_Pretty) {
95+
} else if config.OutputType == utils.PrettyOutputType {
9696
if !common.IsEmptyString(config.Output) {
9797
fmt.Println("output file not supported for pretty output type")
9898
fmt.Println()

pkg/user/admin/accept.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func printAcceptAdminTx(
110110
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
111111
}
112112

113-
if config.OutputType == string(common.OutputType_Calldata) {
113+
if config.OutputType == utils.CallDataOutputType {
114114
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
115115
if !common.IsEmptyString(config.OutputFile) {
116116
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/user/admin/add_pending.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func printAddPendingAdminTx(
9696
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
9797
}
9898

99-
if config.OutputType == string(common.OutputType_Calldata) {
99+
if config.OutputType == utils.CallDataOutputType {
100100
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
101101
if !common.IsEmptyString(config.OutputFile) {
102102
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/user/admin/remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func printRemoveAdminTx(
110110
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
111111
}
112112

113-
if config.OutputType == string(common.OutputType_Calldata) {
113+
if config.OutputType == utils.CallDataOutputType {
114114
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
115115
if !common.IsEmptyString(config.OutputFile) {
116116
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/user/admin/remove_pending.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func printRemovePendingAdminTx(
110110
return eigenSdkUtils.WrapError("failed to create unsigned transaction", err)
111111
}
112112

113-
if config.OutputType == string(common.OutputType_Calldata) {
113+
if config.OutputType == utils.CallDataOutputType {
114114
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
115115
if !common.IsEmptyString(config.OutputFile) {
116116
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/user/appointee/remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func printRemoveAppointeeTx(
111111
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
112112
}
113113

114-
if config.OutputType == string(common.OutputType_Calldata) {
114+
if config.OutputType == utils.CallDataOutputType {
115115
calldataHex := gethcommon.Bytes2Hex(unsignedTx.Data())
116116
if !common.IsEmptyString(config.OutputFile) {
117117
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/user/appointee/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func printSetAppointeeResults(
117117
if err != nil {
118118
return eigenSdkUtils.WrapError("failed to create unsigned tx", err)
119119
}
120-
if config.OutputType == string(common.OutputType_Calldata) {
120+
if config.OutputType == utils.CallDataOutputType {
121121
calldataHex := gethcommon.Bytes2Hex(tx.Data())
122122
if !common.IsEmptyString(config.OutputFile) {
123123
err = common.WriteToFile([]byte(calldataHex), config.OutputFile)

pkg/utils/constants.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,25 @@ const (
1313

1414
MainnetChainId = 1
1515
HoleskyChainId = 17000
16+
SepoliaChainId = 11155111
17+
HoodiChainId = 560048
1618
AnvilChainId = 31337
1719

20+
CallDataOutputType string = "calldata"
21+
PrettyOutputType string = "pretty"
22+
JsonOutputType string = "json"
23+
1824
MainnetNetworkName = "mainnet"
1925
HoleskyNetworkName = "holesky"
26+
SepoliaNetworkName = "sepolia"
27+
HoodiNetworkName = "hoodi"
2028
AnvilNetworkName = "anvil"
2129
UnknownNetworkName = "unknown"
30+
31+
MainnetBlockExplorerUrl = "https://etherscan.io/"
32+
HoleskyBlockExplorerUrl = "https://holesky.etherscan.io"
33+
SepoliaBlockExplorerUrl = "https://sepolia.etherscan.io"
34+
HoodiBlockExplorerUrl = "https://hoodi.etherscan.io"
2235
)
2336

2437
var (

0 commit comments

Comments
 (0)