Mark Spanbroek
be38c54622
[style] enforce `_` prefix for private names
...
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2023-01-23 15:10:23 +01:00
Mark Spanbroek
b3855c4ba3
[style] Use _ for private and internal functions
...
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2023-01-23 15:10:23 +01:00
Mark Spanbroek
a7397981bb
[Collateral] Inline slashAmount() function
2023-01-10 12:15:22 +01:00
Mark Spanbroek
71656f6a95
[collateral] Remove AccountLocks
...
AccountLocks is replaced by the isWithDrawAllowed()
implementation in Marketplace.
2022-12-22 10:29:06 +01:00
Mark Spanbroek
a7be363f04
[marketplace] Unlock collateral when list of slots is empty
2022-12-22 10:29:06 +01:00
Eric Mastro
08e73d9348
[marketplace] Add tests for freeing a slot
2022-10-25 12:38:19 +11:00
Eric Mastro
0ffe5d7697
[marketplace] free slot after too many proofs missed
...
Needs tests
2022-10-25 12:38:19 +11:00
Eric Mastro
1b216f6655
slash first then check collateral threshold
...
Once a proof is marked as missing, if that missing proof is enough to slash a host, first slash the host, then check the hosts balance. If the balance has dropped below the minimum allowable collateral threshold, then remove them from the slot.
2022-09-21 20:52:44 +10:00
Eric Mastro
9f8affdcaa
[marketplace] Add tests for freeing a slot
2022-09-21 20:52:44 +10:00
Eric Mastro
7487663534
[marketplace] free slot after too many proofs missed
...
Needs tests
2022-09-21 20:52:44 +10:00
Mark Spanbroek
f9cc73d62f
Rename invariants to avoid name clashes
2022-03-15 10:01:12 +01:00
Mark Spanbroek
e963a25c94
Replace Stakes with Collateral
...
Removes the old Stakes implementation in favor of the
new Collateral implementation.
2022-03-01 09:38:53 +01:00
Mark Spanbroek
91a976a007
Prevent withdrawal of locked collateral
2022-03-01 09:38:53 +01:00
Mark Spanbroek
ab38473688
Slash collateral
2022-03-01 09:38:53 +01:00
Mark Spanbroek
2f59927b30
Check result of ERC20 transferFrom call
2022-03-01 09:38:53 +01:00
Mark Spanbroek
9e0d05965d
Update collateral totals and balance at the same time
2022-03-01 09:38:53 +01:00
Mark Spanbroek
c86fdfbec1
Withdraw collateral
2022-03-01 09:38:53 +01:00
Mark Spanbroek
3d50e56fe7
Collateral invariant
2022-03-01 09:38:53 +01:00
Mark Spanbroek
6e0aded775
Deposit collateral
2022-03-01 09:38:53 +01:00