Documentation ¶
Overview ¶
Package deploy contains the implementation of the deploy subcommand
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DeployCmd = &cobra.Command{ Use: "deploy", Short: "Deploy all Shutter contracts", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { var err error if deployFlags.GasPrice != "" { gasPriceGWei, ok := new(big.Int).SetString(deployFlags.GasPrice, 10) if !ok { return errors.Errorf("--gas-price: invalid gas price '%s'", deployFlags.GasPrice) } if gasPriceGWei.Sign() < 0 { return errors.Errorf("--gas-price: must be non-negative") } gasPrice = gweiToWei(gasPriceGWei) } if deployFlags.OutputFile != "" { deployFlags.OutputFile = filepath.Clean(deployFlags.OutputFile) } key, err = crypto.HexToECDSA(strings.TrimPrefix(deployFlags.OwnerKey, "0x")) if err != nil { return errors.WithMessage(err, "invalid --owner-key argument") } ctx, cancel := context.WithTimeout(context.Background(), deployDefaultTimeout) defer cancel() client, err := ethclient.DialContext(ctx, deployFlags.EthereumURL) if err != nil { return err } if gasPrice == nil { gasPrice, err = client.SuggestGasPrice(ctx) if err != nil { return err } } address := crypto.PubkeyToAddress(key.PublicKey) balance, err := client.BalanceAt(ctx, address, nil) if err != nil { return err } log.Printf("Deploy Address: %s", address) log.Printf("Balance: %f ETH", weiToEther(balance)) log.Printf("Gas Price: %f GWei", weiToGwei(gasPrice)) log.Printf("Available gas: %d", new(big.Int).Quo(balance, gasPrice)) if !deployFlags.NoERC1820 { err := maybeDeployERC1820(ctx, client) if err != nil { return err } } return deploy(ctx, client) }, }
Functions ¶
This section is empty.
Types ¶
type ChecksumAddr ¶
type ChecksumAddr = medley.ChecksumAddr
type Contracts ¶
type Contracts struct { ConfigContract common.Address KeyBroadcastContract common.Address FeeBankContract common.Address BatcherContract common.Address ExecutorContract common.Address TokenContract common.Address DepositContract common.Address KeyperSlasherContract common.Address TargetProxyContract common.Address TargetContract common.Address }
Contracts stores the addresses of all contracts.
func LoadContractsJSON ¶
LoadContractsJSON loads and validates a contracts json file.
func (Contracts) MarshalJSON ¶
MarshalJSON makes us output checksum addresses when marshaling as json.
func (*Contracts) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.