From 66f3c43a066fa0eda1e02c1defc332823837d0e8 Mon Sep 17 00:00:00 2001 From: ReposCollector Date: Wed, 4 Sep 2024 10:54:53 +0900 Subject: [PATCH] fix [L-02 Redundant code block] --- src/StakingManager.sol | 5 ----- src/eBtcRateProvider.sol | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 src/eBtcRateProvider.sol diff --git a/src/StakingManager.sol b/src/StakingManager.sol index d61252bf..2f714781 100644 --- a/src/StakingManager.sol +++ b/src/StakingManager.sol @@ -411,11 +411,6 @@ contract StakingManager is // Call function in auction contract to re-initiate the bid that won auctionManager.reEnterAuction(_validatorId); - bool isFullStake = (msg.sender != liquidityPoolContract); - if (isFullStake) { - _refundDeposit(msg.sender, stakeAmount); - } - emit DepositCancelled(_validatorId); } diff --git a/src/eBtcRateProvider.sol b/src/eBtcRateProvider.sol new file mode 100644 index 00000000..ac5cc9e7 --- /dev/null +++ b/src/eBtcRateProvider.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +interface IRateProvider { + function getRate() external view returns (uint256); + function getRateSafe() external view returns (uint256 rate); + function decimals() external view returns (uint8); +} + +contract eBtcRateProvider is IRateProvider { + IRateProvider public rateProvier = IRateProvider(0x1b293DC39F94157fA0D1D36d7e0090C8B8B8c13F); + + function getRate() external view returns (uint256) { + return rateProvier.getRate() * 1e10; + } + + function getRateSafe() external view returns (uint256 rate) { + return rateProvier.getRateSafe() * 1e10; + } + + function decimals() external view returns (uint8) { + return rateProvier.decimals() + 10; + } +} \ No newline at end of file