Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/contracts/SafetyNet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ contract SafetyNet is ISafetyNet, ReentrancyGuard, OwnableUpgradeable {

emit WithdrawalContested(_requestId, _request.owner, block.timestamp);

// Check if consensus on contestation has been reached after this contestation
if (_request.contestCount > memberCount * threshold / PERCENTAGE_BASE) {
// Multiply contestCount by PERCENTAGE_BASE instead of dividing the
// right-hand side, so integer truncation cannot lower the threshold.
if (_request.contestCount * PERCENTAGE_BASE > memberCount * threshold) {
isVetoed[_requestId] = true;
// Vetoed because more than contestThreshold% of the members have contested
emit WithdrawalVetoed(_requestId, _request.owner, block.timestamp);
Expand Down Expand Up @@ -554,7 +555,7 @@ contract SafetyNet is ISafetyNet, ReentrancyGuard, OwnableUpgradeable {

/// @dev Deducts `_amount` from a member’s withdrawable balance and the Safety Net’s total balance.
/// Reverts with `NotWithdrawable` if balance is insufficient.
function _deduct(uint256 _safetyNetId, address _member, uint256 _amount) private {
function _deduct(uint256 _safetyNetId, address _member, uint256 _amount) internal {
if (memberWithdrawableBalance[_safetyNetId][_member] < _amount) {
revert NotWithdrawable();
}
Expand Down
Empty file removed src/contracts/modification.txt
Empty file.
4 changes: 2 additions & 2 deletions src/interfaces/ISafetyNet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ interface ISafetyNet {
/// @notice Thrown when trying to create a duplicate Safety Net
error AlreadyExists();

/// @notice Thrown when a user is trying to contest a request that he has already contested
/// @notice Thrown when a member is trying to contest a request that they have already contested
error AlreadyContestedByMember();

/// @notice Thrown when the Safety Net ID is not found
Expand Down Expand Up @@ -214,7 +214,7 @@ interface ISafetyNet {
/// @notice Thrown when epoch duration is invalid
error InvalidEpochDuration();

/// @notice Thrown when redeemeRatio is out of valid range
/// @notice Thrown when redeemRatio is out of valid range
error InvalidRatio();

/// @notice Thrown when small withdraws limit is invalid
Expand Down