5 Commits

Author SHA1 Message Date
Eric
8b909f55d2
Remove saturation parameter
Remove saturation parameter, delta, and instead use expansionRate as part of the storage request, in preparation for a linear curve of the expanding window definition.
2024-09-20 15:57:14 +10:00
Eric
7fb19f1586
Add saturation parameter
Add a parameter, `saturation` to the network-level configuration, under `SlotReservationConfig`. This parameter represents the percentage of total time before expiry that all addresses are eligible to reserve a slot. Total time is the duration between request creation and expiry. Valid range is [0, 99].

Note, this parameter is not yet used anywhere.
2024-09-19 19:26:33 +10:00
Eric
d2ba8693e7
Remove return value for reserveSlot
Not needed, as a slot that cannot be added due to already being included would revert anyway.
2024-09-19 14:25:41 +10:00
Eric
b62c72b5e1
uses msg.sender for slot reservation address 2024-09-18 20:22:17 +10:00
Eric
64ce222e24
feat(slot-reservations): Allow slots to be reserved
Closes #175.

Allows reservation of slots, without an implementation of the expanding window.

- Add a function called `reserveSlot(address, SlotId)`, that allows three unique addresses per slot to be reserved, that returns bool if successful.
       - Use `mapping(SlotId => EnumerableSet.AddressSet)`
       - Return false if the address could not be added to the set (if `EnumerableSet.add` returns false)
- Add `canReserveSlot(address, SlotId)`
        - Return `true` if set of reservations is less than 3 and the set doesn't already contain the address
        - Return `true` otherwise (for now, later add in logic for checking the address is inside the expanding window)
        - Call `canReserveSlot` from `reserveSlot` as a `require` or invariant
2024-09-18 19:34:43 +10:00