Skip to content

feat(cryptography): drop the TIP712 storage fallback for long name/version - #174

Open
luiz-lvj wants to merge 3 commits into
masterfrom
feat/tip712-drop-storage-fallback
Open

luiz-lvj wants to merge 3 commits into
masterfrom
feat/tip712-drop-storage-fallback

Conversation

@luiz-lvj

Copy link
Copy Markdown
Collaborator

Summary

Ports OpenZeppelin/openzeppelin-contracts#6631 from openzeppelin-contracts 5.7.0. Breaking change.

TIP712 no longer falls back to storage for long name/version values. The constructor now uses toShortString() (and the accessors toString()), so both parameters must fit in a ShortString (≤31 bytes) or the constructor reverts with ShortStrings.StringTooLong. Storing the domain exclusively in immutables keeps it consistent — and downstream TRC7739 verification correct — when the contract is used behind a proxy or clone without an initializer. The _nameFallback/_versionFallback slots are kept (deprecated) to preserve the storage layout of contracts that inherit TIP712 behind a proxy.

TRON specifics:

  • The domain separator's block.chainid & 0xffffffff masking (the only TIP-712 vs EIP-712 difference) is untouched.
  • The port carried a TRON-only WARNING paragraph describing the now-removed fallback behavior; it is replaced by upstream's IMPORTANT note about the 31-byte limit.
  • scripts/upgradeable/upgradeable.patch is regenerated so the -upgradeable transpile still applies (the upgradeable variant stores name/version as plain strings and is unaffected by this change), mirroring upstream, which updated its own transpiler patch in the same PR.

…rsion

## Summary

Ports [OpenZeppelin/openzeppelin-contracts#6631](OpenZeppelin/openzeppelin-contracts#6631) from openzeppelin-contracts 5.7.0. **Breaking change.**

`TIP712` no longer falls back to storage for long `name`/`version` values. The constructor now uses `toShortString()` (and the accessors `toString()`), so both parameters must fit in a `ShortString` (≤31 bytes) or the constructor reverts with `ShortStrings.StringTooLong`. Storing the domain exclusively in immutables keeps it consistent — and downstream `TRC7739` verification correct — when the contract is used behind a proxy or clone without an initializer. The `_nameFallback`/`_versionFallback` slots are kept (deprecated) to preserve the storage layout of contracts that inherit `TIP712` behind a proxy.

TRON specifics:
- The domain separator's `block.chainid & 0xffffffff` masking (the only TIP-712 vs EIP-712 difference) is untouched.
- The port carried a TRON-only WARNING paragraph describing the now-removed fallback behavior; it is replaced by upstream's IMPORTANT note about the 31-byte limit.
- `scripts/upgradeable/upgradeable.patch` is regenerated so the `-upgradeable` transpile still applies (the upgradeable variant stores `name`/`version` as plain strings and is unaffected by this change), mirroring upstream, which updated its own transpiler patch in the same PR.
@luiz-lvj
luiz-lvj force-pushed the feat/tip712-drop-storage-fallback branch from 15999b4 to fe245a7 Compare September 16, 2026 14:24
…k drop

The transpiler patch's TIP712.test.js hunk targeted the old short/long test
structure and no longer applied after #174 dropped the storage fallback,
failing the tests-upgradeable job at patch-apply. Regenerate it so patch-apply
is clean: drop the proxy test and rewrite the long name/version cases to assert
the upgradeable (string-storage) variant supports them, mirroring upstream's own
upgradeable patch for openzeppelin-contracts#6631.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant