mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Removed claim func + fix cETH
This commit is contained in:
parent
0289824465
commit
e22b0bff0c
|
@ -70,10 +70,4 @@ contract Events {
|
|||
uint256 getId,
|
||||
uint256 setId
|
||||
);
|
||||
|
||||
event LogClaimed(
|
||||
address[] tokenAddresses,
|
||||
bool tradeForMorphoToken,
|
||||
uint256 claimedAmount
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,10 +31,6 @@ interface IMorphoCore {
|
|||
address _onBehalf,
|
||||
uint256 _amount
|
||||
) external;
|
||||
|
||||
function claimRewards(address[] calldata _assets, bool _tradeForMorphoToken)
|
||||
external
|
||||
returns (uint256 claimedAmount);
|
||||
}
|
||||
|
||||
interface IMorphoAaveLens {
|
||||
|
|
|
@ -375,33 +375,6 @@ abstract contract MorphoAaveV2 is Helpers, Events {
|
|||
_setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Claim rewards.
|
||||
* @notice Claim rewards for the given assets from underlying protocol.
|
||||
* @param _poolTokenAddresses The assets to claim rewards from (aToken or variable debt token).(For ETH: aToken or variable debt token address of WETH)
|
||||
* @param _tradeForMorphoToken Whether or not to trade reward tokens for MORPHO tokens.
|
||||
*/
|
||||
function claim(
|
||||
address[] calldata _poolTokenAddresses,
|
||||
bool _tradeForMorphoToken
|
||||
)
|
||||
external
|
||||
payable
|
||||
returns (string memory _eventName, bytes memory _eventParam)
|
||||
{
|
||||
uint256 _claimedAmount = MORPHO_AAVE.claimRewards(
|
||||
_poolTokenAddresses,
|
||||
_tradeForMorphoToken
|
||||
);
|
||||
|
||||
_eventName = "LogClaimed(address[],bool,uint256)";
|
||||
_eventParam = abi.encode(
|
||||
_poolTokenAddresses,
|
||||
_tradeForMorphoToken,
|
||||
_claimedAmount
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
contract ConnectV2MorphoAaveV2 is MorphoAaveV2 {
|
||||
|
|
|
@ -70,10 +70,4 @@ contract Events {
|
|||
uint256 getId,
|
||||
uint256 setId
|
||||
);
|
||||
|
||||
event LogClaimed(
|
||||
address[] tokenAddresses,
|
||||
bool tradeForMorphoToken,
|
||||
uint256 amountOfRewards
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,11 +31,6 @@ interface IMorphoCore {
|
|||
address _onBehalf,
|
||||
uint256 _amount
|
||||
) external;
|
||||
|
||||
function claimRewards(
|
||||
address[] calldata _cTokenAddresses,
|
||||
bool _tradeForMorphoToken
|
||||
) external returns (uint256 amountOfRewards);
|
||||
}
|
||||
|
||||
interface IMorphoCompoundLens {
|
||||
|
|
|
@ -9,7 +9,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Deposit ETH/ERC20_Token.
|
||||
* @notice Deposit a token to Morpho Compound for lending / collaterization.
|
||||
* @param _tokenAddress The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cETH address)
|
||||
* @param _amount The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`)
|
||||
* @param _getId ID to retrieve amt.
|
||||
* @param _setId ID stores the amount of tokens deposited.
|
||||
|
@ -50,7 +50,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Deposit ETH/ERC20_Token.
|
||||
* @notice Deposit a token to Morpho Compound for lending / collaterization with max gas.
|
||||
* @param _tokenAddress The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cWETH address).
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cETH address).
|
||||
* @param _amount The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`).
|
||||
* @param _maxGasForMatching The maximum amount of gas to consume within a matching engine loop.
|
||||
* @param _getId ID to retrieve amt.
|
||||
|
@ -99,7 +99,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Deposit ETH/ERC20_Token.
|
||||
* @notice Deposit a token to Morpho Compound for lending / collaterization on behalf of a user.
|
||||
* @param _tokenAddress The address of underlying token to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to deposit.(For ETH: cETH address)
|
||||
* @param _onBehalf The address of user on behalf to deposit.
|
||||
* @param _amount The amount of the token (in underlying) to deposit. (For max: `uint256(-1)`)
|
||||
* @param _getId ID to retrieve amt.
|
||||
|
@ -143,7 +143,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Borrow ETH/ERC20_Token.
|
||||
* @notice Borrow a token from Morpho Compound.
|
||||
* @param _tokenAddress The address of underlying token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to borrow.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to borrow.(For ETH: cETH address)
|
||||
* @param _amount The amount of the token (in underlying) to borrow.
|
||||
* @param _getId ID to retrieve amt.
|
||||
* @param _setId ID stores the amount of tokens borrowed.
|
||||
|
@ -181,7 +181,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Borrow ETH/ERC20_Token.
|
||||
* @notice Borrow a token from Morpho Compound with max gas.
|
||||
* @param _tokenAddress The address of underlying token to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to borrow.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to borrow.(For ETH: cETH address)
|
||||
* @param _amount The amount of the token (in underlying) to borrow.
|
||||
* @param _maxGasForMatching The maximum amount of gas to consume within a matching engine loop.
|
||||
* @param _getId ID to retrieve amt.
|
||||
|
@ -222,7 +222,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Withdraw ETH/ERC20_Token.
|
||||
* @notice Withdraw a token from Morpho Compound.
|
||||
* @param _tokenAddress The address of underlying token to withdraw.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to withdraw.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to withdraw.(For ETH: cETH address)
|
||||
* @param _amount The amount of the token (in underlying) to withdraw. (For max: `uint256(-1)`)
|
||||
* @param _getId ID to retrieve amt.
|
||||
* @param _setId ID stores the amount of tokens withdrawed.
|
||||
|
@ -268,7 +268,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Payback ETH/ERC20_Token.
|
||||
* @notice Payback a token to Morpho Compound.
|
||||
* @param _tokenAddress The address of underlying token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to payback.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to payback.(For ETH: cETH address)
|
||||
* @param _amount The amount of the token (in underlying) to payback. (For max: `uint256(-1)`)
|
||||
* @param _getId ID to retrieve amt.
|
||||
* @param _setId ID stores the amount of tokens paid back.
|
||||
|
@ -324,7 +324,7 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
* @dev Payback ETH/ERC20_Token.
|
||||
* @notice Payback a token to Morpho Compound on behalf of a user.
|
||||
* @param _tokenAddress The address of underlying token to payback.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)
|
||||
* @param _poolTokenAddress The address of cToken to payback.(For ETH: cWETH address)
|
||||
* @param _poolTokenAddress The address of cToken to payback.(For ETH: cETH address)
|
||||
* @param _onBehalf The address of user who's debt to repay.
|
||||
* @param _amount The amount of the token (in underlying) to payback. (For max: `uint256(-1)`)
|
||||
* @param _getId ID to retrieve amt.
|
||||
|
@ -378,33 +378,6 @@ abstract contract MorphoCompound is Helpers, Events {
|
|||
_setId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Claim rewards.
|
||||
* @notice Claim rewards for the given assets from underlying protocol.
|
||||
* @param _poolTokenAddresses The cToken addresses to claim rewards from..(For ETH: cToken address of WETH)
|
||||
* @param _tradeForMorphoToken Whether or not to trade COMP tokens for MORPHO tokens.
|
||||
*/
|
||||
function claim(
|
||||
address[] calldata _poolTokenAddresses,
|
||||
bool _tradeForMorphoToken
|
||||
)
|
||||
external
|
||||
payable
|
||||
returns (string memory _eventName, bytes memory _eventParam)
|
||||
{
|
||||
uint256 _amountOfRewards = MORPHO_COMPOUND.claimRewards(
|
||||
_poolTokenAddresses,
|
||||
_tradeForMorphoToken
|
||||
);
|
||||
|
||||
_eventName = "LogClaimed(address[],bool,uint256)";
|
||||
_eventParam = abi.encode(
|
||||
_poolTokenAddresses,
|
||||
_tradeForMorphoToken,
|
||||
_amountOfRewards
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
contract ConnectV2MorphoCompound is MorphoCompound {
|
||||
|
|
Loading…
Reference in New Issue
Block a user