diff --git a/contracts/mainnet/connectors/instaLite/events.sol b/contracts/mainnet/connectors/instaLite/vault1/events.sol similarity index 58% rename from contracts/mainnet/connectors/instaLite/events.sol rename to contracts/mainnet/connectors/instaLite/vault1/events.sol index 5794d77b..e0e79105 100644 --- a/contracts/mainnet/connectors/instaLite/events.sol +++ b/contracts/mainnet/connectors/instaLite/vault1/events.sol @@ -4,10 +4,17 @@ pragma solidity ^0.7.0; contract Events { event LogSupply( address token, + uint256 vTokenAmt, uint256 amt, address to, uint256 getId, uint256 setId ); - event LogWithdraw(uint256 amt, address to, uint256 getId, uint256 setId); + event LogWithdraw( + uint256 amt, + uint256 vTokenAmt, + address to, + uint256 getId, + uint256 setId + ); } diff --git a/contracts/mainnet/connectors/instaLite/helpers.sol b/contracts/mainnet/connectors/instaLite/vault1/helpers.sol similarity index 87% rename from contracts/mainnet/connectors/instaLite/helpers.sol rename to contracts/mainnet/connectors/instaLite/vault1/helpers.sol index 5c0aec28..758093f9 100644 --- a/contracts/mainnet/connectors/instaLite/helpers.sol +++ b/contracts/mainnet/connectors/instaLite/vault1/helpers.sol @@ -1,7 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.7.0; -import { DSMath } from "../../common/math.sol"; import { Basic } from "../../common/basic.sol"; import { instaLiteInterface } from "./interface.sol"; diff --git a/contracts/mainnet/connectors/instaLite/interface.sol b/contracts/mainnet/connectors/instaLite/vault1/interface.sol similarity index 100% rename from contracts/mainnet/connectors/instaLite/interface.sol rename to contracts/mainnet/connectors/instaLite/vault1/interface.sol diff --git a/contracts/mainnet/connectors/instaLite/main.sol b/contracts/mainnet/connectors/instaLite/vault1/main.sol similarity index 75% rename from contracts/mainnet/connectors/instaLite/main.sol rename to contracts/mainnet/connectors/instaLite/vault1/main.sol index 73e4f3f0..ca5828f1 100644 --- a/contracts/mainnet/connectors/instaLite/main.sol +++ b/contracts/mainnet/connectors/instaLite/vault1/main.sol @@ -3,7 +3,7 @@ pragma solidity ^0.7.0; /** * @title InstaLite Connector - * @dev + * @dev Supply and Withdraw */ import { TokenInterface } from "../../common/interfaces.sol"; @@ -12,7 +12,7 @@ import { Basic } from "../../common/basic.sol"; import { Events } from "./events.sol"; import { Helpers } from "./helpers.sol"; -abstract contract Resolver is Events, DSMath, Basic, Helpers { +abstract contract InstaLiteConnector is Events, Basic, Helpers { /** * @dev Supply * @notice Supply eth/weth/stEth tokens into instalite. @@ -35,10 +35,10 @@ abstract contract Resolver is Events, DSMath, Basic, Helpers { { uint256 _amt = getUint(getId, amt); bool isEth = token == ethAddr; - + uint256 vTokenAmt; if (isEth) { _amt = _amt == uint256(-1) ? address(this).balance : _amt; - uint256 vTokenAmt = instaLite.supplyEth{ value: amt }(to); + vTokenAmt = instaLite.supplyEth{ value: amt }(to); } else { TokenInterface tokenContract = TokenInterface(token); @@ -47,13 +47,13 @@ abstract contract Resolver is Events, DSMath, Basic, Helpers { : _amt; approve(tokenContract, address(instaLite), _amt); - uint256 vTokenAmt = instaLite.supply(token, _amt, to); + vTokenAmt = instaLite.supply(token, _amt, to); } setUint(setId, _amt); - _eventName = "LogSupply(address,uint256,address,uint256,uint256)"; - _eventParam = abi.encode(token, _amt, to, getId, setId); + _eventName = "LogSupply(address,uint256,uint256,address,uint256,uint256)"; + _eventParam = abi.encode(token, vTokenAmt, _amt, to, getId, setId); } /** @@ -76,15 +76,15 @@ abstract contract Resolver is Events, DSMath, Basic, Helpers { { uint256 _amt = getUint(getId, amt); - instaLite.withdraw(_amt, to); + unit256 vTokenAmt = instaLite.withdraw(_amt, to); setUint(setId, _amt); - _eventName = "LogWithdraw(uint256,address,uint256,uint256)"; - _eventParam = abi.encode(_amt, to, getId, setId); + _eventName = "LogWithdraw(uint256,uint256,address,uint256,uint256)"; + _eventParam = abi.encode(_amt, vTokenAmt, to, getId, setId); } } -contract ConnectV2InstaLite is Resolver { +contract ConnectV2InstaLiteVault1 is Resolver { string public constant name = "instaLite-v1"; }