From 74dedeb7e2711d6f0f821c524bb298b056cffddd Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 2 Jul 2024 12:30:51 +0200 Subject: [PATCH] feat: add rescuable --- src/contracts/StakeToken.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/contracts/StakeToken.sol b/src/contracts/StakeToken.sol index 0ad8dd5..40eb7c6 100644 --- a/src/contracts/StakeToken.sol +++ b/src/contracts/StakeToken.sol @@ -7,6 +7,7 @@ import {IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/IERC20.sol'; import {SafeCast} from 'openzeppelin-contracts/contracts/utils/math/SafeCast.sol'; import {IERC20Metadata} from 'openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import {IERC20Permit} from 'openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol'; +import {Rescuable} from 'solidity-utils/contracts/utils/Rescuable.sol'; import {ERC20Permit} from './ERC20Permit.sol'; import {AaveDistributionManager} from './AaveDistributionManager.sol'; @@ -17,7 +18,7 @@ import {IAaveDistributionManager} from './IAaveDistributionManager.sol'; import {PercentageMath} from './lib/PercentageMath.sol'; import {DistributionTypes} from './lib/DistributionTypes.sol'; -contract StakeToken is ERC20Permit, AaveDistributionManager, RoleManager, IStakeToken { +contract StakeToken is ERC20Permit, AaveDistributionManager, RoleManager, IStakeToken, Rescuable { using SafeERC20 for IERC20; using PercentageMath for uint256; using SafeCast for uint256; @@ -108,6 +109,10 @@ contract StakeToken is ERC20Permit, AaveDistributionManager, RoleManager, IStake _updateExchangeRate(INITIAL_EXCHANGE_RATE); } + function whoCanRescue() public view override returns (address) { + return getAdmin(SLASH_ADMIN_ROLE); + } + /// @inheritdoc IAaveDistributionManager function configureAssets( DistributionTypes.AssetConfigInput[] memory assetsConfigInput