mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
removed to param
This commit is contained in:
parent
bf55464ce0
commit
34802d0dc7
|
@ -7,7 +7,6 @@ contract Events {
|
||||||
address token,
|
address token,
|
||||||
uint256 vTokenAmt,
|
uint256 vTokenAmt,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
address to,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256[] setIds
|
uint256[] setIds
|
||||||
);
|
);
|
||||||
|
@ -15,7 +14,6 @@ contract Events {
|
||||||
address vaultAddress,
|
address vaultAddress,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
uint256 vTokenAmt,
|
uint256 vTokenAmt,
|
||||||
address to,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256[] setIds
|
uint256[] setIds
|
||||||
);
|
);
|
||||||
|
|
|
@ -18,7 +18,6 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
* @param vaultAddress Address of instaLite Contract.
|
* @param vaultAddress Address of instaLite Contract.
|
||||||
* @param token The address of token to be supplied.
|
* @param token The address of token to be supplied.
|
||||||
* @param amt The amount 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 getId ID to retrieve amt.
|
||||||
* @param setIds ID stores the amount of token deposited.
|
* @param setIds ID stores the amount of token deposited.
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +25,6 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
address vaultAddress,
|
address vaultAddress,
|
||||||
address token,
|
address token,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
address to,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256[] memory setIds
|
uint256[] memory setIds
|
||||||
)
|
)
|
||||||
|
@ -42,7 +40,7 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
|
|
||||||
if (isEth) {
|
if (isEth) {
|
||||||
_amt = _amt == uint256(-1) ? address(this).balance : _amt;
|
_amt = _amt == uint256(-1) ? address(this).balance : _amt;
|
||||||
vTokenAmt = instaLite.supplyEth{ value: amt }(to);
|
vTokenAmt = instaLite.supplyEth{ value: amt }(address(this));
|
||||||
} else {
|
} else {
|
||||||
TokenInterface tokenContract = TokenInterface(token);
|
TokenInterface tokenContract = TokenInterface(token);
|
||||||
|
|
||||||
|
@ -51,19 +49,18 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
: _amt;
|
: _amt;
|
||||||
|
|
||||||
approve(tokenContract, vaultAddress, _amt);
|
approve(tokenContract, vaultAddress, _amt);
|
||||||
vTokenAmt = instaLite.supply(token, _amt, to);
|
vTokenAmt = instaLite.supply(token, _amt, address(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
setUint(setIds[0], _amt);
|
setUint(setIds[0], _amt);
|
||||||
setUint(setIds[1], vTokenAmt);
|
setUint(setIds[1], vTokenAmt);
|
||||||
|
|
||||||
_eventName = "LogSupply(address,address,uint256,uint256,address,uint256,uint256[])";
|
_eventName = "LogSupply(address,address,uint256,uint256,uint256,uint256[])";
|
||||||
_eventParam = abi.encode(
|
_eventParam = abi.encode(
|
||||||
vaultAddress,
|
vaultAddress,
|
||||||
token,
|
token,
|
||||||
vTokenAmt,
|
vTokenAmt,
|
||||||
_amt,
|
_amt,
|
||||||
to,
|
|
||||||
getId,
|
getId,
|
||||||
setIds
|
setIds
|
||||||
);
|
);
|
||||||
|
@ -74,14 +71,12 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
* @notice Withdraw eth/stEth tokens from instalite contract.
|
* @notice Withdraw eth/stEth tokens from instalite contract.
|
||||||
* @param vaultAddress Address of vaultAddress Contract.
|
* @param vaultAddress Address of vaultAddress Contract.
|
||||||
* @param amt The amount of the token to withdraw.
|
* @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 getId ID to retrieve amt.
|
||||||
* @param setIds ID stores the amount of token withdrawn.
|
* @param setIds ID stores the amount of token withdrawn.
|
||||||
*/
|
*/
|
||||||
function withdraw(
|
function withdraw(
|
||||||
address vaultAddress,
|
address vaultAddress,
|
||||||
uint256 amt,
|
uint256 amt,
|
||||||
address to,
|
|
||||||
uint256 getId,
|
uint256 getId,
|
||||||
uint256[] memory setIds
|
uint256[] memory setIds
|
||||||
)
|
)
|
||||||
|
@ -93,20 +88,13 @@ abstract contract InstaLiteConnector is Events, Basic {
|
||||||
|
|
||||||
IInstaLite instaLite = IInstaLite(vaultAddress);
|
IInstaLite instaLite = IInstaLite(vaultAddress);
|
||||||
|
|
||||||
uint256 vTokenAmt = instaLite.withdraw(_amt, to);
|
uint256 vTokenAmt = instaLite.withdraw(_amt, address(this));
|
||||||
|
|
||||||
setUint(setIds[0], _amt);
|
setUint(setIds[0], _amt);
|
||||||
setUint(setIds[1], vTokenAmt);
|
setUint(setIds[1], vTokenAmt);
|
||||||
|
|
||||||
_eventName = "LogWithdraw(address,uint256,uint256,address,uint256,uint256[])";
|
_eventName = "LogWithdraw(address,uint256,uint256,uint256,uint256[])";
|
||||||
_eventParam = abi.encode(
|
_eventParam = abi.encode(vaultAddress, _amt, vTokenAmt, getId, setIds);
|
||||||
vaultAddress,
|
|
||||||
_amt,
|
|
||||||
vTokenAmt,
|
|
||||||
to,
|
|
||||||
getId,
|
|
||||||
setIds
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ describe("instaLite", function () {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "supply",
|
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());
|
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), await wallet1.getAddress());
|
||||||
|
@ -91,7 +91,7 @@ describe("instaLite", function () {
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
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());
|
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), await wallet1.getAddress());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user