-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ub = unencumbered balance (purse "currentAmount") | ||
eb = encumbered balance (total payments in recovery set) | ||
fb = full balance = eb + ub (orch acct balance) | ||
|
||
s = source | ||
d = dest | ||
|
||
ertp withdraw(a) | ||
ub -= a | ||
eb += a | ||
fb unchanged | ||
|
||
ertp deposit(a) | ||
sub unchanged | ||
seb -= a | ||
sfb -= a | ||
once transfer succeeds | ||
dub += a | ||
deb unchanged | ||
dfb += a | ||
once transfer fails | ||
sub += a | ||
seb unchanged from above | ||
sfb += a (net sfb unchanged) | ||
|
||
ertp burn(a) (like a successful deposit to dev/null) | ||
ub unchanged | ||
eb -= a | ||
fb -= a | ||
|
||
ertp reclaim(a), like a successful self.deposit(a) | ||
ub += a | ||
eb -= a | ||
fb unchanged | ||
|
||
if orch account can be independently spent from | ||
ub can go negative, if fb < eb | ||
payments can fail to be deposited |