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) external

Register a new token's socials. Factory only. Idempotent — if already registered, does nothing.

set_socials(token, packed: bytes32) external

Update social links for a token. Owner only. The packed bytes32 encodes social links (Twitter, Telegram, website, etc.).

transfer_owner(token, new_owner) external

Transfer socials ownership. Callable by current owner or the Hook (during CTO finalization).

View Functions

FunctionReturnsDescription
get_socials(token)bytes32Packed social links
get_owner(token)addressCurrent socials owner
get_record(token)(bytes32, address, uint256)(packed, owner, registered_at)
is_registered(token)boolWhether 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.