Skip to content

SimplexNamePolicy: holder-only renewal, accepting the terms again - #49

Merged
epoberezkin merged 8 commits into
simplex-network:simplexfrom
brenzi-agent:ab/holder-renewal-terms
Nov 20, 2026
Merged

epoberezkin merged 8 commits into
simplex-network:simplexfrom
brenzi-agent:ab/holder-renewal-terms

Conversation

@brenzi-agent

@brenzi-agent brenzi-agent commented Nov 14, 2026 •

Copy link
Copy Markdown

On simplex with #50, the upgradeable stack, and #51, the dispute period, merged; run 1 of the deployment (https://github.com/brenzi/simplex-namespace-contract/pull/20) deploys them, and this merges after it. This change ships as the deployment's first upgrade, of the policy, controller and sponsor proxies (#20, decision D19), prepared with the batch extension of prepare-upgrade.mjs in https://github.com/brenzi/simplex-namespace-contract/pull/18.

The upgrade path for the live .simplex: https://github.com/brenzi/simplex-namespace-contract/pull/18

Only the holder of a name renews it, and every renewal accepts the current terms again.

Who renews.

  • SimplexController.renew renews for its caller, and only when the caller holds the name.
  • SimplexSponsor.renewWithCredit takes the holder as a new last argument, holder, and passes it to renewSponsored.
  • On both paths SimplexNamePolicy.consumeRenewal reverts NotHolder(name) unless that address holds the name. Before expiry the holder is the registrar's ownerOf; in the 90-day grace period, when ownerOf reverts, it is found in the registrar's ERC721Enumerable index of the address's names.

Terms at renewal. Each renewal consumes the holder's acceptance of the current terms of the name's kind, made for the name's current expiry and that duration.

  • acceptGeneralTermsForRenewal(tokenId, expires, duration, termsHash) and acceptCommunityTermsForRenewal(tokenId, expires, duration, termsHash), each with a WithSig variant. The EIP-712 types are AcceptGeneralTermsForRenewal(uint256 tokenId,uint256 expires,uint256 duration,bytes32 termsHash,uint256 nonce,uint256 deadline) and AcceptCommunityTermsForRenewal(…), on the policy's per-signer nonce.
  • An acceptance must name the name's current expiry, or it reverts ExpiryMismatch(named, current); a signed one carries the expiry inside the signature, so one relayed after a renewal reverts before the signer's nonce is spent. It is stored for the name, the acceptor, that expiry and the duration, and a renewal consumes the one for the name's current expiry. One of the other kind, of a replaced link, by another address, for another duration or from an earlier term reverts TermsNotAccepted(name) at renewal. On mainnet the general and community links are the same placeholder today, so the kind matters once distinct links are set, as for registration and claims.
  • The renewal emits GeneralTermsAccepted or CommunityTermsAccepted with the holder, as registration and claim do. A reserved name still reverts NameReserved first.

Storage. SimplexNamePolicy, behind its own proxy in #50, appends acceptedRenewalTerms at slot 8, and __gap shrinks from 42 to 41; a test reads the slot on the proxy, and the layout snapshot lists it. SimplexController adds no storage. docs/upgrades.md has the new layout.

Deployment. The policy, the controller and the sponsor are upgraded in place through their ProxyAdmins, in one Safe MultiSend batch simulated as a whole on a mainnet fork: renewSponsored and renewWithCredit gain holder, so in separate transactions every sponsored renewal reverts between the two. INTENDED names the replaced selectors. The store service calls only registerWithCredit on the sponsor (simplex-chat names @ 0410929, Worker.hs:311), so it needs no change for this upgrade. Sizes in bytes, limit 24,576, on #51: SimplexController 18,934 (was 18,666), SimplexNamePolicy 18,177 (was 15,792), SimplexSponsor 5,856 (was 5,795).

Tests.

  • Every test that renews now accepts first, through the fixture helpers acceptGeneralTermsForRenewal and signGeneralTermsForRenewal or local ones, and passes the holder to renewWithCredit.
  • The launch lifecycle test "anyone may renew anyone name" becomes "only the holder renews, after accepting the terms again".
  • New: a renewal by anyone else, with or without an acceptance; the holder without one, on both paths; one acceptance per renewal; duration binding; an acceptance from an earlier term; one naming a later expiry, and a signed one relayed after a renewal, reverting ExpiryMismatch; new terms between acceptance and renewal; the relayed signature and renewWithCredit naming a non-holder; a transfer between acceptance and renewal; the grace period on both paths, with the holder lookup passing over another name; for each kind, the other kind's acceptance for the same name, a zero or wrong hash, a signature from the wrong signer, replayed or expired, and an unset link; the pinned type hashes; slot 8.

CI. Until Actions is enabled in this repository and #52 merges, the runs are on the fork's ci/ branches, which add a workflow file and #52:

@brenzi-agent
brenzi-agent force-pushed the ab/holder-renewal-terms branch from de8a8a2 to 1e49007 Compare November 20, 2026 12:20
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.

2 participants