custodian

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Command = &cobra.Command{
		Use:   "custodian",
		Short: "Custodian utilities",
	}

	DeployCommand = &cobra.Command{
		Use:     "deploy <registry>",
		Short:   "Deploys a new custodian registry contract",
		Example: "t0ken custodian deploy 0x397e7b9c15ff22ba67ec6e78f46f1e21540bcb36 --keystoreAddress owner",
		Args:    cli.AddressArgFunc("registry", 0),
		PreRun:  commands.ConnectWithKeyStore,
		Run: func(cmd *cobra.Command, args []string) {

			registryAddress := common.HexToAddress(args[0])
			addr, tx, _, err := registry.DeployCustodian(cli.Conn.Opts, cli.Conn.Client, registryAddress)
			cli.CheckErr(cmd, err)
			cmd.Println("   Contract:", addr.String())
			cli.PrintTransactionFn(cmd)(tx, nil)
		},
	}
)
View Source
var GetterCommands = []*cobra.Command{
	&cobra.Command{
		Use:     "abi",
		Short:   "Outputs the Custodian Registry ABI",
		Example: "t0ken custodian abi",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.CustodianABI) },
	},
	&cobra.Command{
		Use:     "bin",
		Short:   "Outputs the Registry Binary",
		Example: "t0ken custodian bin",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.CustodianBin) },
	},
	&cobra.Command{
		Use:     "registry",
		Short:   "Gets the Registry contract address",
		Example: "t0ken custodian registry",
		Args:    cobra.NoArgs,
		PreRun:  connectCaller,
		Run: func(cmd *cobra.Command, args []string) {
			cli.CheckAddressGetter(cmd)(callSession.Registry())
		},
	},
}
View Source
var SetterCommands = []*cobra.Command{
	&cobra.Command{
		Use:     "add <custodian> <hash>",
		Short:   "Adds the <custodian> <hash> to the registry",
		Example: "t0ken custodian add 0xc01c68ac7dd1cc48f95e3187a33a170fdb9023e7 0x6ea3939dd4721de598d003ee4796ea2a59ab095cf6b28d49fadd43a5e34db548 --keystoreAddress owner",
		Args:    cli.ChainArgs(cli.AddressArgFunc("custodian", 0), cli.HexArgLenFunc("hash", 1, 16)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			custodian := common.HexToAddress(args[0])
			hash, _ := cli.Bytes32FromArg(args[1])
			cli.PrintTransactionFn(cmd)(transSession.Add(custodian, hash))
		},
	},
	&cobra.Command{
		Use:     "remove <custodian>",
		Short:   "Removes the <custodian> address",
		Example: "t0ken custodian remove 0xc01c68ac7dd1cc48f95e3187a33a170fdb9023e7 --keystoreAddress owner",
		Args:    cli.ChainArgs(cli.AddressArgFunc("custodian", 0)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			addr := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.Remove(addr))
		},
	},
	&cobra.Command{
		Use:     "setRegistry <address>",
		Short:   "Sets the registry contract to <address>",
		Example: "t0ken custodian setRegistry 0x397e7b9c15ff22ba67ec6e78f46f1e21540bcb36 --keystoreAddress owner",
		Args:    cli.AddressArgFunc("address", 0),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			addr := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.SetRegistry(addr))
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL