broker

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:   "broker",
		Short: "BrokerDealer utilities",
	}

	DeployCommand = &cobra.Command{
		Use:     "deploy",
		Short:   "Deploys a new broker-dealer registry contract",
		Example: "t0ken broker deploy <registry> --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.DeployBrokerDealer(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 Broker Dealer Registry ABI",
		Example: "t0ken broker abi",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.BrokerDealerABI) },
	},
	&cobra.Command{
		Use:     "bin",
		Short:   "Outputs the Broker Dealer Binary",
		Example: "t0ken broker bin",
		Args:    cobra.NoArgs,
		Run:     func(cmd *cobra.Command, args []string) { cmd.Println(registry.BrokerDealerBin) },
	},
	&cobra.Command{
		Use:     "registry",
		Short:   "Gets the Registry contract address",
		Example: "t0ken broker 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 <broker> <hash>",
		Short:   "Adds the <broker> <hash> to the registry",
		Example: "t0ken broker add 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da 0x6ea3939dd4721de598d003ee4796ea2a59ab095cf6b28d49fadd43a5e34db548 --keystoreAddress custodian",
		Args:    cli.ChainArgs(cli.AddressArgFunc("broker", 0), cli.HexArgLenFunc("hash", 1, 16)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			broker := common.HexToAddress(args[0])
			hash, _ := cli.Bytes32FromArg(args[1])
			cli.PrintTransactionFn(cmd)(transSession.Add(broker, hash))
		},
	},
	&cobra.Command{
		Use:     "addAccount <broker> <acccount>",
		Short:   "Adds the custodial-<account> to the <broker>",
		Example: "t0ken broker addAccount 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da 0xa01a0a93716633058d69a28fbd472fd40e7c6b79 --keystoreAddress custodian",
		Args:    cli.ChainArgs(cli.AddressArgFunc("broker", 0), cli.AddressArgFunc("account", 1)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			broker := common.HexToAddress(args[0])
			custodialAccount := common.HexToAddress(args[1])
			cli.PrintTransactionFn(cmd)(transSession.AddAccount(broker, custodialAccount))
		},
	},
	&cobra.Command{
		Use:     "remove <broker>",
		Short:   "Removes the <broker> address",
		Example: "t0ken broker remove 0xb01ba0d19cc9cd613253bad489b69e583dbfd4da --keystoreAddress custodian",
		Args:    cli.ChainArgs(cli.AddressArgFunc("broker", 0)),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			addr := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.Remove(addr))
		},
	},
	&cobra.Command{
		Use:     "removeAccount <acccount>",
		Short:   "Removes the custodial-<account> of a broker",
		Example: "t0ken broker removeAccount 0xa01a0a93716633058d69a28fbd472fd40e7c6b79 --keystoreAddress custodian",
		Args:    cli.AddressArgFunc("account", 0),
		PreRun:  connectTransactor,
		Run: func(cmd *cobra.Command, args []string) {
			custodialAccount := common.HexToAddress(args[0])
			cli.PrintTransactionFn(cmd)(transSession.RemoveAccount(custodialAccount))
		},
	},
	&cobra.Command{
		Use:     "setRegistry <address>",
		Short:   "Sets the registry contract to <address>",
		Example: "t0ken broker 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