Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "add-contract <name> <filename>", Short: "Deploy a new contract to an account", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { projectConf := cli.LoadConfig() contractName := args[0] contractFilename := args[1] contractSource, err := ioutil.ReadFile(contractFilename) if err != nil { cli.Exitf(1, "Failed to read contract from source file %s", contractFilename) } signerAccount := projectConf.Accounts[conf.Signer] tx := templates.AddAccountContract( signerAccount.Address, templates.Contract{ Name: contractName, Source: string(contractSource), }, ) cli.SendTransaction( projectConf.HostWithOverride(conf.Host), signerAccount, tx, conf.Results, ) }, }
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.