mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
added defer liquidity and events
This commit is contained in:
parent
bebd120d21
commit
0870b9b83a
16
contracts/mainnet/connectors/euler-import/events.sol
Normal file
16
contracts/mainnet/connectors/euler-import/events.sol
Normal file
|
@ -0,0 +1,16 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.7.0;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
contract Events {
|
||||
event LogEulerImport(
|
||||
address indexed user,
|
||||
uint256 indexed sourceId,
|
||||
uint256 indexed targetId,
|
||||
address[] supplyTokens,
|
||||
address[] borrowTokens,
|
||||
uint256[] supplyAmts,
|
||||
uint256[] borrowAmts,
|
||||
bool[] enterMarket
|
||||
);
|
||||
}
|
|
@ -14,8 +14,9 @@ contract EulerImport is EulerHelpers {
|
|||
)
|
||||
external
|
||||
payable
|
||||
returns (string memory _eventName, bytes memory _eventParam)
|
||||
{
|
||||
_importEuler(userAccount, sourceId, targetId, inputData, enterMarket);
|
||||
(_eventName, _eventParam) = _importEuler(userAccount, sourceId, targetId, inputData, enterMarket);
|
||||
}
|
||||
|
||||
function _importEuler(
|
||||
|
@ -26,6 +27,7 @@ contract EulerImport is EulerHelpers {
|
|||
bool[] memory enterMarket
|
||||
)
|
||||
internal
|
||||
returns (string memory _eventName, bytes memory _eventParam)
|
||||
{
|
||||
require(
|
||||
AccountInterface(address(this)).isAuth(userAccount),
|
||||
|
@ -41,6 +43,8 @@ contract EulerImport is EulerHelpers {
|
|||
|
||||
data = getBorrowAmounts(_sourceAccount, inputData, data);
|
||||
data = getSupplyAmounts(_targetAccount, inputData, data);
|
||||
|
||||
IExec(exec).deferLiquidityCheck(_sourceAccount, bytes(0));
|
||||
|
||||
_TransferEtokens(
|
||||
data._supplyTokens.length,
|
||||
|
@ -60,5 +64,17 @@ contract EulerImport is EulerHelpers {
|
|||
_sourceAccount,
|
||||
_targetAccount
|
||||
);
|
||||
|
||||
_eventName = "LogEulerImport(address,uint256,uint256,address[],address[],uint256[],uint256[],bool[])";
|
||||
_eventParam = abi.encode(
|
||||
userAccount,
|
||||
sourceId,
|
||||
targetId,
|
||||
inputData.supplyTokens,
|
||||
inputData.borrowTokens,
|
||||
data.supplyAmts,
|
||||
data.borrowAmts,
|
||||
enterMarket
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user