mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
👷 Update after review
This commit is contained in:
parent
90b0a62f47
commit
bc80d780ec
|
@ -14,14 +14,12 @@ abstract contract YearnResolver is Events, Basic {
|
|||
/**
|
||||
* @dev Deposit funds in the vault, issuing shares to recipient.
|
||||
* @notice This will deposit funds to a specific Yearn Vault.
|
||||
* @param token The address of the token to deposit.
|
||||
* @param vault The address of the vault to deposit funds into.
|
||||
* @param amt The amount of tokens to deposit.
|
||||
* @param getId ID to retrieve amt.
|
||||
* @param setId ID stores the amount of shares received.
|
||||
*/
|
||||
function deposit(
|
||||
address token,
|
||||
address vault,
|
||||
uint256 amt,
|
||||
uint256 getId,
|
||||
|
@ -31,16 +29,14 @@ abstract contract YearnResolver is Events, Basic {
|
|||
|
||||
YearnV2Interface yearn = YearnV2Interface(vault);
|
||||
|
||||
bool isEth = token == ethAddr;
|
||||
address want = yearn.token();
|
||||
|
||||
bool isEth = want == ethAddr;
|
||||
TokenInterface tokenContract = TokenInterface(want);
|
||||
|
||||
if (isEth && want == wethAddr) {
|
||||
if (isEth) {
|
||||
_amt = _amt == uint(-1) ? address(this).balance : _amt;
|
||||
convertEthToWeth(isEth, tokenContract, _amt);
|
||||
} else {
|
||||
require(want == token, "incorrect token");
|
||||
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ describe("Yearn", function () {
|
|||
{
|
||||
connector: connectorName,
|
||||
method: "deposit",
|
||||
args: [tokens.dai.address, DAI_VAULT, amount, 0, setId]
|
||||
args: [DAI_VAULT, amount, 0, setId]
|
||||
},
|
||||
{
|
||||
connector: connectorName,
|
||||
|
@ -124,7 +124,7 @@ describe("Yearn", function () {
|
|||
{
|
||||
connector: connectorName,
|
||||
method: "deposit",
|
||||
args: [tokens.dai.address, DAI_VAULT, amount, 0, setId]
|
||||
args: [DAI_VAULT, amount, 0, setId]
|
||||
}
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user