You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chainIDStr:=cmdutil.PromptInputWithValidation("Please enter the chain ID of the network", func(chainIDstrstring) error {
49
+
ifchainIDstr=="" {
50
+
returnfmt.Errorf("chain ID cannot be empty")
51
+
}
52
+
_, err:=strconv.Atoi(chainIDstr)
53
+
iferr!=nil {
54
+
returnfmt.Errorf("chain ID must be a number")
55
+
}
56
+
returnnil
57
+
})
58
+
chainID, _:=strconv.Atoi(chainIDStr)
59
+
60
+
nativeTokenSymbol:=cmdutil.PromptInputWithValidation("Please enter the native token symbol of the network", func(nativeTokenSymbolstring) error {
61
+
ifnativeTokenSymbol=="" {
62
+
returnfmt.Errorf("native token symbol cannot be empty")
63
+
}
64
+
returnnil
65
+
})
66
+
67
+
nativeTokenDecimalStr:=cmdutil.PromptInputWithValidation("Please enter the native token decimal of the network", func(nativeTokenDecimalstring) error {
68
+
ifnativeTokenDecimal=="" {
69
+
returnfmt.Errorf("native token decimal cannot be empty")
70
+
}
71
+
_, err:=strconv.Atoi(nativeTokenDecimal)
72
+
iferr!=nil {
73
+
returnfmt.Errorf("native token decimal must be a number")
returnfmt.Errorf("node variable name must be in capital letters")
99
+
}
100
+
returnnil
101
+
})
102
+
103
+
defaultNodesStr:=cmdutil.PromptInputWithValidation("Please enter the default node urls of the network (comma separated, no wrapping with quotes)", func(defaultNodesstring) error {
104
+
ifdefaultNodes=="" {
105
+
returnfmt.Errorf("default node urls cannot be empty")
106
+
}
107
+
108
+
nodes:=strings.Split(defaultNodes, ",")
109
+
for_, node:=rangenodes {
110
+
// check if the node is a valid url
111
+
_, err:=url.Parse(node)
112
+
iferr!=nil {
113
+
returnfmt.Errorf("default node url %s is not a valid url", node)
blockExplorerAPIKeyVariableName:=cmdutil.PromptInputWithValidation("Please enter the block explorer API key variable name of the network", func(blockExplorerAPIKeyVariableNamestring) error {
126
+
ifblockExplorerAPIKeyVariableName=="" {
127
+
returnfmt.Errorf("block explorer API key variable name cannot be empty")
128
+
}
129
+
returnnil
130
+
})
131
+
132
+
blockExplorerAPIURL:=cmdutil.PromptInputWithValidation("Please enter the block explorer API URL of the network", func(blockExplorerAPIURLstring) error {
133
+
ifblockExplorerAPIURL=="" {
134
+
returnfmt.Errorf("block explorer API URL cannot be empty")
135
+
}
136
+
_, err:=url.Parse(blockExplorerAPIURL)
137
+
iferr!=nil {
138
+
returnfmt.Errorf("block explorer API URL %s is not a valid url", blockExplorerAPIURL)
139
+
}
140
+
returnnil
141
+
})
142
+
143
+
multiCallContractAddress:=cmdutil.PromptInputWithValidation("Please enter the multi call contract address of the network", func(multiCallContractAddressstring) error {
144
+
ifmultiCallContractAddress=="" {
145
+
returnfmt.Errorf("multi call contract address cannot be empty")
0 commit comments