Skip to content

Document MintTimeAndTransferCountHooks as a second reference hook - #356

Merged
ryley-o merged 1 commit into
mainfrom
transfer-hooks-second-reference
Sep 11, 2026
Merged

ryley-o merged 1 commit into
mainfrom
transfer-hooks-second-reference

Conversation

@ryley-o

@ryley-o ryley-o commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Follow-on to #355. That page named OwnerHistoryTransferHook as the only first-party hook; there are now two, and the new one is the more interesting of the pair.

What this adds

MintTimeAndTransferCountHooks is a combined hook — a transfer hook and a PostParams read-augment hook in one contract. It records each token's mint timestamp and post-mint transfer count, and injects three values on every read:

Key Value
mintTimestamp Unix seconds of the mint block, or "0" if the hook was not configured before the mint
secondsSinceMint Computed at read time, so it changes every block
transferCount Ownership-changing transfers after the mint, excluding the mint itself

It also resolves the re-render gotcha this page already raises, rather than only describing it. Configuring transferCount as an Address-authorized param pointing at the hook makes it write on each counted transfer, which is what triggers the off-chain re-render. That write is try/catch'd and emits TransferCountPMPSyncFailed, so a misconfigured param costs a stale image instead of a frozen collection. The gotcha now links to it for anyone who would rather configure a deployed hook than write one.

Addresses

Network Address
Mainnet, Arbitrum, Base, Shape, Sepolia (artist staging) 0x000000002099d6BB23Ebd24aDCbee931ad461a39
Sepolia (dev) 0x2B530627ed72e3F77EAC0d1c8b3904E6d8f67c25

Both are listed, with the reason they differ: the hook is constructor-bound to a PMP contract and Sepolia dev runs its own PMP instance.

Verification

Checked on chain across all five networks — code present, ERC-165 ITransferHook, and pmp() returning the PMPV1 instance claimed here. All internal links and GitHub source links resolve.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C6jcGQ48oJZddVVQFpShAz

The page named OwnerHistoryTransferHook as the only first-party hook. There
are now two, and the new one is the more interesting of the pair: it is a
combined transfer hook and PostParams read-augment hook, injecting
mintTimestamp, secondsSinceMint and transferCount.

It also resolves the re-render gotcha this page raises, rather than only
describing it. Configuring transferCount as an Address-authorized param
pointing at the hook makes the hook write it on each counted transfer, which
is what triggers the re-render — try/catch'd, emitting
TransferCountPMPSyncFailed, so a misconfigured param costs a stale image
instead of a frozen collection. The gotcha now points at it for anyone who
would rather configure a deployed hook than write one.

Both addresses are listed, with why they differ: the hook is constructor-bound
to a PMP contract and Sepolia dev runs its own instance. Verified on chain
across all five networks — code present, ERC-165 ITransferHook, and bound to
the PMPV1 instance claimed here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6jcGQ48oJZddVVQFpShAz
@ryley-o
ryley-o requested a review from a team as a code owner September 11, 2026 15:04
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ArtBlocks.github.io/artblocks-docs/pr-preview/pr-356/

Built to branch retype at 2026-09-11 15:04 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@ryley-o
ryley-o merged commit 6a852e5 into main Sep 11, 2026
5 checks passed
@ryley-o
ryley-o deleted the transfer-hooks-second-reference branch September 11, 2026 16:03
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