mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
Replaces lux/standard/script/deploy_l2.sh (309 lines of bash) with a type-safe cobra subcommand. Same semantics: - Inventory-driven multi-brand iteration - Per-brand RPC health check + chainId match against inventory - Idempotency via cast code on canonical WLUX address - Forge invocation with KMS-first / mnemonic-fallback identity - Mainnet --i-know-this-is-real-money safeguard - --resume to continue partial broadcasts - --liquid to chain lux/liquid deploys Forge + cast still invoked as subprocesses (no native Solidity deploy). Future work: native Go contract deploy via go-ethereum bindings. Usage: lux contract deploy l2 --env devnet # dry-run lux contract deploy l2 --env testnet --confirm # broadcast lux contract deploy l2 --env mainnet --confirm --i-know-this-is-real-money lux contract deploy l2 --env mainnet --brand zoo --resume --confirm
26 lines
687 B
Go
26 lines
687 B
Go
// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package contractcmd
|
|
|
|
import (
|
|
"github.com/luxfi/cli/pkg/cobrautils"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// lux contract deploy
|
|
func newDeployCmd() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "deploy",
|
|
Short: "Deploy smart contracts",
|
|
Long: `The contract command suite provides a collection of tools for deploying
|
|
smart contracts on Lux networks.`,
|
|
RunE: cobrautils.CommandSuiteUsage,
|
|
}
|
|
// contract deploy erc20
|
|
cmd.AddCommand(newDeployERC20Cmd())
|
|
// contract deploy l2 — port of lux/standard/script/deploy_l2.sh
|
|
cmd.AddCommand(newDeployL2Cmd())
|
|
return cmd
|
|
}
|