2023-01-17 13:55:58 +01:00
// SPDX-License-Identifier: MIT
2025-01-13 11:24:26 +01:00
pragma solidity 0 . 8 . 28 ;
2023-01-17 13:55:58 +01:00
import " @openzeppelin/contracts/token/ERC20/IERC20.sol " ;
2025-02-26 12:26:04 +01:00
import " ./Timestamps.sol " ;
2023-01-17 13:55:58 +01:00
struct MarketplaceConfig {
CollateralConfig collateral ;
ProofConfig proofs ;
2024-10-03 11:01:21 +10:00
SlotReservationsConfig reservations ;
2025-02-26 12:26:04 +01:00
Duration requestDurationLimit ;
2025-03-24 17:36:21 +01:00
uint16 protocolFeePermille ; // dictates how much of the request price (defined by its ask) should go to protocol fee that is burned; specified in a per mille
2023-01-17 13:55:58 +01:00
}
struct CollateralConfig {
2024-12-12 18:39:42 +01:00
/// @dev percentage of collateral that is used as repair reward
2023-03-30 11:11:21 +02:00
uint8 repairRewardPercentage ;
uint8 maxNumberOfSlashes ; // frees slot when the number of slashing reaches this value
uint8 slashPercentage ; // percentage of the collateral that is slashed
2025-01-27 11:33:23 +01:00
uint8 validatorRewardPercentage ; // percentage of the slashed amount going to the validators
2023-01-17 13:55:58 +01:00
}
struct ProofConfig {
2025-03-06 15:14:15 +01:00
Duration period ; // proofs requirements are calculated per period (in seconds)
Duration timeout ; // mark proofs as missing before the timeout (in seconds)
2023-01-17 13:55:58 +01:00
uint8 downtime ; // ignore this much recent blocks for proof requirements
2024-08-14 07:50:32 +02:00
// Ensures the pointer does not remain in downtime for many consecutive
// periods. For each period increase, move the pointer `pointerProduct`
// blocks. Should be a prime number to ensure there are no cycles.
uint8 downtimeProduct ;
2025-02-20 06:54:41 +01:00
string zkeyHash ; // hash of the zkey file which is linked to the verifier
2023-01-17 13:55:58 +01:00
}
2024-10-03 11:01:21 +10:00
struct SlotReservationsConfig {
// Number of allowed reservations per slot
uint8 maxReservations ;
}