Skip to content

open-web-academy/Eternacode-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Eternacode AI Smart Contract πŸ€–β³

A Solidity smart contract for managing AI model versioning with granular access control, designed for EVM-compatible blockchains (Scroll, Ethereum, Polygon, BSC, etc).

Solidity License: MIT

Features ✨

  • βœ… AI model versioning with timestamp tracking
  • πŸ”‘ Granular access control per ID (owner + authorized wallets)
  • πŸ“š Advanced query methods:
    • Version pagination
    • Index-based version retrieval
    • Latest version per ID
    • User-specific model IDs
  • πŸ›‘οΈ Security modifiers for all operations
  • πŸ“‘ EVM-compatible architecture
  • πŸ“Š Change tracking through events

Core Components 🧩

- EternacodeAI.sol
  β”œβ”€β”€ Structures:
  β”‚   └── ModelVersion (dataHash, timestamp, author)
  β”‚
  β”œβ”€β”€ Mappings:
  β”‚   β”œβ”€β”€ idToVersions (ID => versions)
  β”‚   β”œβ”€β”€ permissions (ID => wallet => bool)
  β”‚   └── idToLatestAuthor (ID => last editor)
  β”‚
  β”œβ”€β”€ Functions:
  β”‚   β”œβ”€β”€ addVersion()       # Add new model version
  β”‚   β”œβ”€β”€ getVersions()      # Get all versions
  β”‚   β”œβ”€β”€ getLatestVersion() # Latest model version
  β”‚   └── getUserLatestIds() # IDs edited by user
  β”‚
  └── Events:
      β”œβ”€β”€ VersionAdded
      β”œβ”€β”€ PermissionGranted
      └── PermissionRevoked

Query Methods πŸ”

Method Description Example
getVersionsPaginated(id, N) Get last N model versions getVersionsPaginated(1, 3)
getVersion(id, index) Get specific version by index getVersion(1, 0)
getLatestVersion(id) Get latest model version getLatestVersion(1)
getUserLatestIds(wallet) Get IDs where wallet last edited getUserLatestIds(0x123...)

Security Considerations πŸ”’

  • πŸ” Owner-exclusive permission management
  • β›½ Gas optimization using numeric IDs
  • πŸ•΅οΈ Third-party audits recommended for mainnet
  • 🧩 Dedicated admin wallets advised
  • πŸ”„ Regular dependency updates

Contributing 🀝

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Follow coding standards
  4. Submit a Pull Request

Roadmap πŸ—ΊοΈ

  • Web3.js/React demo interface
  • Model training metadata support

License πŸ“„

MIT License - See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published