Builder Codes overview: example `dataSuffix` has the length byte in the wrong position
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 85/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
打开 issue 中链接的 Builder Codes 概览页面,并找到“哪些钱包目前支持 ERC-8021?”部分中的 wallet.sendCalls 示例。根据 ERC-8021 schema 或 issue 中引用的 ox/erc8021 示例核对后缀,然后更正该值,或使用 Attribution.toDataSuffix 生成该值。完成标准是示例在正确的位置编码 codes 长度。
由索引模型根据 Issue 内容生成。
描述
Page: https://docs.base.org/specifications/builder-codes/overview (section "Which Wallets Currently Support ERC-8021?", the wallet.sendCalls example)
Problem: the example value is
0x07626173656170700080218021802180218021802180218021
which puts the codes-length byte (07) before the code. ERC-8021 schema 0 is parsed from the end: marker (16 bytes), schema id (1 byte), codes length (1 byte), then the codes. So the length byte must come immediately before the schema id, after the code bytes. Parsed from the end, the example yields a codes length of 0x70 (112), which is invalid.
Proof (ox 1.8.5, ox/erc8021):
$ node -e "import('ox/erc8021').then(({Attribution:A})=>{console.log(A.toDataSuffix({codes:['baseapp']}));console.log(JSON.stringify(A.fromData('0x07626173656170700080218021802180218021802180218021')))})"
0x62617365617070070080218021802180218021802180218021
{"codes":["\u0007baseap"],"id":0}
The ERC's own test vector agrees (0xdddddddd62617365617070070080218021802180218021802180218021 → ["baseapp"]), as does every schema-0 suffix we sampled on Base mainnet (5,374 suffixed transactions in 900 blocks).
Suggested fix: replace the value with 0x62617365617070070080218021802180218021802180218021, or better, generate it in the example with Attribution.toDataSuffix({ codes: ['baseapp'] }) so it can't drift.
Related: the app-developer page's "Quick Setup with Wagmi" (createConfig({ dataSuffix })) currently doesn't attach the suffix for connector wallets in @wagmi/core 3.6.5 (wevm/wagmi#5248). A note pointing to per-call dataSuffix until that is fixed would save integrators from unattributed transactions.
- 主要语言
- JavaScript
- 星标
- 342
- 派生
- 823
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 63
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
base/docs 的其他 Issue
-
Issue on docs未关闭
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
Broken redirect: /wallet-app/:slug* catch-all leads to 404可能已有人在做 @forumevi 于 26 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
docs(builder-codes): base.dev links use HTTP instead of HTTPS可能已有人在做 @xam-dev-ux 于 46 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复
-
fix(docs): Terms of Service links to Privacy Policy over HTTP可能已有人在做 @xam-dev-ux 于 46 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复
相似的 Issue
-
release:v5.34
难度 1/5 1 小时以内 新手友好度 90/100
Jason-Vaughan/TangleClaw#2469 · 1 条评论 ·
维护者通常 1 天内回复
-
hacktoberfest help wanted skip-changelog
难度 2/5 1-3 小时 新手友好度 85/100
wassim-azi/agy-powerline#74 ·
维护者通常 1 天内回复
-
tests
难度 2/5 1-3 小时 新手友好度 82/100
smonn/validator-fns#741 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复