Skip to content

Consolidate SeaDrop v3 development and sync v1 extensions - #236

Merged
ryanio merged 65 commits into
v3from
ryan/v3-public-migration
Nov 17, 2026
Merged

ryanio merged 65 commits into
v3from
ryan/v3-public-migration

Conversation

@ryanio

@ryanio ryanio commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move SeaDrop v3 development into this repository's v3 branch. This consolidates the private minter, clone factory, adapters and agent extension, and retains the v1 adapter and agent implementations alongside them. The v3 tracker records integration, audit and rollout work. This merge records development work; it does not deploy or approve v3 for production.

Source PRs

Work Source
Minter and thin ERC-721 / ERC-1155 tokens ProjectOpenSea/seadrop-priv#28
Clone factory, ERC-7201 storage and event schema ProjectOpenSea/seadrop-priv#29
Existing-contract adapters ProjectOpenSea/seadrop-priv#30
Agent NFTs and ERC-8048 metadata ProjectOpenSea/seadrop-priv#31

The source PRs will close after this merges. Their historical discussions remain available in the private repository.

v1 compatibility

The migration includes #234 and the agent implementation from #212. The v3 mint adapter retains v1's exact quantity checks, supply-counter probe and balance fallback. Configuration uses v3's minter API instead of v1's Studio multiConfigure surface. The v3 transfer adapter also prevents ownership renunciation while holding target tokens. Agent metadata policy behavior matches v1; v3 uses ERC-7201 storage and its own token base. Both versions include the pending-owner cancellation and registration-range fixes.

The README explains the version roles: v1 for ERC-721 drops, v2 for ERC-1155 self-mint editions, and v3 for upgrading v1 with ERC-20 payments and delegated minting, followed by ERC-1155 edition drops. Public contributor guidance and audit links replace private-only instructions.

Validation

  • Final CI on c1fa240: 605 tests pass, none fail, and two fork tests are skipped.
  • Includes the added distinct-payer/wallet/recipient event-schema test. The original direct-mint event test and all its assertions remain unchanged.
  • Pinned lint checks and contract size checks pass.
  • Added v3 gas snapshots without replacing existing v1 entries.
  • Existing v1 tests are retained unchanged. The imported factory changes preserve token tests while adding clone initialization and event-schema coverage.

Deployment prerequisites

Security review and an external audit remain open in #235. The imported code is unaudited. Existing adapter limits remain documented: on a target without totalSupply(), forwarding or burning in the recipient callback can revert the mint and refund payment. The migration preserves this exact-delivery check rather than weakening it.

ryanio and others added 30 commits November 6, 2026 19:15
…metadata

ERC721SeaDrop plus:
- registerAgents: the owner registers an ERC-8004 agent for each unminted
  token through an ERC-8217 adapter, skipping tokens already registered.
  agentOf returns the agent id.
- ERC8048OnchainMetadata (src/lib): ERC-8048 records with the Metadata
  Authority extension. Owner and allowed writers write while a token has
  no authority; the holder can set an authority to take over; transfers
  and burns clear it; the owner can lock a key for good. Every write
  emits MetadataSet and ERC-4906 MetadataUpdate.

Tests use a mock adapter with the real adapter's registration rule, plus
a fork test against the Base adapter that runs when
AGENT_ADAPTER_FORK_URL is set. docs/AgentNFTs.md covers deployment,
adapter addresses and how OpenSea shows agent NFTs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fer behavior

Writes before mint still emit MetadataSet but no longer emit
MetadataUpdate for a token that doesn't exist, so pre-mint setup of a
large collection doesn't send a refresh per record. A new
_metadataTokenExists hook decides. Notes that a batch reverts if any
token in it has an authority, and that records stay with a token when
a transfer clears its authority.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks the adapter by chain id, so the test covers Ethereum, Base,
Robinhood Chain and Sepolia. All four pass against public RPCs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leave ERC-4906's MetadataUpdate to the token so the ERC-8048 library can
sit next to OpenZeppelin's IERC4906, clear the authority of every token a
transfer moves, and document the gas cap, what survives a sale, writer
persistence, key locks and the adapter's upgradeability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SeaDropMinter holds stages, payouts and mint logic for v3 tokens and,
through INonFungibleSeaDropToken, existing v1 tokens. ERC721SeaDropV3
and ERC1155SeaDropV3 keep only ownership, minters, supply and metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Point forge at test/ so test/v3 runs alongside v1's test/foundry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A nonzero Authorization.sender must be msg.sender, and lets it pay for
the wallet without being trusted, allowed or a delegate. The mint counts
against the wallet, and recipient rules are unchanged. A sender on a
public stage reverts, since nothing signed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each mint rechecks that the stage currency is allowed and its fee meets
the current minimum, so admin changes reach stages already set. A signed
authorization now names its currency, which must match the stage's, so a
price override can't carry over after a currency switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scope, timeline, trust assumptions, where to look hardest, intended
behavior, build and test notes, and questions for the auditors, from
the prototype at bfaa1a5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pay from a copy of the payout list, so a recipient that owns the
  token can't shrink the list from its ETH hook and revert the mint.
- Push ERC-20 payouts through a gas-capped call back into the minter
  that uses SafeERC20. A transfer the token rejects, that runs out of
  gas, or that answers with anything but nothing or true reverts there
  and is rolled back, and the recipient is credited. Before, malformed
  return data made the decoder revert the mint, and a gas-burning
  transfer could leave too little gas to credit.
- ERC-4906 extends ERC-721, so the ERC-1155 token stops claiming it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- setStage rejects a nonzero id for ERC-721 tokens, v1 included. They
  ignore ids, so stages at other ids would give each wallet another
  limit in the same collection.
- setPayoutRecipients, setStage and setCurrency reject the minter as a
  payout or fee recipient. ETH it paid itself would be credited to an
  account nothing can withdraw from, and an ERC-20 not credited at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fee went out before the payout list was copied, so a fee recipient
that owns the token could swap the list from its callback. Copy it
before any payment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The private repository's rules (main and v2 mirror the public repo, v3
stays private, neutral wording for undisclosed fixes), what the v3
branch holds, the commands with the pinned Foundry version, and the
v3 invariants that changes must keep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mint fuzz helpers skipped precompiles with `> address(9)`. Since the
repo compiles for Cancun (#208), `0x0A` is the point-evaluation
precompile too, and it rejects a plain ETH transfer. When the fuzzer
drew `feeRecipient = 0x0A`, the mint's fee payout reverted with
`ETH_TRANSFER_FAILED`.

This changes only test helpers, no contract code:

- `TestHelper.validateArgs`, `validateFuzzInputsSigners` in
`SeaDrop-mintSigned.t.sol` and `validateAllowedTokenHoldersArgs` in
`SeaDrop-mintAllowedTokenHolder.t.sol` now call forge-std's
`assumeNotPrecompile` (it skips `0x01` through `0xff`) on `feeRecipient`
and `minter`.
- `validateFuzzInputsSigners` used the old bound to keep `feeRecipient`
nonzero, so that check is now explicit.

## Testing

The flake showed up in CI as `SeaDropMintSignedTest.testMintSigned*`
failing with `feeRecipient: 0x...0A`, under seed `0xf3cd7cc7...` on a
branch with more tests. Neither that seed nor `0x6b04d3d7...` draws
`0x0A` on main, because the fuzz dictionary depends on the compiled test
contracts. To reproduce on main, I called the affected tests directly
with fixed inputs in a scratch contract (not committed), using Foundry
1.9.0:

| Input | Before | After |
| --- | --- | --- |
| `testMintPublic` (upgradeable), `feeRecipient = 0x0A` |
`ETH_TRANSFER_FAILED` | input rejected by `vm.assume` |
| `testMintSigned`, `feeRecipient = 0x0A` | `ETH_TRANSFER_FAILED` |
input rejected |
| `testMintAllowedTokenHolder`, `feeRecipient = 0x0A` |
`ETH_TRANSFER_FAILED` | input rejected |
| `minter = 0x0A` in each | passes | input rejected |
| `testMintSigned`, `feeRecipient = address(0)` | input rejected | input
rejected |

Also run with Foundry 1.9.0:

- `forge test` passes (298 tests) with `--fuzz-seed` set to both seeds
above, and `test/foundry/upgradeable/SharedTests.t.sol` passes with
`0x6b04d3d7...`.
- 40 random seeds over the mint suites and `SharedTests.t.sol` pass, so
the extra exclusions don't push any test over the `vm.assume` rejection
limit.
- `npm run lint` passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
OpenSea's conduit differs by chain, so v3 tokens take it at deployment
instead of hardcoding the canonical one as v1 and v2 do. It's
immutable, address(0) preapproves nothing, and a holder revokes or
restores it with setApprovalForAll(conduit, approved). For clones, the
factory will pass its chain's conduit, so a creator can't choose the
operator.

The ERC-1155 token moves from solmate to OpenZeppelin 4.9, whose
isApprovedForAll is virtual. solmate's is a public mapping its
transfers read directly. The mint costs about 500 more gas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner mints emit OWNER_MINT_STAGE, but setStage accepted that index for
a paid stage, so indexers couldn't tell the two apart. Reject it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy happened in _payOut, after the token mint, whose receiver
callback could change the list. Take it in _mint before the payment,
the first call that can change state, and pass it to _payOut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Biome and lefthook came from npm. scripts/install-tools.sh now downloads
them, plus taplo, shellcheck, shfmt and actionlint, from their GitHub
releases and checks each against a pinned SHA-256, matching seaport.
scripts/lint.sh runs what CI runs. Biome is pinned at 2.6.3 (2.6.6 is
under two weeks old).

Removes package.json, package-lock.json and .nvmrc, and the Node steps
from CI. check_sizes.sh is reindented for shfmt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
set -e ignores a failure on the left of &&, so a failed tar during an
update left the old binary in place, marked with the new checksum.
Run the extraction and the move as separate commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The badge read the version from package.json, which is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop trusted and allowed payers. A caller other than the wallet still
needs to be its delegate to name another recipient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maxPerStage caps a stage's total across wallets, 0 meaning none.
signerSetId shrinks to uint32 so Stage stays three slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanio and others added 13 commits November 13, 2026 10:22
Only the owner can withdraw or rescue tokens the transfer adapter holds,
so renouncing ownership while it holds any would leave them stuck once
the stages end. renounceOwnership now reverts until the adapter's
balance on the target is zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An operator the target approves for every holder, such as a preapproved
conduit, is approved for the adapter's tokens too, so the docs no longer
say a conduit can't move them. A fixture with a preapproved conduit tests
that, and that a queued token moved out stalls the queue. The mint
adapter's docs now say a forwarding recipient on a target without
totalSupply() reverts with the payment refunded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key lock also froze the key for tokens not minted yet, so a token
minted after the lock could never get a value. Drops lockMetadataKey
from the module and leaves freezing to a controller set as the
collection authority. MetadataWriterPolicy gets setWriteOnceKey: a
write to a write-once key reverts once that token has a non-empty
value, through setMetadata and setMetadataBatch alike. A collection
that wants every record frozen locks the authority to 0x...dEaD.

From Prem's follow-up review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename collectionAuthority() to tokenMetadataAuthority() and emit
TokenMetadataAuthoritySet, answer 0x04f90b41 in supportsInterface, make a
set authority the only writer, add ownerCannotWrite, and allow locking a
blank authority so the settings hold for good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ERC721SeaDropV3Agents ports the agent NFT extension to v3: ERC-8217
agent registration and ERC-8048 onchain metadata with the collection-wide
Metadata Authority extension, all in ERC-7201 storage. Creators deploy it
directly; the factory stays for the default tokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanio and others added 2 commits November 17, 2026 10:58
Adds `ERC721SeaDropAgents`, an extension for collections whose tokens
are AI agents, modeled on what MUSEGOD's [Muses
contract](https://robin.etherscan.io/address/0x13ea3072b7215d4c9c2ec4f498a08c5825129836#code)
added to `ERC721SeaDrop` on Robinhood Chain. The ERC-8048 code is a
separate module in `src/lib`, so other token contracts can reuse it.

## Agent registration

`registerAgents(firstTokenId, lastTokenId, prefix, suffix)` registers an
[ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) agent for each token
through an [ERC-8217](https://eips.ethereum.org/EIPS/eip-8217) adapter,
with agent URI `prefix` + id + `suffix`. Whoever holds the token
controls the agent. The adapter is a constructor argument, since it is
only deployed on some networks.

- Owner only, and only for tokens not minted yet (up to the max supply).
The adapter lets a token contract register only tokens without an owner.
MUSEGOD's version allowed it only before the first mint; this allows
registering in ranges as a drop goes.
- The adapter doesn't stop a token from being registered twice, so the
contract records each agent id and skips tokens already registered.
`agentOf(tokenId)` returns it.

## ERC-8048 onchain metadata

`ERC8048OnchainMetadata` stores string keys with bytes values per token
and implements ERC-8048's optional Metadata Authority extension in its
collection-wide form
([ethereum/ERCs#2174](ethereum/ERCs#2174)). The
authority and three settings pack into one storage slot.

- `tokenMetadataAuthority()` returns the one address that can write
every token, including before mint, or zero when none is set. While it
is set it is the only writer, as the ERC requires: the owner and holders
write only through it. `supportsInterface(0x04f90b41)` returns true, and
every change of the address emits `TokenMetadataAuthoritySet(address
indexed authority)`.
- While the authority is blank, the settings decide. The owner
(`owner()`, so it follows ownership) writes any token unless
`ownerCannotWrite` is on. `holderCanWrite` lets a token's current holder
(`ownerOf` at write time) write that token. Transfers need no claim: the
buyer writes right away and the seller can't. ERC-721 operators can't
write for the holder.
- `authorityLocked` stops the owner from calling
`setCollectionAuthority`, including while the owner writes as the blank
authority. A set authority can still call it, so a locked policy can
hand itself on. A blank authority can be locked, which fixes the
settings for good and blocks adding a policy later.
- `setCollectionAuthority(authority, holderCanWrite, ownerCannotWrite,
authorityLocked)` sets everything and emits
`CollectionAuthoritySettingsUpdated(holderCanWrite, ownerCannotWrite,
authorityLocked)`, so indexers see flag changes too.
`collectionAuthoritySettings()` returns the flags. They default to
false, so a new collection starts owner-only.
- There are no key locks. Prem's follow-up pointed out that a key lock
also freezes the key for tokens not minted yet: an artist who signs the
first tokens and locks `artist.signature` leaves every later token
unsigned. Freezing is left to a policy set as the authority, which can
freeze per token. A collection that wants every record frozen locks a
blank authority with `ownerCannotWrite` on and `holderCanWrite` off
(`testFreezeEverything`).
- Every write emits `MetadataSet`. A write to a minted token also emits
ERC-4906 `MetadataUpdate`, since OpenSea refreshes on ERC-4906 events.
The library calls a `_emitMetadataUpdate` hook and the token declares
the event, so the library also works next to OpenZeppelin's `IERC4906`.
Writes before mint skip it. A batch emits one `MetadataUpdate` per run
of entries for the same token, and reverts if the caller can't write any
entry.

The settings cover these states, each with a test:

| State | Authority, settings | Test |
| --- | --- | --- |
| Owner only. The owner writes and can change the settings | blank, all
off | `testOwnerOnlyByDefault` |
| Owner and holders. The owner can change the settings | blank,
`holderCanWrite` | `testHoldersWrite` |
| Locked blank, owner and holders for good | blank, `holderCanWrite`,
`authorityLocked` | `testLockedBlankOwnerAndHolders` |
| Locked blank, holders only for good | blank, `holderCanWrite`,
`ownerCannotWrite`, `authorityLocked` | `testLockedBlankHoldersOnly` |
| Locked blank, nobody writes | blank, `ownerCannotWrite`,
`authorityLocked` | `testFreezeEverything` |
| A policy. Only the policy writes, the owner can replace it | policy |
`testPolicyAuthority`, `testAuthorityIsOnlyWriter` |
| A locked policy. Only the policy writes and hands it on | policy,
`authorityLocked` | `testLockedPolicy` |

This replaces the earlier per-token Metadata Authority design.
`lockMetadataKey`, `metadataKeyLocked`, `MetadataKeyLocked`,
`MetadataKeyIsLocked`, `setMetadataAuthority`, the per-token authority
mapping, metadata writers (`setMetadataWriter`), the clear-on-transfer
hook, and ERC-165 support for the per-token Metadata Authority draft
(`0xf9cb127d`) are gone. The token reports ERC-8048 (`0xdf670be1`), its
collection-wide Metadata Authority extension (`0x04f90b41`), and
ERC-4906 (`0x49064906`). Transfers no longer touch metadata storage.

### Reference policy

`src/lib/MetadataWriterPolicy.sol` is a small example to set as the
collection authority, so nothing the per-token design offered is lost.
The token doesn't depend on it.

- Its admin (`TwoStepOwnable` owner) allows several writer addresses
with `setWriter`, replacing `setMetadataWriter`.
- A token's current holder delegates their token's writes to one address
with `setDelegate`, such as their agent's wallet. The delegation records
the holder who set it and counts only while that address is still
`ownerOf`, so it lapses on transfer (and counts again if the token
returns to that holder).
- Write-once keys, from Prem's follow-up. The admin marks a key with
`setWriteOnceKey(key, bool)`, and a write to that key reverts with
`WriteOnceValueSet(tokenId, key)` when the token already has a non-empty
value, read through the token's `metadata(tokenId, key)`.
`setMetadataBatch` applies the same rule and also counts earlier entries
in the batch, so a batch can't set a value and overwrite it. Tokens
minted later can still be written once (`testPolicyWriteOnceKey`,
`testPolicyWriteOnceKeyBatch`). The admin can unmark a key, so a lasting
freeze locks the authority to the policy and renounces the policy. While
the policy is the authority, holders can't write past it whatever
`holderCanWrite` says.
- `setMetadata` and `setMetadataBatch` check the caller and forward to
the token. The batch checks array lengths first (`BatchLengthMismatch`),
since it now reads each entry. `setCollectionAuthority` is an admin
passthrough, so a policy can hand the authority on. `renounceOwnership`
also cancels a pending ownership transfer, as the token does, so a
renounced policy stays renounced.

The module reserves no keys. ERC-8048 is a draft and its agent profile
(ERC-721T) may still change, so the keys are only listed in the doc.
Token id 0 is not special.

## Docs


[docs/AgentNFTs.md](https://github.com/ProjectOpenSea/seadrop/blob/ryan/agent-nft-extension/docs/AgentNFTs.md)
covers deployment, the adapter addresses on Ethereum, Base, Robinhood
Chain and Sepolia (each confirmed to have code), registration, the
metadata authority and its common setups, the reference policy, and how
OpenSea shows agent NFTs. The README and the bring-your-own-token doc
link to it.

## Size and gas

- `ERC721SeaDropAgents` runtime code is 23,472 bytes, 1,104 bytes under
EIP-170.
- Registration costs about 200,000 gas per token, or about 240,000 once
the agent URI is longer than 31 bytes. Ethereum and Base cap a
transaction at 16,777,216 gas (EIP-7825), so the docs say to register
about 60 tokens per transaction.

## Tests

- `test/foundry/ERC721SeaDropAgents.t.sol`: 32 tests (31 run, 1 fork
test skipped in CI) covering the states above, settings permissions,
when `TokenMetadataAuthoritySet` fires, a set authority as the only
writer, `ownerCannotWrite` while unlocked, a locked authority clearing
itself to a locked blank state, writes before mint, holder writes across
transfer, safe transfer and burn, batches, the reference policy's
writers, holder delegation and write-once keys (single and batch)
through the token, registration ranges and skips (including a collection
whose ids start past 1), interface ids, and the library next to
OpenZeppelin's `ERC721URIStorage`. `forge coverage --ir-minimum` reports
100% line and branch coverage of `ERC8048OnchainMetadata` and
`ERC721SeaDropAgents`, and 100% branch coverage of
`MetadataWriterPolicy` (its two-line `renounceOwnership` shows as unhit
lines under `--ir-minimum`, though
`testPolicyRenounceCancelsPendingOwner` calls it).
- `src/test/MockAgentAdapter.sol` applies the real adapter's
registration rule.
- `testRegisterAgentsWithDeployedAdapter` forks the chain
`AGENT_ADAPTER_FORK_URL` names and registers through that chain's
deployed adapter. It is skipped in CI. It passes locally on Ethereum,
Base, Robinhood Chain and Sepolia against public RPCs.

## Audit

An independent review of the earlier version found no critical, high or
medium issues. Its changes that still apply: the library doesn't declare
`MetadataUpdate` (so it compiles next to OpenZeppelin's `IERC4906`), and
the docs cover the 16,777,216-gas transaction cap, that nobody can
change an agent URI before mint, that agent URIs are public once
registered, that the agent's URI and wallet carry over a sale, and that
the adapters are upgradeable proxies a 3-of-4 Safe controls on Ethereum
and Base. Its findings about clearing per-token authorities on transfer,
batches failing on tokens with an authority, and writers surviving an
ownership transfer no longer apply: there is no per-token authority, the
collection authority can write every batch entry, key locks are gone,
and writers now live in a policy contract with its own admin.

## Not in this PR

- Upgradeable and clone versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The paid-mint event schema test uses alice for both wallet and recipient, so it would miss a regression that swaps those fields.

1 open issue
What changed in this PR

Consolidates SeaDrop v3 development alongside v1, preserving compatibility and bringing adapters and agent NFT extensions into the repository. This is development code, not a production release; Security review and an external audit remain prerequisites for deployment.

Changes:

  • Adds thin v3 tokens, deterministic clone deployment, existing-contract adapters and agent metadata support.
  • Adds compatibility, initialization, storage-layout and event-schema tests, plus v3 gas snapshots.
  • Documents version roles, deployment workflows and contributor guidance, and includes both test suites in Foundry.
File Description
test/​v3/​utils/​SeaDropV3TestHelper.sol Shared deployments, mint parameters and signing helpers.
test/​v3/​utils/​Mocks.sol Wallet, delegation, payment and callback mocks.
test/​v3/​utils/​AdapterMocks.sol Existing-token and adapter callback mocks.
test/​v3/​SeaDropV3Snapshot.t.sol Deployment and mint gas benchmarks.
test/​v3/​SeaDropV3EventSchema.t.sol Checks event signatures, topics and encoded data.
test/​v3/​SeaDropTokensV3.t.sol Tests token permissions, metadata and conduit approvals.
test/​v3/​SeaDropTokenFactory.t.sol Tests clones, registration and storage layouts.
test/​v3/​SeaDropMinterV1Compat.t.sol Tests existing v1 tokens through the v3 minter.
src/​v3/​test/​MockAgentAdapter.sol Agent registration mock for v3 tests.
src/​v3/​SeaDropTokenV3Base.sol Shared ownership, initialization and minter permissions.
src/​v3/​SeaDropTokenFactory.sol Deterministic clone deployment and registration.
src/​v3/​lib/​MetadataWriterPolicy.sol Writer delegation and write-once metadata policy.
src/​v3/​lib/​ERC8048OnchainMetadata.sol Namespaced metadata storage and authority controls.
src/​v3/​interfaces/​ISeaDropTokenV3.sol Common token minting and supply interface.
src/​v3/​interfaces/​ISeaDropMinter.sol Defines minter operations, structs, events and errors.
src/​v3/​interfaces/​IERC8048TokenMetadataAuthority.sol Collection-wide metadata authority interface.
src/​v3/​interfaces/​IERC8048Metadata.sol Metadata lookup and event interface.
src/​v3/​interfaces/​IDelegateRegistry.sol Delegate registry lookup interface.
src/​v3/​interfaces/​IAgentAdapter.sol Agent registration interface.
src/​v3/​extensions/​ERC721SeaDropV3Agents.sol Standalone v3 agent NFT extension.
src/​v3/​ERC721SeaDropV3.sol Thin, cloneable ERC-721 token.
src/​v3/​ERC1155SeaDropV3.sol Thin, cloneable ERC-1155 token with per-id supply limits.
src/​v3/​adapters/​ERC721SeaDropV3TransferAdapter.sol Delivers queued tokens from existing collections.
src/​v3/​adapters/​ERC721SeaDropV3MintAdapter.sol Calls existing mint functions and checks quantities.
src/​v3/​adapters/​ERC721SeaDropV3Adapter.sol Shared adapter permissions and drop accounting.
src/​test/​MockAgentAdapter.sol Agent registration mock for v1 tests.
src/​lib/​MetadataWriterPolicy.sol Reference metadata policy for v1.
src/​lib/​ERC8048OnchainMetadata.sol Reusable v1 metadata and authority module.
src/​interfaces/​IERC8048TokenMetadataAuthority.sol Metadata authority interface for v1.
src/​interfaces/​IERC8048Metadata.sol Metadata interface for v1.
src/​interfaces/​IAgentAdapter.sol Agent registration interface for v1.
src/​extensions/​ERC721SeaDropAgents.sol Adds agent registration and metadata to v1 tokens.
README.md Explains version roles and links agent documentation.
foundry.toml Includes both v1 and v3 test directories.
docs/​v3/​ExistingContractAdapters.md Explains adapter selection, configuration and limitations.
docs/​v3/​AgentNFTs.md Documents v3 agent deployment and metadata controls.
docs/​BringYourOwnTokenContract.md Adds the agent extension to customization guidance.
docs/​AgentNFTs.md Documents v1 agents, metadata policies and integration.
AGENTS.md Adds v3 architecture and contributor guidance.
.gas-snapshot Adds v3 measurements while retaining v1 entries.

Review effort: Balanced

Comment thread test/v3/SeaDropV3EventSchema.t.sol Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The linked audit scope omits the agent extension, metadata module, writer policy, and two new storage namespaces, leaving the new functionality undocumented for audit handoff.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Update audit scope for agent contracts and new namespaces

src/​v3/​extensions/​ERC721SeaDropV3Agents.sol:41

Please update docs/v3/AuditScope.md alongside this extension. Its contract inventory omits the agent extension, metadata module and writer policy, and its storage table lists only the three default-token namespaces, not the two introduced here. The linked audit handoff therefore does not describe this new functionality. Add the agent contracts and both namespace layouts, or explicitly document a separate audit scope for them.

1 resolved since last review

Review effort: Balanced

@ryanio
ryanio requested a balanced review from Copilot November 17, 2026 19:11
@ryanio

ryanio commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the audit-handoff observation in the latest review. The draft scope now explicitly includes the agent token, metadata module, writer policy, interfaces, both ERC-7201 namespaces and their test coverage, plus external-adapter and irreversible-authority review areas. The omission came from the imported private audit draft; this migration now closes it. External audit and Security approval remain deployment prerequisites tracked in #235.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Immutable contracts spanning clone initialization, adapter custody, and metadata authority require specialist security review, while missing dependencies prevent independent runtime and bytecode-limit validation.

No open issues 🎉

Review effort: Balanced

@ryanio
ryanio merged commit 87b2b8f into v3 Nov 17, 2026
6 checks passed
@ryanio
ryanio deleted the ryan/v3-public-migration branch November 17, 2026 19:16
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