tutus-chain/pkg/core
Tutus Development c250c16e89 Add VPP (Vita Presence Protocol) to native Vita contract
Implement real-time proof-of-humanity presence tracking as OAuth 2.0 extension:

Native Contract Methods:
- recordPresence(sessionId, deviceHash): Record heartbeat for caller's Vita
- getPresence(tokenId): Get presence record with computed status
- getPresenceStatus(tokenId): Get computed status (offline/online/away/invisible)
- setPresenceVisibility(invisible): Toggle invisible mode
- getPresenceConfig(): Get VPP configuration values

State Types (pkg/core/state/vita.go):
- PresenceStatus enum: Offline, Online, Away, Invisible
- PresenceRecord: TokenID, LastHeartbeat, SessionID, DeviceHash, Status, Invisible
- PresenceConfig: PresenceWindow (60), AwayWindow (300), MinHeartbeatInterval (15),
  MaxHeartbeatInterval (60) - all in blocks (~seconds)

Security Features:
- Session and device hash must be exactly 32 bytes
- Rate limiting: Min 15 blocks between heartbeats
- Invisible mode: Heartbeats recorded but status hidden
- Caller must have active Vita token

Internal Methods for Cross-Contract Use:
- GetPresenceRecord, GetPresenceStatusInternal, IsOnline, IsPresent

Events:
- PresenceRecorded(tokenId, blockHeight, sessionId)
- PresenceVisibilityChanged(tokenId, invisible)

Tests (7 new):
- GetPresenceConfig, GetPresence_NonExistent, GetPresenceStatus_NonExistent
- RecordPresence_NoVita, RecordPresence_InvalidSession, RecordPresence_InvalidDevice
- SetPresenceVisibility_NoVita

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:01:59 +00:00
..
block Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
chaindump Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
dao Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
fee Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
interop Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
mempool Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
mempoolevent Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
mpt Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native Add VPP (Vita Presence Protocol) to native Vita contract 2025-12-27 17:01:59 +00:00
state Add VPP (Vita Presence Protocol) to native Vita contract 2025-12-27 17:01:59 +00:00
stateroot Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
statesync Regenerate helper contracts and skip state sync tests 2025-12-27 16:07:01 +00:00
storage Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
test_data Initial Tutus chain fork from NeoGo 2025-12-19 14:23:04 +00:00
transaction Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
basic_chain_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
bench_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
blockchain.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
blockchain_core_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
blockchain_neotest_test.go Regenerate helper contracts and skip state sync tests 2025-12-27 16:07:01 +00:00
custom_native_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
doc.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
headerhashes.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
helper_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
interops.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_designate_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
prometheus.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
util.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
util_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00