change constructor param to config

Changes the Marketplace constructor parameter `configuration` to `config` to prevent overshadowing the `configuration()` method.
This commit is contained in:
Eric 2024-11-26 13:49:45 +11:00
parent c970c632b8
commit 5e334eee4e
No known key found for this signature in database

View File

@ -62,30 +62,30 @@ contract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {
} }
constructor( constructor(
MarketplaceConfig memory configuration, MarketplaceConfig memory config,
IERC20 token_, IERC20 token_,
IGroth16Verifier verifier IGroth16Verifier verifier
) )
SlotReservations(configuration.reservations) SlotReservations(config.reservations)
Proofs(configuration.proofs, verifier) Proofs(config.proofs, verifier)
{ {
_token = token_; _token = token_;
require( require(
configuration.collateral.repairRewardPercentage <= 100, config.collateral.repairRewardPercentage <= 100,
"Must be less than 100" "Must be less than 100"
); );
require( require(
configuration.collateral.slashPercentage <= 100, config.collateral.slashPercentage <= 100,
"Must be less than 100" "Must be less than 100"
); );
require( require(
configuration.collateral.maxNumberOfSlashes * config.collateral.maxNumberOfSlashes *
configuration.collateral.slashPercentage <= config.collateral.slashPercentage <=
100, 100,
"Maximum slashing exceeds 100%" "Maximum slashing exceeds 100%"
); );
_config = configuration; _config = config;
} }
function configuration() public view returns (MarketplaceConfig memory) { function configuration() public view returns (MarketplaceConfig memory) {