-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLybraDLPStakePool.sol
42 lines (32 loc) · 1 KB
/
LybraDLPStakePool.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./Interfaces/ILybraProxy.sol";
import "./RewardPoolUpg.sol";
contract LybraDLPStakePool is RewardPoolUpg {
using SafeERC20 for IERC20;
ILybraProxy public lybraProxy;
address public eLBR;
function initialize(
address _ethlbrLp,
address _lybraProxy,
address _eLBR
) public initializer {
__RewardPool_init(_ethlbrLp);
lybraProxy = ILybraProxy(_lybraProxy);
eLBR = _eLBR;
_addRewardToken(_eLBR);
stakingToken.safeApprove(_lybraProxy, type(uint256).max);
}
function _stake(address, uint256 _amount) internal override {
lybraProxy.stakeEthLbrLp(_amount);
}
function _withdraw(address, uint256 _amount) internal override {
lybraProxy.withdrawEthLbrLp(_amount);
}
function _beforeUpdateReward(address) internal override {
harvest();
}
function harvest() public {
lybraProxy.getEthLbrStakePoolRewards();
}
}