Version 1.0.0
GitHubSetting Up Automation Guide
Learn how to automate smart contract interactions and functions using the Neo Service Layer Automation service.
Information
This is a basic version of the automation guide. It will be expanded with more detailed content in future updates.
What is Contract Automation?
The Contract Automation service allows you to set up triggers that automatically execute functions or interact with smart contracts based on various conditions:
- Time-based schedules (using cron expressions)
- Blockchain events (like contract operations or token transfers)
- Price thresholds (when a token reaches a certain price)
- External API events
Automation Examples
Time-Based Automation
daily-automation.json
1// Configuration for daily execution at midnight
2{
3 "name": "dailyUpdate",
4 "trigger": {
5 "type": "schedule",
6 "cron": "0 0 * * *"
7 },
8 "action": {
9 "type": "function",
10 "functionId": "your-function-id",
11 "parameters": {
12 "operation": "daily-update"
13 }
14 }
15}
Blockchain Event Automation
event-automation.json
1// Configuration for responding to contract events
2{
3 "name": "transferMonitor",
4 "trigger": {
5 "type": "blockchain",
6 "scriptHash": "0x1234567890abcdef1234567890abcdef12345678",
7 "event": "Transfer"
8 },
9 "action": {
10 "type": "function",
11 "functionId": "transfer-processor",
12 "parameters": {
13 "notify": true
14 }
15 }
16}