This reference documents all events and custom errors used throughout the IXFI Protocol smart contracts, providing developers with comprehensive information for monitoring, debugging, and integration.
Core Protocol Events
IXFI Gateway Events
Emitted when a cross-chain contract call is initiated.
Copy event ContractCall (
address indexed sender,
string destinationChain,
string destinationContractAddress,
bytes32 indexed payloadHash,
bytes payload
); Parameters:
sender: Address that initiated the call
destinationChain: Target blockchain name
destinationContractAddress: Target contract address
payloadHash: Hash of the payload for verification
payload: Encoded function call data
Usage Example:
ContractCallWithToken
Emitted when a cross-chain contract call with token transfer is initiated.
Parameters:
sender: Address that initiated the call
destinationChain: Target blockchain name
destinationContractAddress: Target contract address
payloadHash: Hash of the payload
payload: Encoded function call data
symbol: Token symbol being transferred
amount: Amount of tokens being transferred
Emitted when tokens are sent cross-chain.
Emitted when a cross-chain command is executed on the destination chain.
Parameters:
commandId: Unique identifier for the command
sourceChain: Originating blockchain name
sourceAddress: Original caller's address
success: Whether execution was successful
returnData: Return data from the executed function
IXFI Token Events
Emitted when IXFI tokens are minted (cross-chain transfer in).
Emitted when IXFI tokens are burned (cross-chain transfer out).
Emitted when a new relayer is added to the network.
Emitted when a relayer is removed from the network.
Emitted when a new blockchain is added to the protocol.
Emitted when a blockchain is removed from the protocol.
DEX Aggregation Events
Emitted when a token swap is executed through the aggregator.
Emitted when an optimal route is found for a swap.
Emitted when liquidity is added to a DEX through the aggregator.
Emitted when a meta-transaction is executed.
GaslessCreditsAdded
Emitted when gasless credits are added for a user.
GaslessCreditsUsed
Emitted when gasless credits are consumed.
Protocol Errors
Core Protocol Errors
Thrown when an unsupported or invalid chain is specified.
Common Causes:
Chain not registered in the protocol
Chain temporarily disabled
Resolution:
Thrown when an unauthorized relayer attempts to execute commands.
Common Causes:
Relayer stake below minimum
Relayer temporarily suspended
CommandAlreadyExecuted
Thrown when attempting to execute a command that has already been processed.
Common Causes:
Duplicate transaction submission
Race condition in relayer network
InsufficientBalance
Thrown when a user doesn't have enough tokens for an operation.
InvalidSignature
Thrown when signature verification fails.
Common Causes:
Wrong private key used for signing
Signature malformed or corrupted
Domain separator mismatch
PayloadExecutionFailed
Thrown when cross-chain payload execution fails.
DEX Aggregation Errors
InsufficientOutputAmount
Thrown when swap output is below minimum acceptable amount.
NoLiquidityAvailable
Thrown when no liquidity is available for a trading pair.
ExcessiveSlippage
Thrown when price slippage exceeds acceptable limits.
Thrown when the provided swap path is invalid.
DEXNotSupported
Thrown when trying to use an unsupported DEX.
Gas Management Errors
InsufficientGasPayment
Thrown when gas payment is insufficient for cross-chain operation.
GasLimitExceeded
Thrown when gas limit exceeds maximum allowed.
GasPriceOutOfRange
Thrown when gas price is outside acceptable range.
Thrown when meta-transaction nonce is invalid.
TransactionExpired
Thrown when meta-transaction deadline has passed.
InsufficientGasCredits
Thrown when user doesn't have enough gas credits for gasless transaction.
RelayerNotAuthorized
Thrown when relayer is not authorized for meta-transactions.
Event Monitoring Patterns
Basic Event Listening
Advanced Event Filtering
Event Aggregation and Analytics
Error Handling Patterns
Comprehensive Error Handling
React Error Boundary
Event Monitoring
Use Filters : Filter events by user or specific parameters to reduce noise
Handle Reconnections : Implement robust connection handling for WebSocket providers
Store Event History : Cache important events for offline access
Rate Limiting : Implement rate limiting for high-frequency events
Categorize Errors : Distinguish between user errors, network issues, and protocol errors
Implement Retries : Use exponential backoff for transient errors
User Feedback : Provide clear, actionable error messages to users
Monitoring : Track error patterns to identify systemic issues
Batch Event Queries : Use queryFilter for historical data instead of individual calls
Optimize Filters : Use indexed parameters in event filters
Connection Pooling : Manage WebSocket connections efficiently
Cleanup : Remove event listeners when components unmount
Last updated 5 months ago