near / devx

This is the home of NEAR collective developer experience plans and roadmap.
11 stars 0 forks source link

[Mr. Pink] Rework how payments are made, and withdrawn #246

Closed mikedotexe closed 3 years ago

mikedotexe commented 3 years ago

There are some issues on how payments are managed:

  1. The client contract does not make requests or approves payment amount transfer before doing so. This is linked to the Client contract should call oracle contract #4. Please use ChainlinkClient.sol as a reference.
  2. The client can not cancel a request and get a refund. This is linked to Allow clients to cancel request #7.
  3. Withdrawable tokens amount should not be added during the request phase. The tokens are not available to be withdrawn until the request is fulfilled.
  4. The fulfill_request should not make a payment transfer to the node operator. The payment amount should be stored in the withdrawable_tokens variable on fulfillment, and from there on should be available to be withdrawn.
  5. There should be an extensive test suite testing the contract money management.