requestNetwork icon indicating copy to clipboard operation
requestNetwork copied to clipboard

Develop a PoC "SingleRequestProxy" payment smart contract that emits the paymentReference event in the receive() function

Open MantisClone opened this issue 2 years ago • 3 comments

Definition of Done

  • [x] RequestNetwork/requestNetwork#1394
  • [ ] RequestNetwork/requestNetwork#1395
  • [ ] RequestNetwork/private-issues#135
  • [ ] RequestNetwork/requestNetwork#1396
  • [x] RequestNetwork/payments-subgraph#94
  • [ ] RequestNetwork/requestNetwork#1458
  • [ ] RequestNetwork/docs.request.network#50
  • [ ] Audit the SingleRequestProxyFactory and resulting NativeSingleRequestProxy and ERC20SingleRequestProxy
  • [ ] Build it into Request Invoicing
  • [ ] Test it with a builder

Motivation

  1. RequestNetwork/requestNetwork#1159
  2. Let users pay a request from a Centralized Exchange (CEX).
  3. Let users pay a request without connecting their wallet to a Dapp.

Proposed Solution

Reference: https://miro.com/app/board/uXjVM2Pf758=/?share_link_id=761216115297 Image

Factory Contract can spawn new instances of SingleRequestProxy.

MantisClone avatar Dec 06 '23 21:12 MantisClone

another interesting use case for this : exchanges! They don't support smart contract calls, so cannot interract with the existing proxies.

It seems important that, once used, the "one time proxy" rejects any incoming transfer

benjlevesque avatar Dec 07 '23 08:12 benjlevesque

It seems important that, once used, the "one time proxy" rejects any incoming transfer

@benjlevesque I'm not so sure. I think we'd still want to support partial payments. And since the expected amount can change (via increase/decreaseExpectedAmount) I don't think we can store the expected amount on the contract.

MantisClone avatar Dec 07 '23 15:12 MantisClone

Despite the familiarity of the name "One Time Proxy", I don't think we should call it that, because we support partial payments meaning that a given proxy contract can be paid more than once. I prefer the name "SingleRequestProxy". I think it makes it clear that the Proxy is tied to a single request.

MantisClone avatar Dec 11 '23 20:12 MantisClone