Cronos plugin for Eliza, extending the EVM plugin functionality.
- Cronos Mainnet (Chain ID: 25)
- RPC Endpoint: https://evm.cronos.org/
- Explorer: https://explorer.cronos.org/
- Native Token: CRO
- Cronos Testnet 3 (Chain ID: 338)
- RPC Endpoint: https://evm-t3.cronos.org/
- Explorer: https://cronos.org/explorer/testnet3
- Native Token: TCRO
pnpm add @elizaos/plugin-cronosimport { cronosPlugin } from "@elizaos/plugin-cronos";
// Use the plugin in your Eliza configuration
const config = {
plugins: [cronosPlugin],
// ... rest of your config
};Create a your-character.character.json file with the following structure:
{
"name": "YourCharacterName",
"plugins": ["@elizaos/plugin-cronos"],
"clients": ["telegram"],
"modelProvider": "openai",
"settings": {
"secrets": {},
"chains": {
"evm": ["cronos", "cronosTestnet"]
}
},
"system": "Primary function is to execute token transfers and check balances on Cronos chain.",
"actions": {
"SEND_TOKEN": {
"enabled": true,
"priority": 1,
"force": true,
"schema": {
"type": "object",
"properties": {
"fromChain": {
"type": "string",
"description": "The chain to execute the transfer on",
"enum": ["cronos", "cronosTestnet"]
},
"toAddress": {
"type": "string",
"description": "The recipient's wallet address",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"amount": {
"type": "string",
"description": "The amount of tokens to transfer",
"pattern": "^[0-9]*(\\.[0-9]+)?$"
}
},
"required": ["fromChain", "toAddress", "amount"]
},
"triggers": [
"send * CRO to *",
"transfer * CRO to *"
],
"examples": [
{
"input": "Send 0.1 CRO to 0x...",
"output": {
"fromChain": "cronos",
"toAddress": "0x...",
"amount": "0.1"
}
}
]
},
"CHECK_BALANCE": {
"enabled": true,
"priority": 1,
"force": true,
"schema": {
"type": "object",
"properties": {
"chain": {
"type": "string",
"description": "The chain to check balance on",
"enum": ["cronos", "cronosTestnet"]
}
},
"required": ["chain"]
},
"triggers": [
"check balance",
"show balance",
"what's my balance",
"how much CRO do I have",
"check balance on *",
"show balance on *"
],
"examples": [
{
"input": "check balance",
"output": {
"chain": "cronos"
}
},
{
"input": "what's my balance on testnet",
"output": {
"chain": "cronosTestnet"
}
}
]
}
},
"messageExamples": [
[
{
"user": "{{user1}}",
"content": {
"text": "Send 100 CRO to 0x..."
}
},
{
"user": "YourCharacterName",
"content": {
"text": "Processing token transfer...",
"action": "SEND_TOKEN"
}
}
],
[
{
"user": "{{user1}}",
"content": {
"text": "What's my balance?"
}
},
{
"user": "YourCharacterName",
"content": {
"text": "Checking your balance...",
"action": "CHECK_BALANCE"
}
}
]
]
}-
Basic Setup
name: Your character's nameplugins: Include@elizaos/plugin-cronosclients: Supported client platforms
-
Chain Settings
- Configure both mainnet and testnet in
settings.chains.evm - Available options:
"cronos"(mainnet) and"cronosTestnet"
- Configure both mainnet and testnet in
-
Action Configuration
SEND_TOKEN: Action for token transfersCHECK_BALANCE: Action for checking wallet balanceschema: Defines the required parameters for each actiontriggers: Phrases that activate the actionsexamples: Sample inputs and outputs
-
Message Examples
- Provide example interactions
- Show how actions are triggered
- Demonstrate expected responses
// Send tokens on mainnet
"Send 0.1 CRO to 0x..." use mainnet
// Send tokens on testnet
"Send 0.1 TCRO to 0x..." use testnet
// Check balance on mainnet
"check balance"
"what's my balance"
"how much CRO do I have"
// Check balance on testnet
"check balance on testnet"
"what's my balance on testnet"
- All standard EVM functionality inherited from @elizaos/plugin-evm
- Preconfigured for both Cronos Mainnet and Testnet
- Native CRO/TCRO token support
- Automated token transfer actions
- Balance checking functionality
- Built-in chain configuration
Required environment variable for transactions:
# Wallet private key (Required, must start with 0x)
CRONOS_PRIVATE_KEY=0x...- NEVER commit private keys to version control
- NEVER share private keys with anyone
- ALWAYS use environment variables or secure key management
- Use separate keys for mainnet and testnet
- Monitor your wallet for unauthorized transactions
- Create
.envfile:
CRONOS_PRIVATE_KEY=0x... # Mainnet- For testnet development, use
.env.local:
CRONOS_PRIVATE_KEY=0x... # Testnet only- Add to
.gitignore:
.env
.env.*
MIT