Skip to content

Commit

Permalink
change constructor param to config
Browse files Browse the repository at this point in the history
Changes the Marketplace constructor parameter `configuration` to `config` to prevent overshadowing the `configuration()` method.
  • Loading branch information
emizzle committed Nov 26, 2024
1 parent c970c63 commit 5e334ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions contracts/Marketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@ contract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {
}

constructor(
MarketplaceConfig memory configuration,
MarketplaceConfig memory config,
IERC20 token_,
IGroth16Verifier verifier
)
SlotReservations(configuration.reservations)
Proofs(configuration.proofs, verifier)
SlotReservations(config.reservations)
Proofs(config.proofs, verifier)
{
_token = token_;

require(
configuration.collateral.repairRewardPercentage <= 100,
config.collateral.repairRewardPercentage <= 100,
"Must be less than 100"
);
require(
configuration.collateral.slashPercentage <= 100,
config.collateral.slashPercentage <= 100,
"Must be less than 100"
);
require(
configuration.collateral.maxNumberOfSlashes *
configuration.collateral.slashPercentage <=
config.collateral.maxNumberOfSlashes *
config.collateral.slashPercentage <=
100,
"Maximum slashing exceeds 100%"
);
_config = configuration;
_config = config;
}

function configuration() public view returns (MarketplaceConfig memory) {
Expand Down

0 comments on commit 5e334ee

Please sign in to comment.