Skip to content

Commit

Permalink
feat: Add rescuable to static a token (#29)
Browse files Browse the repository at this point in the history
* feat: Add rescuable to static a token

* Update src/periphery/contracts/static-a-token/StaticATokenLM.sol

---------

Co-authored-by: Lukas <[email protected]>
  • Loading branch information
sendra and sakulstra committed Aug 7, 2024
1 parent 97356e3 commit d092425
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/periphery/contracts/static-a-token/StaticATokenLM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol';
import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol';
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
import {IERC20WithPermit} from 'solidity-utils/contracts/oz-common/interfaces/IERC20WithPermit.sol';
import {Rescuable} from 'solidity-utils/contracts/utils/Rescuable.sol';

import {IStaticATokenLM} from './interfaces/IStaticATokenLM.sol';
import {IAToken} from './interfaces/IAToken.sol';
Expand All @@ -32,7 +33,8 @@ contract StaticATokenLM is
Initializable,
ERC20('STATIC__aToken_IMPL', 'STATIC__aToken_IMPL', 18),
IStaticATokenLM,
IERC4626
IERC4626,
Rescuable
{
using SafeERC20 for IERC20;
using SafeCast for uint256;
Expand All @@ -48,7 +50,7 @@ contract StaticATokenLM is
'Withdraw(address owner,address receiver,uint256 shares,uint256 assets,bool withdrawFromAave,uint256 nonce,uint256 deadline)'
);

uint256 public constant STATIC__ATOKEN_LM_REVISION = 2;
uint256 public constant STATIC__ATOKEN_LM_REVISION = 3;

IPool public immutable POOL;
IRewardsController public immutable INCENTIVES_CONTROLLER;
Expand Down Expand Up @@ -87,6 +89,11 @@ contract StaticATokenLM is
emit Initialized(newAToken, staticATokenName, staticATokenSymbol);
}

/// @inheritdoc IRescuable
function whoCanRescue() public view override returns (address) {
return POOL.ADDRESSES_PROVIDER().getACLAdmin();
}

///@inheritdoc IStaticATokenLM
function refreshRewardTokens() public override {
address[] memory rewards = INCENTIVES_CONTROLLER.getRewardsByAsset(address(_aToken));
Expand Down

0 comments on commit d092425

Please sign in to comment.