smartcontractkit / near-protocol-contracts

MIT License
26 stars 8 forks source link

Store payments as withdrawable tokens instead of sending it on every request fulfillment #5

Closed krebernisak closed 4 years ago

krebernisak commented 4 years ago

We had a discussion here, about collecting payments for request fulfillment.

Afterward, an issue with NEAR surfaced, where it seems like NEAR has problems with chaining more than two (2) asynchronous requests (promise). Using a withdrawable pattern will avoid this issue for now.

Also, if we follow the Ethereum contract design, this gives us the possible way for requesters to cancel their requests on NEAR. Using a withdrawable pattern will retain that safety for requesters.

Because of this and other issues, we decided to follow the Ethereum contract design and use the withdrawable pattern for collecting payments.