defi-wonderland / aztec-private-oracle

9 stars 1 forks source link

feat: add payments #9

Closed 0xShaito closed 1 year ago

0xShaito commented 1 year ago

CLOSES AZT-5

linear[bot] commented 1 year ago
AZT-5 Add payment for requests

We already worked on payments [before](https://github.com/defi-wonderland/aztec-private-oracle-private/pull/8/files). Add it again and change it to use [nonce for transfer from](https://docs.aztec.network/dev_docs/tutorials/writing_token_contract#authorizing-token-spends) so we don't need to track balance changes and expect the payment before. We should add nonce and fee to the `submit_question`function. Use the nonce to take the corresponding amount of tokens from the user and save the fee in the question for payment to divinity or `cancel_question`.