removed to param

This commit is contained in:
bhavik-m 2022-04-03 03:31:38 +05:30
parent bf55464ce0
commit 34802d0dc7
3 changed files with 8 additions and 22 deletions

View File

@ -7,7 +7,6 @@ contract Events {
address token,
uint256 vTokenAmt,
uint256 amt,
address to,
uint256 getId,
uint256[] setIds
);
@ -15,7 +14,6 @@ contract Events {
address vaultAddress,
uint256 amt,
uint256 vTokenAmt,
address to,
uint256 getId,
uint256[] setIds
);

View File

@ -18,7 +18,6 @@ abstract contract InstaLiteConnector is Events, Basic {
* @param vaultAddress Address of instaLite Contract.
* @param token The address of token to be supplied.
* @param amt The amount of token to be supplied.
* @param to The address of the account on behalf of you want to supplied.
* @param getId ID to retrieve amt.
* @param setIds ID stores the amount of token deposited.
*/
@ -26,7 +25,6 @@ abstract contract InstaLiteConnector is Events, Basic {
address vaultAddress,
address token,
uint256 amt,
address to,
uint256 getId,
uint256[] memory setIds
)
@ -42,7 +40,7 @@ abstract contract InstaLiteConnector is Events, Basic {
if (isEth) {
_amt = _amt == uint256(-1) ? address(this).balance : _amt;
vTokenAmt = instaLite.supplyEth{ value: amt }(to);
vTokenAmt = instaLite.supplyEth{ value: amt }(address(this));
} else {
TokenInterface tokenContract = TokenInterface(token);
@ -51,19 +49,18 @@ abstract contract InstaLiteConnector is Events, Basic {
: _amt;
approve(tokenContract, vaultAddress, _amt);
vTokenAmt = instaLite.supply(token, _amt, to);
vTokenAmt = instaLite.supply(token, _amt, address(this));
}
setUint(setIds[0], _amt);
setUint(setIds[1], vTokenAmt);
_eventName = "LogSupply(address,address,uint256,uint256,address,uint256,uint256[])";
_eventName = "LogSupply(address,address,uint256,uint256,uint256,uint256[])";
_eventParam = abi.encode(
vaultAddress,
token,
vTokenAmt,
_amt,
to,
getId,
setIds
);
@ -74,14 +71,12 @@ abstract contract InstaLiteConnector is Events, Basic {
* @notice Withdraw eth/stEth tokens from instalite contract.
* @param vaultAddress Address of vaultAddress Contract.
* @param amt The amount of the token to withdraw.
* @param to The address of the account on behalf of you want to withdraw.
* @param getId ID to retrieve amt.
* @param setIds ID stores the amount of token withdrawn.
*/
function withdraw(
address vaultAddress,
uint256 amt,
address to,
uint256 getId,
uint256[] memory setIds
)
@ -93,20 +88,13 @@ abstract contract InstaLiteConnector is Events, Basic {
IInstaLite instaLite = IInstaLite(vaultAddress);
uint256 vTokenAmt = instaLite.withdraw(_amt, to);
uint256 vTokenAmt = instaLite.withdraw(_amt, address(this));
setUint(setIds[0], _amt);
setUint(setIds[1], vTokenAmt);
_eventName = "LogWithdraw(address,uint256,uint256,address,uint256,uint256[])";
_eventParam = abi.encode(
vaultAddress,
_amt,
vTokenAmt,
to,
getId,
setIds
);
_eventName = "LogWithdraw(address,uint256,uint256,uint256,uint256[])";
_eventParam = abi.encode(vaultAddress, _amt, vTokenAmt, getId, setIds);
}
}

View File

@ -77,7 +77,7 @@ describe("instaLite", function () {
{
connector: connectorName,
method: "supply",
args: [ethAddr, _amt, dsaWallet0.address, "0xc383a3833a87009fd9597f8184979af5edfad019", 0, [0, 0]]
args: ["0xc383a3833a87009fd9597f8184979af5edfad019", ethAddr, _amt, 0, [0, 0]]
}
];
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), await wallet1.getAddress());
@ -91,7 +91,7 @@ describe("instaLite", function () {
{
connector: connectorName,
method: "withdraw",
args: [_amt, dsaWallet0.address, "0xc383a3833a87009fd9597f8184979af5edfad019", 0, [0, 0]]
args: ["0xc383a3833a87009fd9597f8184979af5edfad019", _amt, 0, [0, 0]]
}
];
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), await wallet1.getAddress());