Skip to content

Commit

Permalink
Extract required objections count to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch committed Feb 29, 2024
1 parent 5346e0e commit 2556c28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions solidity/contracts/bridge/RedemptionWatchtower.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ contract RedemptionWatchtower is OwnableUpgradeable {
uint8 objectionsCount;
}

/// @notice Number of guardian objections required to veto a redemption request.
uint8 public constant REQUIRED_OBJECTIONS_COUNT = 3;

/// @notice Set of redemption guardians.
mapping(address => bool) public isGuardian;
/// @notice Set of banned redeemer addresses. Banned redeemers cannot
Expand Down Expand Up @@ -312,10 +315,8 @@ contract RedemptionWatchtower is OwnableUpgradeable {

VetoProposal storage veto = vetoProposals[redemptionKey];

uint8 requiredObjectionsCount = 3;

require(
veto.objectionsCount < requiredObjectionsCount,
veto.objectionsCount < REQUIRED_OBJECTIONS_COUNT,
"Redemption request already vetoed"
);

Expand Down Expand Up @@ -367,7 +368,7 @@ contract RedemptionWatchtower is OwnableUpgradeable {
emit ObjectionRaised(redemptionKey, msg.sender);

// If there are enough objections, finalize the veto.
if (veto.objectionsCount == requiredObjectionsCount) {
if (veto.objectionsCount == REQUIRED_OBJECTIONS_COUNT) {
// Calculate the veto penalty fee that will be deducted from the
// final amount that the redeemer can claim after the freeze period.
uint64 penaltyFee = vetoPenaltyFeeDivisor > 0
Expand Down

0 comments on commit 2556c28

Please sign in to comment.