TokenSocials
On-chain registry for token metadata. Stores packed social links in a single bytes32 slot per token. Ownership transferable via deployer or Hook (CTO).
Write Functions
register_token(token, initial_owner, packed) externalRegister a new token's socials. Factory only. Idempotent — if already registered, does nothing.
set_socials(token, packed: bytes32) externalUpdate social links for a token. Owner only. The packed bytes32 encodes social links (Twitter, Telegram, website, etc.).
transfer_owner(token, new_owner) externalTransfer socials ownership. Callable by current owner or the Hook (during CTO finalization).
View Functions
| Function | Returns | Description |
|---|---|---|
get_socials(token) | bytes32 | Packed social links |
get_owner(token) | address | Current socials owner |
get_record(token) | (bytes32, address, uint256) | (packed, owner, registered_at) |
is_registered(token) | bool | Whether token is registered |
Storage Layout
Each record packs owner (160 bits) and registered_at timestamp (96 bits) into a single uint256 slot alongside the bytes32 packed socials. This means each token's full metadata occupies exactly 2 storage slots.