tutus-chain/pkg
Tutus Development a18363ce0b Add Annos lifespan contract and Eligere voting age integration
Implement the Annos (Latin for "years") contract for tracking citizen
lifespan and age-based entitlements:

Annos Contract (pkg/core/native/annos.go):
- LifespanRecord tracks birth/death timestamps per Vita holder
- Age calculation from birthTimestamp (provided during registration)
- Life stages: Child (0-17), Youth (18-25), Adult (26-64), Elder (65+)
- Entitlement checks: isVotingAge, isAdult, isRetirementAge, isAlive
- recordDeath method (committee only) for mortality tracking
- Cross-contract methods for internal use by other contracts

State Types (pkg/core/state/annos.go):
- LifeStage, LifespanStatus enums
- LifespanRecord, AnnosConfig structs with serialization

Vita Integration:
- Updated register() to accept birthTimestamp parameter
- birthTimestamp is the actual birth date, NOT the mint date
- Calls Annos.RegisterBirthInternal() after minting Vita
- Enables existing adults to register with their real birth date

Eligere Integration:
- Added Annos IAnnos field to Eligere struct
- Added voting age check in vote() method
- Voters must be 18+ (configurable via AnnosConfig.VotingAge)
- New ErrUnderVotingAge error for underage voters

Contract Wiring:
- Added eligere.Annos = annos in NewDefaultContracts()
- Contract ID: -26 (next after Collocatio)

Tests (pkg/core/native/native_test/annos_test.go):
- 17 comprehensive tests covering all Annos functionality
- Age-based tests for Child, Youth, Adult life stages
- Note: Elder test skipped (uint64 can't represent pre-1970 dates)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:55:29 +00:00
..
compiler Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
config Add RoleRegistry native contract for hierarchical RBAC 2025-12-20 01:35:26 +00:00
consensus Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
core Add Annos lifespan contract and Eligere voting age integration 2025-12-21 00:55:29 +00:00
crypto Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
encoding Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
interop Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
io Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
neorpc Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
neotest Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
network Add free GAS for Vita holders with cross-chain fee splitting 2025-12-20 04:27:55 +00:00
rpcclient Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
services Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
smartcontract Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
util Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
vm Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
wallet Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00