Commit Graph

56 Commits

Author SHA1 Message Date
Tutus Development b5c1dca2c6 Add VTS PersonToken integration and age-restricted spending
- Require Vita (soul-bound identity token) for minting restricted VTS
- Add age-restricted vendor flag for age-gated purchases (e.g., alcohol)
- Add IsAdultVerified method to PersonToken for age verification
- Update spend/canSpendAt to check age verification for restricted vendors
- Add toBool helper function for boolean stackitem parsing
- Add comprehensive tests for age-restricted functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:16:33 +00:00
Tutus Development 86f5e127c0 Add VTS (Value Transfer System) native contract
VTS is programmable money with spending restrictions and automatic tax
accounting, designed to replace GAS as the primary user-facing currency.

Key features:
- NEP-17 compliant token (symbol: VTS, decimals: 8)
- Spending category restrictions (Food, Shelter, Medical, Education, Transport)
- Vendor registration and management
- Restricted VTS can only be spent at matching vendor categories
- Automatic tax withholding via payWage()
- Transaction recording for tax reporting
- Tax summary queries (getTransactions, getIncomeForPeriod, getTaxWithheld,
  getDeductibleExpenses, getTaxSummary)

Files added:
- pkg/core/native/vts.go: Main VTS contract implementation
- pkg/core/state/vts.go: VTS state structures (VTSBalance, Vendor, TaxConfig, etc.)
- pkg/core/native/native_test/vts_test.go: Comprehensive test suite

Files modified:
- pkg/core/native/contract.go: Added IVTS interface and VTS() accessor
- pkg/core/native/nativenames/names.go: Added VTS constant
- pkg/core/native/nativeids/ids.go: Added VTS ID (-14)
- pkg/core/native/nativehashes/hashes.go: Added VTS hash
- pkg/core/native/native_test/management_test.go: Updated test fixture

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:57:08 +00:00
Tutus Development de34f66286 Add RoleRegistry native contract for hierarchical RBAC
Implements RoleRegistry as a native contract for role-based access control
that integrates with PersonToken for democratic governance.

Key features:
- Built-in roles: COMMITTEE, REGISTRAR, ATTESTOR, OPERATOR
- Hierarchical roles with parent inheritance
- Permission system (resource/action/scope tuples)
- CheckCommittee() method for admin authorization
- TutusCommittee config for initial committee members

PersonToken integration:
- Added RoleRegistry field for cross-contract calls
- checkCommittee helper delegates to RoleRegistry with NEO fallback

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:35:26 +00:00
Tutus Development 99ba041a85 Add PersonToken native contract for soul-bound identity tokens
Implements PersonToken as a native contract following NeoGo patterns:

Core Token Lifecycle (Phase 1):
- register: Create new PersonToken with owner, personHash, isEntity, recoveryHash
- getToken/getTokenByID: Retrieve token by owner address or sequential ID
- exists/totalSupply: Check token existence and get total count
- suspend/reinstate: Committee-controlled token status management

Attribute Management (Phase 2):
- setAttribute/getAttribute: Manage identity attributes with attestation
- revokeAttribute/verifyAttribute: Attribute lifecycle management

Passwordless Authentication (Phase 3):
- createChallenge/fulfillChallenge/verifyAuth: Challenge-response auth flow

Key Recovery (Phase 4):
- initiateRecovery/approveRecovery/executeRecovery/cancelRecovery
- Multi-approval recovery with configurable delay

Cross-Contract Integration (Phase 5):
- validateCaller: Verify calling contract has valid PersonToken
- requireRole: Check caller has specific role assignment
- requireCoreRole: Check caller has core role (User/Verified/Committee/Attestor/Recovery)
- requirePermission: Check caller has resource/action/scope permission

Files added:
- pkg/core/native/person_token.go: Main contract implementation
- pkg/core/state/person_token.go: State structs with serialization
- pkg/core/native/native_test/person_token_test.go: Test coverage

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:04:38 +00:00
Tutus Development 5598ed7d85 Update all imports from neo-go to tutus-chain
- Updated 3839 import statements in .go files
- Updated all go.mod and go.sum files
- Updated yml and md documentation files
- Module path: github.com/tutus-one/tutus-chain
2025-12-19 14:28:17 +00:00
Tutus Development 62bd7bb153 Initial Tutus chain fork from NeoGo
- Renamed module to github.com/tutus-one/tutus-chain
- Created Tutus network configurations
- Updated Makefile for tutus binary
- Updated service templates
- Added Tutus README
2025-12-19 14:23:04 +00:00