sub-acc transfers updated

This commit is contained in:
Shriya Tyagi 2022-08-07 03:40:43 +08:00
parent c62c31a62f
commit 2db101a792
2 changed files with 6 additions and 4 deletions

View File

@ -36,7 +36,7 @@ interface IEulerEToken {
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
@ -55,7 +55,7 @@ interface IEulerDToken {
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint amount) external returns (bool);
function approveDebt(
uint256 subAccountId,

View File

@ -305,9 +305,10 @@ abstract contract Euler is Helpers {
if (isEth) convertEthToWeth(isEth, TokenInterface(_token), _amt);
address _subAccountFromAddr = getSubAccount(address(this), subAccountFrom);
address _subAccountToAddr = getSubAccount(address(this), subAccountTo);
eToken.transfer(_subAccountToAddr, _amt);
eToken.transferFrom(_subAccountFromAddr, _subAccountToAddr, _amt);
setUint(setId, _amt);
@ -357,8 +358,9 @@ abstract contract Euler is Helpers {
if (isEth) convertEthToWeth(isEth, TokenInterface(_token), _amt);
address _subAccountFromAddr = getSubAccount(address(this), subAccountFrom);
address _subAccountToAddr = getSubAccount(address(this), subAccountTo);
dToken.transfer(_subAccountToAddr, amt);
dToken.transferFrom(_subAccountFromAddr, _subAccountToAddr, _amt);
setUint(setId, _amt);