Avax-reFlight
Fly Smarter, Own, Trade and Travel On-chain.
Created on 22nd June 2025
•
Avax-reFlight
Fly Smarter, Own, Trade and Travel On-chain.
The problem Avax-reFlight solves
PROBLEM STATEMENT:
The global travel booking industry suffers from several critical inefficiencies that impose significant costs on consumers and create market rigidities:
Intermediary Tax and Lack of Transparency: Traditional booking platforms (Expedia, Booking.com) extract 15-25% commissions while providing limited transparency in pricing mechanisms. Travelers have no visibility into how prices are determined or whether they're receiving fair market rates.
Illiquid Asset Problem: Flight tickets represent billions in pre-purchased travel assets that become worthless if unused. The current system offers no mechanism for travelers to recover value from changed plans, creating deadweight economic loss.
Market Inefficiency: Airlines maintain artificial scarcity and opaque pricing algorithms, while travelers lack price discovery mechanisms or ability to trade based on demand fluctuations.
Payment Infrastructure Limitations: Cross-border payments involve multiple intermediaries, currency conversion fees, and settlement delays, particularly problematic for international travel bookings.
THE SOLUTION:
Direct Airline Integration: Smart contracts connect directly with airline inventory systems, eliminating booking platform intermediaries and their 15-25% fees. Users pay airlines directly using AVAX tokens.
NFT Ticketing System: Flight tickets are minted as NFTs on Avalanche, creating verifiable ownership and enabling programmable ticket functionality (automatic refunds, seat changes, etc.).
Secondary Marketplace: Built-in DEX functionality allows travelers to list unused tickets for resale. Market forces determine pricing rather than airline restrictions, creating liquidity for previously illiquid travel assets.
Dynamic Pricing Oracle: Chainlink price feeds ensure fair USD/AVAX conversion, while potential integration with flight data APIs enables real-time pricing based on demand, availability, and market conditions.
Automated Settlement: Smart contracts handle payments, refunds, and transfers automatically based on flight status and predefined conditions, eliminating disputes and delays.
Key Solution Benefits:
Cost: 60-80% reduction in booking fees
Liquidity: Monetize unused tickets through resale
Transparency: Open-source pricing and full transaction visibility
Efficiency: Instant settlements and automated processes
Ownership: True ticket ownership via NFTs
Challenges I ran into
Challenges Encountered During Development
Building the on-chain flight booking platform came with several technical and architectural challenges:
Smart Contract Size Limits
As the project grew in complexity—incorporating NFT issuance, booking logic, and CCIP messaging—the contract code exceeded the EVM’s 24KB size limit, requiring careful optimization using Solidity best practices, the compiler optimizer, and logic refactoring into modular components.
Cross-Chain Integration with CCIP
Integrating Chainlink's CCIP for messaging between chains introduced difficulties in configuring the correct _router addresses and managing the Any2EVMMessage structure. Parsing and handling messages in a secure and efficient way required deeper understanding of the protocol.
Gas Efficiency and Cost Management
Since flight booking involves multiple state changes (minting NFTs, updating seat availability, etc.), optimizing gas usage was critical. We had to remove unused variables, shorten revert messages, and streamline function logic.
Testnet Deployment Constraints
While deploying to the Fuji Testnet, we encountered RPC inconsistencies, wallet connection issues, and limits related to testing token transfers and cross-chain calls. These delayed testing cycles and required multiple iterations.
Frontend-Contract Synchronization
Ensuring the frontend correctly tracked contract events (e.g., booking confirmations, NFT minting) involved handling asynchronous state updates and parsing emitted logs in real-time.
Solutions Implemented
Optimizing Contract Size
We enabled the Solidity optimizer with a low runs value and eliminated all unused variables, verbose revert strings, and tightly packed function logic. Where possible, we modularized repeated logic into libraries, successfully reducing bytecode size to fit EVM limits.
Mastering CCIP Message Handling
By studying Chainlink's documentation and examining testnet behavior, we structured our message parsing with clarity and safety in mind. Understanding the lifecycle of Any2EVMMessage was key to successfully receiving and validating cross-chain messages.
Improving Gas Efficiency
Every function was carefully profiled for gas consumption. We replaced require() messages with custom errors and used more memory-efficient data structures to cut costs. These practices will also make the platform more scalable on mainnet.
Deploying Seamlessly to Fuji
We built and deployed through Remix IDE using MetaMask and hardcoded the correct CCIP _router address. This gave us confidence in manual contract interaction and helped us simulate real-world use on Avalanche’s test environment.
Frontend-Contract Sync via Events
We emitted clear, structured events for critical actions like bookings and NFT mints. This allowed our frontend to listen to logs and provide users with real-time updates, improving the user experience.
Tracks Applied (2)
Onchain Finance
Avalanche Track
Avalanche
Technologies used

