28 Commits

Author SHA1 Message Date
Mark Spanbroek
468bc2e833 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-06-11 16:29:21 +02:00
Mark Spanbroek
5fb63c4939 marketplace: cleanup 2025-06-11 16:29:21 +02:00
Mark Spanbroek
e60ff36202 marketplace: formatting 2025-06-11 16:29:21 +02:00
Mark Spanbroek
b6f5d65630 marketplace: transfer repair reward in vault 2025-06-11 16:29:21 +02:00
Mark Spanbroek
c626372d55 marketplace: burn tokens in vault when slashing
- move all collateral calculatons to separate library
2025-06-11 16:29:21 +02:00
Mark Spanbroek
761fbd4f84 marketplace: collateral is uint128
Vault stores balances as uint128
2025-06-11 16:29:21 +02:00
Mark Spanbroek
4f45856a5e marketplace: use Timestamp, Duration and TokensPerSecond types 2025-06-11 16:29:19 +02:00
Mark Spanbroek
9826f31788 update solidity to version 0.8.28 2025-03-04 09:33:20 +01:00
Adam Uhlíř
c00152e621
perf: optimizing parameters sizing (#207)
* perf: optimizing parameters sizing

* chore: feedback

Co-authored-by: markspanbroek <mark@spanbroek.net>

* style: formatting

* perf: more optimizations

* chore: fixes

* chore: fix certora spec

* chore: more fixes for certora spec

* chore: more and more fixes for certora spec

* fix: ends type

* test(certora): timestamp conversion

* test(certora): timestamp conversion again

* test(certora): timestamp conversion revert to assert_uint64

* test(certora): timestamp with mathint

* test(certora): timestamp back with uint64 with require

* Add missing configuration

* Fix previous merge

* Update StorageRequested to use int64 for expiry

* requestDurationLimit => uint64

---------

Co-authored-by: markspanbroek <mark@spanbroek.net>
Co-authored-by: Arnaud <arnaud@status.im>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2025-02-20 16:54:41 +11:00
Arnaud
0f2012b144
Change the cid from string to bytes (#214)
* Change the cid from string to bytes

* Fix content definition

* Fix cid invalid test
2025-02-13 13:03:45 +00:00
Marcin Czenko
e74d3397a1
Feat: price per byte (#208)
* changes reward => pricePerByte

* collateral => collateralPerByte

* updates tests

* introduces AskHelpers to compute price and collateral per slot

* adds public view function returning currentCollateral for the slot

* updates names for price and collateral

* uses pricePerSlotPerSecond in maxPriceHelper

* adds collateralPerSlot helper

* makes sure that the intended use of the <<currentCollateral>> view function is demonstrated in tests

* formatting

* fix comment

* mints more tokens so that it can be used with contracts tests in nim-codex

* Renaming <<collateral>> and <<reward>> to <<collateralPerByte>> and <<pricePerBytePerSecond>> respectively (merged in the meantime to the master)
2025-01-24 15:28:29 +01:00
Adam Uhlíř
dfab6102e7
feat: repair reward (#193) 2024-12-12 18:39:42 +01:00
Adam Uhlíř
7e6187d4b1
feat: hosts payed by actual time hosting a slot (#160)
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
Co-authored-by: r4bbit <445106+0x-r4bbit@users.noreply.github.com>
2024-10-08 09:38:19 +02:00
Adam Uhlíř
57e8cd5013
feat: expiry specified as duration (#99) 2024-05-06 15:13:32 +02:00
Mark Spanbroek
f3e2186ec2 Update solidity to 0.8.23 2024-01-25 13:08:10 +01:00
Mark Spanbroek
b625f0d519 Merkle root is 32 bytes 2023-11-22 14:43:11 +01:00
Mark Spanbroek
efafa43910 Remove PoR parameters, add merkle root for storage proofs 2023-11-22 14:43:11 +01:00
Adam Uhlíř
14e453ac31
feat: partial payouts for cancelled requests (#69) 2023-10-16 11:14:02 +02:00
Adam Uhlíř
2b5d079882
feat: collateral fractions (#47)
Co-authored-by: Eric Mastro <github@egonat.me>
2023-03-30 11:11:21 +02:00
Adam Uhlíř
dfdbd16d5b
feat: collateral per slot (#44) 2023-03-08 12:02:34 +01:00
Mark Spanbroek
b62eeb564a [marketplace] test & fix slotState() 2023-01-23 15:10:23 +01:00
Mark Spanbroek
2dbdd0028d [marketplace] move price calculations to Requests.sol 2023-01-23 15:10:23 +01:00
Mark Spanbroek
dd65133576 [marketplace] replace Slot.hostPaid with SlotState.Paid 2023-01-23 15:10:23 +01:00
Mark Spanbroek
c8dda37300 [marketplace] introduce SlotState
- replace proofEnd() by slotState()
- replace _slotAcceptsProofs() by slotState()
- remove _stopRequiringProofs()
2023-01-23 15:10:23 +01:00
Mark Spanbroek
10f88a62a7 [marketplace] Move RequestState enum to Requests.sol 2023-01-23 15:10:23 +01:00
Mark Spanbroek
6aa76257f8 [Marketplace] Move slotId() to Requests library
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2023-01-12 13:57:44 +01:00
Mark Spanbroek
2bfed21584 [Marketplace] Extract myRequests() and mySlots() 2023-01-12 13:57:44 +01:00
Mark Spanbroek
27ccb1e2bc [Marketplace] Extract Request struct into separate file 2023-01-10 12:15:22 +01:00