2023-01-17 12:55:58 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2024-01-23 09:24:02 +00:00
|
|
|
pragma solidity 0.8.23;
|
2023-01-17 12:55:58 +00:00
|
|
|
|
|
|
|
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
|
|
|
|
|
|
struct MarketplaceConfig {
|
|
|
|
CollateralConfig collateral;
|
|
|
|
ProofConfig proofs;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct CollateralConfig {
|
2023-03-30 09:11:21 +00:00
|
|
|
/// @dev percentage of remaining collateral slot after it has been freed
|
|
|
|
/// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)
|
|
|
|
/// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,
|
2023-05-25 09:56:04 +00:00
|
|
|
/// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.
|
2023-03-30 09:11:21 +00:00
|
|
|
uint8 repairRewardPercentage;
|
|
|
|
uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value
|
|
|
|
uint16 slashCriterion; // amount of proofs missed that lead to slashing
|
|
|
|
uint8 slashPercentage; // percentage of the collateral that is slashed
|
2023-01-17 12:55:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct ProofConfig {
|
|
|
|
uint256 period; // proofs requirements are calculated per period (in seconds)
|
|
|
|
uint256 timeout; // mark proofs as missing before the timeout (in seconds)
|
|
|
|
uint8 downtime; // ignore this much recent blocks for proof requirements
|
2024-01-30 05:36:27 +00:00
|
|
|
string zkeyHash; // hash of the zkey file which is linked to the verifier
|
2023-01-17 12:55:58 +00:00
|
|
|
}
|