Adam Uhlíř
fd17feaa4c
chore: formatting
2025-03-25 13:50:42 +01:00
Adam Uhlíř
da59b7f31c
feat: protocol fee
2025-03-24 17:43:34 +01:00
Mark Spanbroek
129e82f707
marketplace: repair reward is paid out at the end
...
It is no longer a discount on the collateral, to
simplify reasoning about collateral in the sales
module of the codex node
2025-03-12 10:52:11 +01:00
Mark Spanbroek
6992757f3f
proofs: use Timestamp instead of uint64
2025-03-06 15:23:24 +01:00
Mark Spanbroek
a0b92b74c8
marketplace: remove 'Paid' state
...
This state is no longer necessary, vault ensures
that payouts happen only once. Hosts could bypass
this state anyway by withdrawing from the vault
directly.
2025-03-04 09:36:10 +01:00
Mark Spanbroek
4e97ebf89b
marketplace: cleanup
2025-03-04 09:36:10 +01:00
Mark Spanbroek
9d563b011f
marketplace: remove accounting that is now done by vault
2025-03-04 09:36:10 +01:00
Mark Spanbroek
d492e6e352
marketplace: formatting
2025-03-04 09:36:10 +01:00
Mark Spanbroek
257ef55953
marketplace: designate validator rewards
...
so that they can no longer be transfered
within the vault
2025-03-04 09:36:10 +01:00
Mark Spanbroek
ab5dad67af
marketplace: transfer repair reward in vault
2025-03-04 09:36:10 +01:00
Mark Spanbroek
09a3cbcb09
marketplace: optimize storage reads and writes
2025-03-04 09:36:10 +01:00
Mark Spanbroek
65890338d7
marketplace: remove accounting that is now done by vault
2025-03-04 09:36:10 +01:00
Mark Spanbroek
bddbd02f02
marketplace: burn tokens in vault when slashing
...
- move all collateral calculatons to separate library
2025-03-04 09:36:10 +01:00
Mark Spanbroek
639466662d
marketplace: simplify withdrawing by client
...
- removes RequestCancelled event, which was not great anyway
because it is not emitted at the moment that the request is
cancelled
2025-03-04 09:36:10 +01:00
Mark Spanbroek
1e74be6243
marketplace: remove accounting that is now done by vault
2025-03-04 09:36:10 +01:00
Mark Spanbroek
d95863bce8
marketplace: remove fuzzing
...
replaced by formal verification with certora
2025-03-04 09:36:10 +01:00
Mark Spanbroek
13b4038d35
marketplace: collateral is uint128
...
Vault stores balances as uint128
2025-03-04 09:36:10 +01:00
Mark Spanbroek
83a59d8227
marketplace: use Timestamp, Duration and TokensPerSecond types
2025-03-04 09:36:10 +01:00
Mark Spanbroek
284b54e575
vault: move Timestamp and TokensPerSecond libraries one level up
2025-03-04 09:36:10 +01:00
Mark Spanbroek
8df557801c
marketplace: use vault in marketplace
2025-03-04 09:36:10 +01:00
Mark Spanbroek
8b40f63693
marketplace: remove support for changing payout addresses
2025-03-04 09:36:10 +01:00
Mark Spanbroek
d5ab2ecf8d
marketplace: deploy vault and set it in the marketplace
2025-03-04 09:36:10 +01:00
Mark Spanbroek
994e328b05
marketplace: use SafeERC20 for transfers
2025-03-04 09:36:10 +01:00
Mark Spanbroek
9b42a4627f
vault: clarification
...
Co-Authored-by: Adam Uhlíř <adam@uhlir.dev>
2025-03-04 09:36:00 +01:00
Mark Spanbroek
edee270eca
vault: rename Lock -> Fund
2025-03-04 09:36:00 +01:00
Mark Spanbroek
96b4fc0eff
vault: rename lock states
...
- NoLock -> Inactive
- Unlocked -> Withdrawing
2025-03-04 09:36:00 +01:00
Mark Spanbroek
2900bed8fd
vault: rename Fund -> FundId
2025-03-04 09:36:00 +01:00
Mark Spanbroek
62aea75295
vault: freezeFund() instead of burnFund()
2025-03-04 09:36:00 +01:00
Mark Spanbroek
6db1a5fb3a
vault: only allow account holder to withdraw for itself
2025-03-04 09:36:00 +01:00
Mark Spanbroek
95a698c574
vault: allow for multiple accounts for one account holder
2025-03-04 09:36:00 +01:00
Mark Spanbroek
4c46f2d1a0
vault: pausing and unpausing
2025-03-04 09:36:00 +01:00
Mark Spanbroek
81032965f4
vault: update documentation
2025-03-04 09:36:00 +01:00
Mark Spanbroek
473a5fec19
vault: fix accounting of locked value when burning designated tokens
2025-03-04 09:36:00 +01:00
Mark Spanbroek
43cd44330b
vault: add documentation
2025-03-04 09:36:00 +01:00
Mark Spanbroek
439d3772db
vault: remove dead code
2025-03-04 09:36:00 +01:00
Mark Spanbroek
b7b1e8c25b
vault: cleanup
2025-03-04 09:36:00 +01:00
Mark Spanbroek
dc3084836f
vault: prefix errors with 'Vault'
2025-03-04 09:36:00 +01:00
Mark Spanbroek
ad6df66768
vault: burn part of designated tokens
2025-03-04 09:36:00 +01:00
Mark Spanbroek
3ff331b883
vault: rename burn -> burnAccount, burnAll -> burnFund
2025-03-04 09:36:00 +01:00
Mark Spanbroek
62eb07e640
vault: clean up errors
2025-03-04 09:36:00 +01:00
Mark Spanbroek
e3291ed82e
vault: formatting
2025-03-04 09:36:00 +01:00
Mark Spanbroek
13d590d67b
vault: do not expose Lock internals on public api
2025-03-04 09:36:00 +01:00
Mark Spanbroek
6877078f4c
vault: transfer tokens to 0xdead when fund is burned
2025-03-04 09:36:00 +01:00
Mark Spanbroek
bbdd614579
vault: burn entire fund
2025-03-04 09:36:00 +01:00
Mark Spanbroek
4533c82011
vault: prevent approval hijacking
...
- transfer ERC20 funds into the vault from the
controller, not from the user
- prevents an attacker from hijacking a user's
ERC20 approval to move tokens into a part of
the vault that is controlled by the attacker
2025-03-04 09:36:00 +01:00
Mark Spanbroek
b076528e1a
vault: reduce size of timestamp further
2025-03-04 09:36:00 +01:00
Mark Spanbroek
6980acd59b
vault: rename error
2025-03-04 09:36:00 +01:00
Mark Spanbroek
026609e3c7
vault: remove _getAccount()
...
- no longer calculate flow updates when not needed
- use account.update(timestamp) where needed
- use _getBalance() to view current balance
2025-03-04 09:36:00 +01:00
Mark Spanbroek
a83a6f4cad
vault: fix transfer to self
2025-03-04 09:36:00 +01:00
Mark Spanbroek
450e5308d9
vault: split flow into incoming and outgoing
...
- no need to deal with signed integers anymore
- allows flow to self to designate tokens over time
2025-03-04 09:36:00 +01:00