CLI command to transform contract code to hex with imports replaced
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- go
- 领域
- blockchain, cli
调研方向
首先定位 Flow CLI 现有的 import 语法替换功能,以及 issue 中提到的网络别名处理。围绕一个合约文件(例如 ./contracts/Foo.cdc)定义新命令的参数和输出,并验证 --network emulator 会生成根据该网络别名替换 import 后的十六进制代码。
由索引模型根据 Issue 内容生成。
描述
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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
onflow/flow-cli 的其他 Issue
-
Simplify MCP contract sorting with slices helpers可能已有人在做 @luangucun 于 48 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
`flow cadence lint` lints imports可能已有人在做 @holyfuchs 于 187 天前认领。 未关闭Bug Improvement
难度 2/5 1-3 小时 新手友好度 78/100
-
Bug
难度 3/5 1-2 天 新手友好度 48/100
-
flow test prints unreadable output可能已有人在做 @holyfuchs 于 186 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
-
Feature
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
OpenTollGate/tollgate-module-basic-go#1027 ·
维护者通常 1 天内回复
-
help wanted needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
hivecommons/hive#13223 · 1 条评论 ·
维护者通常 1 天内回复
-
[BUG]: Windows GUI package of v1.17.0-rc3 has no GTK DLLs可能已有人在做 @andrut-ds 今天认领。 未关闭bug CI/CD Pactus-GUI Windows
难度 2/5 1-3 小时 新手友好度 82/100
pactus-project/pactus#2428 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
维护者通常 1 天内回复