Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

CLI command to transform contract code to hex with imports replaced

未关闭
#1,157 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
blockchain, cli

调研方向

首先定位 Flow CLI 现有的 import 语法替换功能,以及 issue 中提到的网络别名处理。围绕一个合约文件(例如 ./contracts/Foo.cdc)定义新命令的参数和输出,并验证 --network emulator 会生成根据该网络别名替换 import 后的十六进制代码。

由索引模型根据 Issue 内容生成。

描述

Feature Feedback
Issue To Be Solved

I'm working on contract to aid in delegated contract updates, and this includes storing contract code in onchain resources. The easiest way to pass around contract code is as a hex string and convert it to a byte array in the transaction. However, hexifying the .cdc file contents with non-native utils means I need to explicitly state the import addresses.

It would be really helpful if I could tap into Flow CLI's import syntax replacement to handle this for me.

Suggest A Solution

Add a flow command that takes a contract file location and returns the code as a hex string, something like

flow hexify ./contracts/Foo.cdc --network emulator # returns 70756...0a7d

Where the CLI replaces import addresses in Foo according to the aliases set for the specified network and returns the resulting contract code as hex.

Context

Mentioned above

主要语言
Go
星标
209
派生
88
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

onflow/flow-cli 的其他 Issue

查看 onflow/flow-cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。