Smart contract help


#1

Hi there,

I need your help :slight_smile:

I am confused little bit with so many types of smart contracts.
I would like to create token where I would be able to send somebody request for payment and get payment when he accepts my request (based on some additional data I would have send).

How should I start building this?


#3

Hello!
Think about smart account script as about the latch that allows to take money from the account. Basically, this is a signature, so everyone who has a private key could take the money.
It is possible to create a script that works different, even allows to take money from an account to anybody.
You have to come up with a proof (signature or hash or something else) that allows you and only you to take the money from the client’s account.
So, the process looks like this.

  1. Client puts the money on the scripted account provided by you.
  2. You can’t take those money without the “proof”. Client can take the money only after a lock period, 3 days for example.
  3. If you deliver product, you have the “proof” and can send a transaction from the account to your personal account. If you don’t deliver, the client takes the money back.

If this is too complicated for you, may be built-in Waves Wallet functionality, to send a payment request will be enough for you?


#4

Thanx,

I have solved this by sending transaction with message (kind of invoice) with minimum value)
My app reads this transaction and asks user if he wants to pay requested amount
If yes - app is sending transaction with requested value.

I don’t yet fully understand your solution but I will have to digg into this because I have more complex scenarios on my mind.


#5

Ok I took 2’nd look at this and it looks interesting.
Still I have few issues with that approach

  • This requires many transactions to accomplish simple thing.
  • Proof must be sent separately after completing tasks
  • If you want to pay this way for small things - costs of transaction would consume serious amount of exchanged tokens.

#6

Yes, I agree with you on all your points.
But the suggested way gives the trust. It costs more and should be applied if needed.