diff --git a/cli/chain.go b/cli/chain.go index 760a060dc..7723c24bb 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -1522,6 +1522,10 @@ var ChainExecEVMCmd = &cli.Command{ Name: "from", Usage: "optionally specify the account to use for sending the exec message", }, + &cli.BoolFlag{ + Name: "hex", + Usage: "use when input contract is in hex", + }, }, Action: func(cctx *cli.Context) error { afmt := NewAppFmt(cctx.App) @@ -1541,6 +1545,12 @@ var ChainExecEVMCmd = &cli.Command{ if err != nil { return xerrors.Errorf("failed to read contract: %w", err) } + if cctx.Bool("hex") { + contract, err = hex.DecodeString(string(contract)) + if err != nil { + return xerrors.Errorf("failed to decode contract: %w", err) + } + } constructorParams, err := actors.SerializeParams(&evm.ConstructorParams{ Bytecode: contract,