{"eip":7538,"title":"Multiplicative Tokens","description":"Incorporates a multiplier field to ERC-20 and ERC-1155 for fractional token values","authors":["Gavin John (@Pandapip1)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-10-18","requires":[20,1046,1155],"discussionsTo":"https://ethereum-magicians.org/t/multiplicative-tokens/16149","repo":"ERCs","label":"ERC-7538","officialUrl":"https://eips.ethereum.org/EIPS/eip-7538","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7538.md","url":"https://eips.huatuo.xyz/eip-7538/","tldr":{"en":"Replaces the decimals field with a base-10 string multiplier in ERC-1046 token metadata, so wallets can display fractional, non-power-of-ten or rebasing-style balances without changing the on-chain integer.","ja":"ERC-1046 のトークンメタデータで decimals フィールドを 10 進数の文字列の乗数に置き換え、ウォレットがオンチェーンの整数を変えずに、小数、10 のべき乗でない値、リベース型の残高を表示できるようにする。","ko":"ERC-1046 토큰 메타데이터에서 decimals 필드를 10진수 문자열 승수로 대체하여, 지갑이 온체인 정수를 바꾸지 않고도 소수, 10의 거듭제곱이 아닌 값, 리베이스 방식의 잔액을 표시할 수 있게 한다.","zh":"在 ERC-1046 代币元数据中用以 10 为基数的字符串乘数取代 decimals 字段，使钱包无需改变链上整数，就能显示小数、非 10 的幂或 rebase 式的余额。"},"tags":["token","metadata","display","fungible"],"explainers":{"en":{"lang":"en","tldr":"Replaces the decimals field with a base-10 string multiplier in ERC-1046 token metadata, so wallets can display fractional, non-power-of-ten or rebasing-style balances without changing the on-chain integer.","tags":["token","metadata","display","fungible"],"related":[1046,20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7538/","markdown":"## What problem does it solve?\n\nOn-chain token balances are integers. [ERC-20](/eip-20/) uses `decimals` to tell wallets where to put the decimal point, which only supports scaling by powers of ten. [ERC-1155](/eip-1155/) tokens have no standard way to show fractional amounts at all.\n\nSome projects want more flexible display: units that move in steps of `0.5`, a scale factor that changes over time to model inflation or deflation, or fractional versions of multi-token assets. ERC-7538 gives them a single, general knob: a **multiplier**.\n\n## How it works\n\nThe proposal builds on [ERC-1046](/eip-1046/), which lets ERC-20 and ERC-1155 tokens point to an off-chain JSON metadata document via `tokenURI`.\n\n- The resolved metadata may include a `multiplier` field, a **string** holding an exact base-10 positive number (for example `\"0.5\"` or `\"0.000001\"`).\n- If `multiplier` is absent, it defaults to `1`.\n- Wallets derive the user-facing amount from the raw integer balance using the multiplier, instead of using `decimals`.\n- Tokens that use a multiplier must **not** expose a `decimals` method, and the metadata must not contain `decimals`.\n\nBecause the value lives in metadata rather than contract storage, the issuer can change the displayed scale (for instance to reflect inflation) by updating the document, with no on-chain transaction for holders.\n\nStrings are used instead of numbers so that very small or very large values keep full precision.\n\n## Sample code\n\nERC-1046 metadata for a token whose smallest unit should display as half a token:\n\n```json\n{\n  \"interop\": { \"erc1046\": true },\n  \"name\": \"Half Token\",\n  \"symbol\": \"HALF\",\n  \"multiplier\": \"0.5\"\n}\n```\n\nWallet-side formatting without floating point (TypeScript):\n\n```ts\n// Exact decimal multiply: raw (bigint) × multiplier (decimal string)\nfunction formatWithMultiplier(raw: bigint, multiplier = \"1\"): string {\n  const [int, frac = \"\"] = multiplier.split(\".\");\n  const scaled = raw * BigInt(int + frac);        // shift multiplier to an integer\n  const s = scaled.toString().padStart(frac.length + 1, \"0\");\n  if (frac.length === 0) return s;\n  const head = s.slice(0, -frac.length);\n  const tail = s.slice(-frac.length).replace(/0+$/, \"\");\n  return tail ? `${head}.${tail}` : head;\n}\n\nformatWithMultiplier(3n, \"0.5\"); // \"1.5\"\n```\n\n## Things to know\n\n- Status is **Draft**.\n- It is deliberately incompatible with `decimals`. Wallets and protocols that only understand ERC-20 `decimals` will show raw integers for these tokens.\n- The multiplier must be strictly positive; `0` is not allowed.\n- Do the maths with exact decimal or big-integer arithmetic. Floating-point rounding errors in display or conversion code can be exploited.\n- Very large or very small multipliers can be hard to display; wallets should still try to show the full number.\n"},"ja":{"lang":"ja","tldr":"ERC-1046 のトークンメタデータで decimals フィールドを 10 進数の文字列の乗数に置き換え、ウォレットがオンチェーンの整数を変えずに、小数、10 のべき乗でない値、リベース型の残高を表示できるようにする。","tags":["token","metadata","display","fungible"],"related":[1046,20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7538/","markdown":"## 何を解決するのか\n\nオンチェーンのトークン残高は整数です。[ERC-20](/eip-20/) は `decimals` でウォレットに小数点の位置を伝えますが、これは 10 のべき乗によるスケーリングにしか対応しません。[ERC-1155](/eip-1155/) トークンには、小数の数量を表示する標準的な方法がそもそもありません。\n\nプロジェクトによっては、もっと柔軟な表示を求めます。`0.5` 刻みで動く単位、インフレやデフレを表すために時間とともに変化するスケール係数、マルチトークン資産の小数版などです。ERC-7538 は、そのための汎用的なつまみを 1 つ提供します。**乗数（multiplier）**です。\n\n## 仕組み\n\nこの提案は [ERC-1046](/eip-1046/) の上に成り立っています。ERC-1046 は、ERC-20 と ERC-1155 のトークンが `tokenURI` を介してオフチェーンの JSON メタデータドキュメントを指せるようにします。\n\n- 解決されたメタデータには `multiplier` フィールドを含められます。これは、正確な 10 進数の正の数（たとえば `\"0.5\"` や `\"0.000001\"`）を保持する**文字列**です。\n- `multiplier` がない場合、デフォルトは `1` です。\n- ウォレットは、`decimals` の代わりに乗数を使って、生の整数残高からユーザー向けの数量を導き出します。\n- 乗数を使うトークンは `decimals` メソッドを公開しては**いけません**。また、メタデータに `decimals` を含めてはいけません。\n\n値がコントラクトのストレージではなくメタデータにあるため、発行者はドキュメントを更新するだけで（たとえばインフレを反映するために）表示スケールを変更でき、保有者側でのオンチェーントランザクションは不要です。\n\n非常に小さい値や非常に大きい値でも精度を完全に保てるよう、数値ではなく文字列が使われます。\n\n## サンプルコード\n\n最小単位が 0.5 トークンとして表示されるべきトークンの ERC-1046 メタデータ:\n\n```json\n{\n  \"interop\": { \"erc1046\": true },\n  \"name\": \"Half Token\",\n  \"symbol\": \"HALF\",\n  \"multiplier\": \"0.5\"\n}\n```\n\n浮動小数点を使わないウォレット側のフォーマット処理（TypeScript）:\n\n```ts\n// Exact decimal multiply: raw (bigint) × multiplier (decimal string)\nfunction formatWithMultiplier(raw: bigint, multiplier = \"1\"): string {\n  const [int, frac = \"\"] = multiplier.split(\".\");\n  const scaled = raw * BigInt(int + frac);        // shift multiplier to an integer\n  const s = scaled.toString().padStart(frac.length + 1, \"0\");\n  if (frac.length === 0) return s;\n  const head = s.slice(0, -frac.length);\n  const tail = s.slice(-frac.length).replace(/0+$/, \"\");\n  return tail ? `${head}.${tail}` : head;\n}\n\nformatWithMultiplier(3n, \"0.5\"); // \"1.5\"\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。\n- 意図的に `decimals` と互換性がありません。ERC-20 の `decimals` しか理解しないウォレットやプロトコルは、これらのトークンを生の整数として表示します。\n- 乗数は厳密に正でなければならず、`0` は許されません。\n- 計算には、正確な 10 進数または大きな整数の演算を使ってください。表示や変換のコードにおける浮動小数点の丸め誤差は悪用される可能性があります。\n- 非常に大きい、または非常に小さい乗数は表示が難しいことがあります。それでもウォレットは数値全体を表示するよう努めるべきです。\n"},"ko":{"lang":"ko","tldr":"ERC-1046 토큰 메타데이터에서 decimals 필드를 10진수 문자열 승수로 대체하여, 지갑이 온체인 정수를 바꾸지 않고도 소수, 10의 거듭제곱이 아닌 값, 리베이스 방식의 잔액을 표시할 수 있게 한다.","tags":["token","metadata","display","fungible"],"related":[1046,20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7538/","markdown":"## 어떤 문제를 해결하나요?\n\n온체인 토큰 잔액은 정수입니다. [ERC-20](/eip-20/)은 `decimals`로 지갑에 소수점 위치를 알려 주는데, 이는 10의 거듭제곱 단위의 스케일링만 지원합니다. [ERC-1155](/eip-1155/) 토큰에는 소수 수량을 표시하는 표준 방법이 아예 없습니다.\n\n일부 프로젝트는 더 유연한 표시를 원합니다. `0.5` 단위로 움직이는 단위, 인플레이션이나 디플레이션을 반영하도록 시간에 따라 바뀌는 스케일 계수, 멀티 토큰 자산의 소수 버전 등입니다. ERC-7538은 이를 위한 범용 조절 장치 하나를 제공합니다. 바로 **승수(multiplier)**입니다.\n\n## 어떻게 동작하나요?\n\n이 제안은 ERC-20과 ERC-1155 토큰이 `tokenURI`를 통해 오프체인 JSON 메타데이터 문서를 가리키게 해 주는 [ERC-1046](/eip-1046/) 위에 만들어졌습니다.\n\n- 해석된 메타데이터에는 `multiplier` 필드가 포함될 수 있으며, 이는 정확한 10진수 양수(예: `\"0.5\"` 또는 `\"0.000001\"`)를 담은 **문자열**입니다.\n- `multiplier`가 없으면 기본값은 `1`입니다.\n- 지갑은 `decimals` 대신 승수를 사용해 원시 정수 잔액에서 사용자에게 보여 줄 수량을 도출합니다.\n- 승수를 사용하는 토큰은 `decimals` 메서드를 노출해서는 **안 되며**, 메타데이터에도 `decimals`가 포함되어서는 안 됩니다.\n\n값이 컨트랙트 스토리지가 아니라 메타데이터에 있으므로, 발행자는 문서를 업데이트하는 것만으로(예: 인플레이션을 반영하기 위해) 표시 스케일을 바꿀 수 있고, 보유자는 온체인 트랜잭션을 보낼 필요가 없습니다.\n\n아주 작거나 아주 큰 값도 정밀도를 온전히 유지하도록 숫자가 아니라 문자열을 사용합니다.\n\n## 샘플 코드\n\n가장 작은 단위가 토큰 반 개로 표시되어야 하는 토큰의 ERC-1046 메타데이터:\n\n```json\n{\n  \"interop\": { \"erc1046\": true },\n  \"name\": \"Half Token\",\n  \"symbol\": \"HALF\",\n  \"multiplier\": \"0.5\"\n}\n```\n\n부동소수점을 쓰지 않는 지갑 측 포맷팅(TypeScript):\n\n```ts\n// Exact decimal multiply: raw (bigint) × multiplier (decimal string)\nfunction formatWithMultiplier(raw: bigint, multiplier = \"1\"): string {\n  const [int, frac = \"\"] = multiplier.split(\".\");\n  const scaled = raw * BigInt(int + frac);        // shift multiplier to an integer\n  const s = scaled.toString().padStart(frac.length + 1, \"0\");\n  if (frac.length === 0) return s;\n  const head = s.slice(0, -frac.length);\n  const tail = s.slice(-frac.length).replace(/0+$/, \"\");\n  return tail ? `${head}.${tail}` : head;\n}\n\nformatWithMultiplier(3n, \"0.5\"); // \"1.5\"\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다.\n- 의도적으로 `decimals`와 호환되지 않습니다. ERC-20 `decimals`만 이해하는 지갑과 프로토콜은 이 토큰을 원시 정수로 표시합니다.\n- 승수는 엄격히 양수여야 하며 `0`은 허용되지 않습니다.\n- 정확한 10진수 또는 큰 정수 연산으로 계산하세요. 표시나 변환 코드의 부동소수점 반올림 오차는 악용될 수 있습니다.\n- 아주 크거나 아주 작은 승수는 표시하기 어려울 수 있습니다. 그래도 지갑은 전체 숫자를 보여 주려고 노력해야 합니다.\n"},"zh":{"lang":"zh","tldr":"在 ERC-1046 代币元数据中用以 10 为基数的字符串乘数取代 decimals 字段，使钱包无需改变链上整数，就能显示小数、非 10 的幂或 rebase 式的余额。","tags":["token","metadata","display","fungible"],"related":[1046,20,1155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7538/","markdown":"## 它解决什么问题？\n\n链上代币余额是整数。[ERC-20](/eip-20/) 用 `decimals` 告诉钱包小数点放在哪里，但它只支持按 10 的幂缩放。[ERC-1155](/eip-1155/) 代币则根本没有显示小数数量的标准方式。\n\n一些项目希望有更灵活的显示方式：以 `0.5` 为步长变化的单位、随时间变化以模拟通胀或通缩的缩放系数，或者多代币资产的小数版本。ERC-7538 为它们提供了一个通用的旋钮：**乘数（multiplier）**。\n\n## 它如何运作\n\n该提案建立在 [ERC-1046](/eip-1046/) 之上，后者让 ERC-20 和 ERC-1155 代币可以通过 `tokenURI` 指向一个链下的 JSON 元数据文档。\n\n- 解析得到的元数据可以包含一个 `multiplier` 字段，它是一个**字符串**，保存精确的以 10 为基数的正数（例如 `\"0.5\"` 或 `\"0.000001\"`）。\n- 如果没有 `multiplier`，默认值为 `1`。\n- 钱包使用乘数，而不是 `decimals`，从原始整数余额推导出面向用户的数量。\n- 使用乘数的代币**不得**暴露 `decimals` 方法，且元数据中不得包含 `decimals`。\n\n由于该值存放在元数据而不是合约存储中，发行方可以通过更新文档来改变显示的缩放比例（例如体现通胀），持有者无需发起任何链上交易。\n\n使用字符串而不是数字，是为了让非常小或非常大的值保持完整精度。\n\n## 示例代码\n\n某代币的 ERC-1046 元数据，其最小单位应显示为半个代币：\n\n```json\n{\n  \"interop\": { \"erc1046\": true },\n  \"name\": \"Half Token\",\n  \"symbol\": \"HALF\",\n  \"multiplier\": \"0.5\"\n}\n```\n\n钱包侧不使用浮点数的格式化（TypeScript）：\n\n```ts\n// Exact decimal multiply: raw (bigint) × multiplier (decimal string)\nfunction formatWithMultiplier(raw: bigint, multiplier = \"1\"): string {\n  const [int, frac = \"\"] = multiplier.split(\".\");\n  const scaled = raw * BigInt(int + frac);        // shift multiplier to an integer\n  const s = scaled.toString().padStart(frac.length + 1, \"0\");\n  if (frac.length === 0) return s;\n  const head = s.slice(0, -frac.length);\n  const tail = s.slice(-frac.length).replace(/0+$/, \"\");\n  return tail ? `${head}.${tail}` : head;\n}\n\nformatWithMultiplier(3n, \"0.5\"); // \"1.5\"\n```\n\n## 需要注意\n\n- 状态为 **Draft**。\n- 它刻意与 `decimals` 不兼容。只理解 ERC-20 `decimals` 的钱包和协议会把这些代币显示为原始整数。\n- 乘数必须严格为正；不允许为 `0`。\n- 请使用精确的十进制或大整数运算。显示或转换代码中的浮点舍入误差可能被利用。\n- 非常大或非常小的乘数可能难以显示；钱包仍应尽量显示完整的数字。\n"}}}
