change constructor param to config

Changes the Marketplace constructor parameter `configuration` to `config` to prevent overshadowing the `configuration()` method.
This commit is contained in:
Mark Spanbroek 2025-02-13 09:34:17 +01:00 committed by markspanbroek
parent 51bae145fc
commit 875e4d53ec

View File

@ -95,28 +95,24 @@ contract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {
} }
constructor( constructor(
MarketplaceConfig memory configuration, MarketplaceConfig memory config,
IERC20 token_, IERC20 token_,
IGroth16Verifier verifier IGroth16Verifier verifier
) ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {
SlotReservations(configuration.reservations)
Proofs(configuration.proofs, verifier)
{
_token = token_; _token = token_;
if (configuration.collateral.repairRewardPercentage > 100) if (config.collateral.repairRewardPercentage > 100)
revert Marketplace_RepairRewardPercentageTooHigh(); revert Marketplace_RepairRewardPercentageTooHigh();
if (configuration.collateral.slashPercentage > 100) if (config.collateral.slashPercentage > 100)
revert Marketplace_SlashPercentageTooHigh(); revert Marketplace_SlashPercentageTooHigh();
if ( if (
configuration.collateral.maxNumberOfSlashes * config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >
configuration.collateral.slashPercentage >
100 100
) { ) {
revert Marketplace_MaximumSlashingTooHigh(); revert Marketplace_MaximumSlashingTooHigh();
} }
_config = configuration; _config = config;
} }
function configuration() public view returns (MarketplaceConfig memory) { function configuration() public view returns (MarketplaceConfig memory) {