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

Builder Codes overview: example `dataSuffix` has the length byte in the wrong position

未关闭 适合新手
#2,070 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
documentation

调研方向

打开 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 模板
  • 没有贡献指南

从这里开始

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

base/docs 的其他 Issue

查看 base/docs 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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