Overview
The Computable Token Machine is a revolutionary token standard that combines ERC-20 functionality with the Diamond Standard (EIP-2535). Each CTM is both a standard token AND a modular execution environment capable of running its own applications, managing state, and evolving over time.Beyond value, beyond utility—tokens that think.
EIP-2535 Diamond
Modular architecture
Modular Programs
Infinite extensibility
On-Chain Autonomy
Self-executing logic
Live Contract
Deployed CTM
Address:
0x477A9f214c947e6D81b9d32b6b1883F4a4ffFb24View on PaxScan →What is CTM?
The Computable Token Machine is a revolutionary token standard that combines ERC-20 functionality with the Diamond Standard (EIP-2535). Each CTM is both a standard token AND a modular execution environment capable of running its own applications, managing state, and evolving over time.Key Features
Infinite Extensibility
Infinite Extensibility
Add new features and applications to your token after deployment. Your token evolves with your needs.
Gas Efficiency
Gas Efficiency
Modular Programs optimize gas usage and bypass EVM contract size limits.
On-Chain Autonomy
On-Chain Autonomy
Create complex on-chain agents that manage assets and execute tasks based on rich internal state.
Core Concepts
Two Personalities
CTM acts as both a token and a machine:- The Token
- The Machine
On the outside, a CTM behaves like any standard ERC-20 token. It can be:
- Held in wallets
- Traded on exchanges
- Used in DeFi protocols
- Transferred between addresses
Programs (Facets)
Programs are stateless Solidity contracts that contain the logic executed by the CTM. Each Program manages its own state within a unique storage slot to prevent collisions. Example Programs:- Voting and Governance
- Staking and Rewards
- DEX Integration
- NFT Minting
- Custom Game Logic
- Automated Trading
- On-chain AI Agents
Diamond Standard (EIP-2535)
CTM is built on the Diamond Standard, which allows a single contract to use multiple logic contracts (facets/programs). This pattern enables:- ✅ Unlimited contract size
- ✅ Upgradability
- ✅ Modular functionality
- ✅ Single address persistence
Quick Start
1
Clone Repository
2
Configure Network
Add HyperPaxeer details to
hardhat.config.js:hardhat.config.js
3
Deploy
- TokenVM.sol (the main proxy contract)
- DiamondCutFacet (for adding/removing Programs)
- DiamondLoupeFacet (for inspecting installed Programs)
- OwnershipFacet (access control)
- ERC20Facet (token functionality)
Creating Programs
Program Structure
Programs must be stateless and manage state within a unique storage slot to prevent collisions.VotingProgram.sol
Adding Programs to CTM
Use thediamondCut function to register new Programs:
Helper Function for Selectors
Program Best Practices
1. Unique Storage Slots
1. Unique Storage Slots
Always use keccak256 hashes for storage positions to avoid collisions:Never use regular state variables at the contract level!
2. Stateless Logic
2. Stateless Logic
Programs should not hold funds or use constructors that set state:❌ Wrong:✅ Correct:
3. Access Control
3. Access Control
Protect diamondCut with ownership or governance controls:Only authorized addresses should be able to add/remove Programs.
4. Inter-Program Communication
4. Inter-Program Communication
Programs can call each other using address(this) and shared storage:
Security Considerations
Auditing Checklist
Before deploying CTM or adding new Programs:- Storage slots use unique keccak256 hashes
- No global state variables in Programs
- Access control properly configured
- Programs don’t hold funds directly
- All Programs thoroughly tested
- diamondCut function is protected
- Inter-program interactions tested
- Gas optimization reviewed
- Security audit completed (for production)
Advanced Examples
Staking Program
Governance Program
Resources
GitHub Repository
View source code and examples
Live Contract
Explore on PaxScan
EIP-2535 Specification
Learn about Diamond Standard
Developer Community
Join other CTM developers
Next Steps
Deploy Your First CTM
Follow the deployment guide
Create Custom Programs
Build your own logic modules
Smart Contracts Guide
General contract deployment
Configuration
Set up your development environment