Skip to content

Commit

Permalink
add punctuation 😂
Browse files Browse the repository at this point in the history
  • Loading branch information
morkeltry committed Oct 13, 2024
1 parent 2d95760 commit 81d089d
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,55 +75,47 @@ The only fucntion that requires any authentication is `withdrawTo`, and the auth
#### functions:

###### new_auth_out (preferred_auth : authOut)
```
if preferred_auth exists already as a key in balances, then report error.

if not, then add it as a key with balance 0 and report success.
```

###### link_payment_reference (auth : authOut, payment_ref : ref)
```
if auth does not exist as a key in balances, then report error.

if not:

if payment_ref already exists as a key in paymentRefs, then randomly generate an alternative and set payment_ref to that.

add payment_ref as a key in paymentRefs and set its value to auth

```
###### accept_payment (payment_ref : ref, amount : u__, encrypt_to : Option(pubkey))
```
<<< future work:

if payment_ref is encrypted with secret contract's own pubkey

decrypt it and set payment_ref to the decrypted version >>>
```

```
if payment_ref not exist as a key in paymentRefs, then report error.

if it does:

add amount to balances[ paymentRefs[payment_ref] ]

create a receipt (eg json) { payment_ref, amount }

sign the receipt with the secret contract's privkey

if encrypt_to contains a pubkey:

encrypt the receipt and signature with pubkey and return them

if not,

return the receipt and signature

```

###### withdraw_to (auth : authOut, amount : u__, withdrawal_address : address)
```
if auth does not exist as a key in balances, then report error.

if balances[auth] < amount then report error.

if neither error:

return DO_THE_WITHDRAWAL (withdrawal_address, amount)

return DO_THE_WITHDRAWAL (withdrawal_address, amount)
```

###### retrieve_pubkey ()
```
return the secret contract's own pubkey
```

0 comments on commit 81d089d

Please sign in to comment.