tutus-chain/pkg/core/state
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
..
annos.go Add Annos lifespan contract and Eligere voting age integration 2025-12-21 00:55:29 +00:00
collocatio.go Add Collocatio native contract for democratic investment 2025-12-20 10:33:24 +00:00
contract.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
contract_invocation.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
contract_invocation_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
contract_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
deposit.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
deposit_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
eligere.go Add Eligere native contract for democratic voting 2025-12-20 06:30:43 +00:00
lex.go Add Lex native contract for universal law and rights framework 2025-12-20 05:33:26 +00:00
mpt_root.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
mpt_root_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
native_state.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
native_state_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
notification_event.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
notification_event_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
opus.go Add Opus native contract for AI workforce integration 2025-12-20 08:51:48 +00:00
oracle.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
oracle_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
palam.go Add Palam native contract for programmed transparency 2025-12-20 09:21:25 +00:00
pons.go Add Pons native contract for inter-government bridge protocol 2025-12-20 09:57:28 +00:00
role_registry.go Add free GAS for Vita holders with cross-chain fee splitting 2025-12-20 04:27:55 +00:00
salus.go Add Salus native contract for universal healthcare 2025-12-20 08:53:57 +00:00
scire.go Add Scire native contract for universal education 2025-12-20 07:25:08 +00:00
sese.go Add Sese native contract for life planning 2025-12-20 08:54:28 +00:00
storage_item.go Initial Tutus chain fork from NeoGo 2025-12-19 14:23:04 +00:00
tokens.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
tokens_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
tribute.go Add Tribute native contract for anti-hoarding economics 2025-12-20 08:53:19 +00:00
validator.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
vita.go Add free GAS for Vita holders with cross-chain fee splitting 2025-12-20 04:27:55 +00:00
vts.go Add VTS PersonToken integration and age-restricted spending 2025-12-20 03:16:33 +00:00