Skip to content

Commit 1d4b9db

Browse files
committed
fix: slither warnings
1 parent ef05fb8 commit 1d4b9db

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

contracts/interfaces/ICollateralManagement.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ interface ICollateralManagement {
3030
address punisher,
3131
Quotes.PegInQuote calldata quote,
3232
bytes32 quoteHash
33-
) external returns (uint256);
33+
) external;
3434
function addPegOutCollateralTo(address addr) external payable;
3535
function addPegOutCollateral() external payable;
3636
function slashPegOutCollateral(
3737
address punisher,
3838
Quotes.PegOutQuote calldata quote,
3939
bytes32 quoteHash
40-
) external returns (uint256);
40+
) external;
4141

4242
function getPegInCollateral(address addr) external view returns (uint256);
4343
function getPegOutCollateral(address addr) external view returns (uint256);

contracts/split/CollateralManagement.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ contract CollateralManagementContract is
9595
address punisher,
9696
Quotes.PegInQuote calldata quote,
9797
bytes32 quoteHash
98-
) external onlyRole(COLLATERAL_SLASHER) returns (uint256) {
98+
) external onlyRole(COLLATERAL_SLASHER) {
9999
uint penalty = _min(
100100
quote.penaltyFee,
101101
_pegInCollateral[quote.liquidityProviderRskAddress]
@@ -104,7 +104,6 @@ contract CollateralManagementContract is
104104
uint256 punisherReward = (penalty * rewardPercentage) / 100;
105105
_rewards[punisher] += punisherReward;
106106
emit Penalized(quote.liquidityProviderRskAddress, quoteHash, Flyover.ProviderType.PegIn, penalty, punisherReward);
107-
return penalty;
108107
}
109108

110109
function addPegOutCollateralTo(address addr) external onlyRole(COLLATERAL_ADDER) payable {
@@ -119,7 +118,7 @@ contract CollateralManagementContract is
119118
address punisher,
120119
Quotes.PegOutQuote calldata quote,
121120
bytes32 quoteHash
122-
) external onlyRole(COLLATERAL_SLASHER) returns (uint256) {
121+
) external onlyRole(COLLATERAL_SLASHER) {
123122
uint penalty = _min(
124123
quote.penaltyFee,
125124
_pegOutCollateral[quote.lpRskAddress]
@@ -128,7 +127,6 @@ contract CollateralManagementContract is
128127
uint256 punisherReward = (penalty * rewardPercentage) / 100;
129128
_rewards[punisher] += punisherReward;
130129
emit Penalized(quote.lpRskAddress, quoteHash, Flyover.ProviderType.PegOut, penalty, punisherReward);
131-
return penalty;
132130
}
133131

134132
function getMinCollateral() external view returns (uint) {

contracts/split/FlyoverDiscoveryFull.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ contract FlyoverDiscoveryFull is
6464
address owner,
6565
uint48 initialDelay,
6666
uint minCollateral,
67-
uint resignDelayInBlocks
67+
uint resignDelayInBlocks,
68+
uint rewardPercentage_
6869
) public initializer {
6970
__AccessControlDefaultAdminRules_init(initialDelay, owner);
7071
__ReentrancyGuard_init();
7172
_minCollateral = minCollateral;
7273
_resignDelayInBlocks = resignDelayInBlocks;
74+
rewardPercentage = rewardPercentage_;
7375
}
7476

7577
function register(
@@ -336,7 +338,7 @@ contract FlyoverDiscoveryFull is
336338
address punisher,
337339
Quotes.PegInQuote calldata quote,
338340
bytes32 quoteHash
339-
) external onlyRole(COLLATERAL_SLASHER) returns(uint256) {
341+
) external onlyRole(COLLATERAL_SLASHER) {
340342
uint penalty = _min(
341343
quote.penaltyFee,
342344
_pegInCollateral[quote.liquidityProviderRskAddress]
@@ -345,14 +347,13 @@ contract FlyoverDiscoveryFull is
345347
uint256 punisherReward = (penalty * rewardPercentage) / 100;
346348
_rewards[punisher] += punisherReward;
347349
emit Penalized(quote.liquidityProviderRskAddress, quoteHash, Flyover.ProviderType.PegIn, penalty, punisherReward);
348-
return penalty;
349350
}
350351

351352
function slashPegOutCollateral(
352353
address punisher,
353354
Quotes.PegOutQuote calldata quote,
354355
bytes32 quoteHash
355-
) external onlyRole(COLLATERAL_SLASHER) returns (uint256) {
356+
) external onlyRole(COLLATERAL_SLASHER) {
356357
uint penalty = _min(
357358
quote.penaltyFee,
358359
_pegOutCollateral[quote.lpRskAddress]
@@ -361,7 +362,6 @@ contract FlyoverDiscoveryFull is
361362
uint256 punisherReward = (penalty * rewardPercentage) / 100;
362363
_rewards[punisher] += punisherReward;
363364
emit Penalized(quote.lpRskAddress, quoteHash, Flyover.ProviderType.PegOut, penalty, punisherReward);
364-
return penalty;
365365
}
366366

367367
function _min(uint a, uint b) private pure returns (uint) {

0 commit comments

Comments
 (0)