All smart contracts in the stellar-router suite follow a consistent event naming pattern to ensure predictable integration and monitoring.
-
Use past tense verbs for events (action completed)
- ✓
admin_transferred— admin was transferred - ✓
role_granted— role was granted - ✓
route_registered— route was registered - ✗
grant_role— ambiguous (command vs event) - ✗
role_grant— incomplete verb form
- ✓
-
Use snake_case for all event names
- ✓
metadata_updated - ✗
metadataUpdated
- ✓
-
Use action + subject order when possible
- ✓
admin_transferred(what + who) - ✓
route_registered(what + what) - ✓
role_revoked(what + what)
- ✓
-
Event payloads should include relevant context
- Include the target of the action (e.g., old and new admin for
admin_transferred) - Include identifiers needed to track the action (e.g., route name, role, address)
- Include the target of the action (e.g., old and new admin for
route_registered— (route_name, address)routed— (route_name, address)alias_added— (existing_name, alias_name)metadata_updated— (route_name, metadata)admin_transferred— (old_admin, new_admin)
contract_registered— (contract_name, version)contract_deprecated— (contract_name, version)admin_transferred— (old_admin, new_admin)
role_granted— (role, target, expiry_timestamp)role_revoked— (role, target)role_parent_set— (role, parent_role)role_parent_removed— (role, parent_role)role_admin_set— (role, admin)address_blacklisted— (address)address_unblacklisted— (address)role_expired— (role, target)admin_transferred— (old_admin, new_admin)
op_queued— (op_id, target, eta)op_executed— (op_id, target)op_cancelled— (op_id)
call_result— (caller, target, function, success)batch_executed— (summary data)max_batch_size_updated— (old_size, new_size)admin_transferred— (old_admin, new_admin)
rate_limit_exceeded— (caller, route)call_logged— (caller, route, timestamp, success)middleware_enabled— (enabled)route_config_updated— (route_name, config)circuit_breaker_opened— (route_name)admin_transferred— (old_admin, new_admin)
execution_result— (target, function, success, attempts)fee_estimated— (total_fee, surge_pricing)simulation_result— (target, function, success)