Account | Coin | Balance |
---|---|---|
![]() Will | FooCoins | 100 |
![]() Will | BarCoins | 0 |
![]() Alan | FooCoins | 0 |
![]() Alan | BarCoins | 100 |
![]() Escrow | FooCoins | 0 |
Account | Coin | Amount |
---|---|---|
![]() Will | FooCoins | |
![]() Alan | BarCoins |
In an escrow, Will wants to exchange FooCoins for Alan's BarCoins. To do so, Will sends his FooCoins to a neutral "escrow" account. Once his coins have arrived, Alan sends his BarCoins to Will, and the escrow sends its FooCoins to Alan. Both transactions are atomic: if anything goes wrong, they are rolled back.
👉 Setup:
1. Connect Phantom wallet (top-right).
2. Airdrop yourself SOL on devnet.
👉 Instructions:
1. Initialize escrow.
2. Set FooCoins and BarCoins amounts.
3. Submit escrow (as Will).
4. Accept escrow (as Alan).