This program is used by LI.FI primarily to track on-chain transactions generated using the LI.FI backend/API.
To build the program via cargo: cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so
To build the program via https://github.com/Ellipsis-Labs/solana-verifiable-build?tab=readme-ov-file#solana-verify-cli: solana-verify build ./program
To run the program tests: cargo test --manifest-path=./program/Cargo.toml
The program supports the following instructions:
Source Code: src/instructions/track_v1.rs
- Inputs:
- Accounts:
sysvar_clock_account
- The clock sysvar account on Solana.instruction_track_account
- The program derived account (PDA) corresponding to the current or previous epoch. (used to bundle transactions by epoch to facilitate tracking)
- Data:
transaction_id
: Uint8Array (8 bytes) - The unique identifier used to track the transaction, generated by the LI.FI backend/API.
- Accounts:
- Logic:
- Check account inputs for validity
- Check if the first account's public key is readonly and matches the clock sysvar account
- Check if the second account's public key is readonly and matches the PDA of either the current or previous epoch
- Hex-encode the
transaction_id
into a string and log it to stdout, usingsolana_program::log::sol_log
, in the format "LI.FI TX: 0xabcd1234"
- Check account inputs for validity