TokenSocials
On-chain metadata registry. One packed bytes32 per token, plus an owner and a last-updated timestamp packed into a single slot.
Singleton — one per chain. Written by the factory at registration, by the token owner thereafter, and by the hook on CTO finalization. No owner of its own.
Functions
register_token(token: address, initial_owner: address, packed: bytes32) externalFactory only. Called inside deploy_pair. The protocol token path does not register.
set_socials(token: address, packed: bytes32) externalCurrent owner only. Replaces the packed record wholesale and refreshes the timestamp.
SocialsUpdated(token, packed)
transfer_owner(token: address, new_owner: address) externalTransfer metadata ownership. Callable by the current owner, or by the hook / graduation manager during CTO finalization so socials follow the deployer role.
OwnerTransferred(token, old_owner, new_owner)
View Functions
| Function | Returns |
|---|---|
get_socials(token) -> bytes32 | The packed record |
get_owner(token) -> address | Current metadata owner |
get_record(token) -> (bytes32, address, uint256) | (packed, owner, updated_at) in one call |
is_registered(token) -> bool | Whether the token has a record |
get_factory() -> address | Authorized factory |
get_liquidity_gen_hook() -> address | Authorized hook / manager |
Storage Packing
Owner and timestamp share one slot: the address occupies the high 160 bits, the timestamp the low 96. get_record() unpacks both and returns them with the socials blob, so a full read is two SLOADs.
The contract stores 32 opaque bytes and takes no view on their meaning. Encoding — which handles, which URLs, which scheme version — is an application-layer convention. Consumers should tolerate records that do not decode.