Buyer deposits funds into an escrow smart contract. Seller provides the asset (SPL token, NFT, or other assets). Contract releases funds once predefined conditions are met.
create_escrow(): Locks funds from the buyer in escrow.
approve_escrow(): Buyer must approve the transaction.
release_funds(): Transfers funds to the seller once conditions are met.
- Create an escrow contract:
solana program invoke --program-id <PROGRAM_ID> --signer --data create_escrow
- Approve escrow transaction:
solana program invoke --program-id <PROGRAM_ID> --signer --data approve_escrow
- Release funds to seller:
solana program invoke --program-id <PROGRAM_ID> --signer --data release_funds