0

I have a solana program that will transfer some amount. After agreeing to the amount to transfer, the transaction will take place a little later. Few hours to few days. Is there a way my solana smart contract can put a hold/lock kind of enforcement to make sure the funds are available when the transaction takes place ?

Subash Chaturanga
  • 814
  • 2
  • 10
  • 20

2 Answers2

1

You are looking for an escrow smart contract.

One example that is really well explained is this one https://github.com/paul-schaaf/solana-escrow

dr497
  • 474
  • 2
  • 3
  • In escrow concept, will the user still see the tokens in his/her wallet. Or will they be moved and be within the solana account owned by the program managed by us. – Subash Chaturanga Aug 15 '22 at 12:56
1

There are a few existing solutions that will do this for you, including the Bonfida token-vesting program and the Streamflow timelock program.

You can find more information about these programs at https://spl.solana.com/token#token-vesting

The idea is to move the tokens to an account owned by the timelock / vesting program, and then these funds are unblocked after a certain amount of time.

Jon C
  • 7,019
  • 10
  • 17
  • My case is the lock period is hours to maximum couple days. And we don't have receipient addresses by the lock time. Only before/around unblock time we have exact receipient addresses. Will that use case suited this? – Subash Chaturanga Aug 15 '22 at 14:33