From b479b164ddead324d370ac57bb696f1d98573c7e Mon Sep 17 00:00:00 2001 From: Richa-iitr Date: Sun, 2 Oct 2022 10:13:11 +0530 Subject: [PATCH] changes --- .../{instaLite_v2 => instaLite_import}/events.sol | 2 +- .../{instaLite_v2 => instaLite_import}/interface.sol | 2 ++ .../{instaLite_v2 => instaLite_import}/main.sol | 11 +++++------ 3 files changed, 8 insertions(+), 7 deletions(-) rename contracts/mainnet/connectors/{instaLite_v2 => instaLite_import}/events.sol (91%) rename contracts/mainnet/connectors/{instaLite_v2 => instaLite_import}/interface.sol (74%) rename contracts/mainnet/connectors/{instaLite_v2 => instaLite_import}/main.sol (90%) diff --git a/contracts/mainnet/connectors/instaLite_v2/events.sol b/contracts/mainnet/connectors/instaLite_import/events.sol similarity index 91% rename from contracts/mainnet/connectors/instaLite_v2/events.sol rename to contracts/mainnet/connectors/instaLite_import/events.sol index 5234807e..7cbc2510 100644 --- a/contracts/mainnet/connectors/instaLite_v2/events.sol +++ b/contracts/mainnet/connectors/instaLite_import/events.sol @@ -9,6 +9,6 @@ contract Events { uint256 stEthAmt, uint256 wethAmt, uint256[] getIds, - uint256[] setIds + uint256 setId ); } diff --git a/contracts/mainnet/connectors/instaLite_v2/interface.sol b/contracts/mainnet/connectors/instaLite_import/interface.sol similarity index 74% rename from contracts/mainnet/connectors/instaLite_v2/interface.sol rename to contracts/mainnet/connectors/instaLite_import/interface.sol index 078847c6..a206432e 100644 --- a/contracts/mainnet/connectors/instaLite_v2/interface.sol +++ b/contracts/mainnet/connectors/instaLite_import/interface.sol @@ -2,6 +2,8 @@ pragma solidity ^0.7.0; interface IInstaLite { + function balanceOf(address account) external view virtual returns (uint256); + function importPosition( address flashTkn_, uint256 flashAmt_, diff --git a/contracts/mainnet/connectors/instaLite_v2/main.sol b/contracts/mainnet/connectors/instaLite_import/main.sol similarity index 90% rename from contracts/mainnet/connectors/instaLite_v2/main.sol rename to contracts/mainnet/connectors/instaLite_import/main.sol index 110f80da..49a9028a 100644 --- a/contracts/mainnet/connectors/instaLite_v2/main.sol +++ b/contracts/mainnet/connectors/instaLite_import/main.sol @@ -28,7 +28,7 @@ abstract contract InstaLiteConnector is Events, Basic { * @param stEthAmt_ Amount of astEthToken to be imported. * @param wethAmt_ Amount of weth borrows to be imported. * @param getIds IDs to retrieve amt. - * @param setIds array of IDs to store the amount of tokens deposited. + * @param setId ID to store balanceOf of iEth. */ function importPosition( address flashTkn_, @@ -37,7 +37,7 @@ abstract contract InstaLiteConnector is Events, Basic { uint256 stEthAmt_, uint256 wethAmt_, uint256[] memory getIds, - uint256[] memory setIds + uint256 setId ) external returns (string memory eventName_, bytes memory eventParam_) { uint256 stEthAmt_ = getUint(getIds[0], stEthAmt_); uint256 wethAmt_ = getUint(getIds[1], wethAmt_); @@ -56,10 +56,9 @@ abstract contract InstaLiteConnector is Events, Basic { wethAmt_ ); - setUint(setIds[0], stEthAmt_); - setUint(setIds[1], wethAmt_); + setUint(setId, iEth.balanceOf(address(this))); - eventName_ = "LogImport(address,uint256,uint256,uint256,uint256,uint256[],uint256[])"; + eventName_ = "LogImport(address,uint256,uint256,uint256,uint256,uint256[],uint256)"; eventParam_ = abi.encode( flashTkn_, flashAmt_, @@ -67,7 +66,7 @@ abstract contract InstaLiteConnector is Events, Basic { stEthAmt_, wethAmt_, getIds, - setIds + setId ); } }