github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/cmd/contract/contractinvoke.go (about) 1 // Copyright (c) 2022 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package contract 7 8 import ( 9 "github.com/spf13/cobra" 10 11 "github.com/iotexproject/iotex-core/ioctl/cmd/action" 12 "github.com/iotexproject/iotex-core/ioctl/config" 13 ) 14 15 // Multi-language support 16 var ( 17 _invokeCmdShorts = map[config.Language]string{ 18 config.English: "Invoke smart contract on IoTeX blockchain", 19 config.Chinese: "调用IoTeX区块链上的智能合约", 20 } 21 ) 22 23 // _contractInvokeCmd represents the contract invoke command 24 var _contractInvokeCmd = &cobra.Command{ 25 Use: "invoke", 26 Short: config.TranslateInLang(_invokeCmdShorts, config.UILanguage), 27 } 28 29 func init() { 30 _contractInvokeCmd.AddCommand(_contractInvokeFunctionCmd) 31 _contractInvokeCmd.AddCommand(_contractInvokeBytecodeCmd) 32 action.RegisterWriteCommand(_contractInvokeFunctionCmd) 33 action.RegisterWriteCommand(_contractInvokeBytecodeCmd) 34 35 }