From d232ed5c72038305ad9237d9db01544adcc869e6 Mon Sep 17 00:00:00 2001 From: Shriya Tyagi Date: Wed, 4 May 2022 01:38:15 +0400 Subject: [PATCH] Revert "Added depositFrom in Basic" This reverts commit 341004b6f47d77d94c361403b73c053b4147a311. --- contracts/mainnet/connectors/basic/events.sol | 1 - contracts/mainnet/connectors/basic/main.sol | 31 ------------------- 2 files changed, 32 deletions(-) diff --git a/contracts/mainnet/connectors/basic/events.sol b/contracts/mainnet/connectors/basic/events.sol index 14e60147..6ce85a22 100644 --- a/contracts/mainnet/connectors/basic/events.sol +++ b/contracts/mainnet/connectors/basic/events.sol @@ -4,5 +4,4 @@ pragma solidity ^0.7.0; contract Events { event LogDeposit(address indexed erc20, uint256 tokenAmt, uint256 getId, uint256 setId); event LogWithdraw(address indexed erc20, uint256 tokenAmt, address indexed to, uint256 getId, uint256 setId); - event LogDepositFrom(address indexed erc20, uint256 tokenAmt, address indexed from, uint256 getId, uint256 setId); } diff --git a/contracts/mainnet/connectors/basic/main.sol b/contracts/mainnet/connectors/basic/main.sol index b08e17bd..383de493 100644 --- a/contracts/mainnet/connectors/basic/main.sol +++ b/contracts/mainnet/connectors/basic/main.sol @@ -45,37 +45,6 @@ abstract contract BasicResolver is Events, DSMath, Basic { _eventParam = abi.encode(token, _amt, getId, setId); } - /** - * @dev Deposit Assets To Smart Account From any user. - * @notice Deposit a token to DSA from any user. - * @param token The address of the token to deposit.
(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE and need to pass `value` parameter equal to `amt` in cast function ```dsa.cast({..., value: amt})```.
For ERC20: Need to give allowance prior casting spells.) - * @param amt The amount of tokens to deposit. (For max: `uint256(-1)` (Not valid for ETH)) - * @param from The address depositing the token. - * @param getId ID to retrieve amt. - * @param setId ID stores the amount of tokens deposited. - */ - function depositFrom( - address token, - uint256 amt, - address from, - uint256 getId, - uint256 setId - ) public payable returns (string memory _eventName, bytes memory _eventParam) { - uint _amt = getUint(getId, amt); - if (token != ethAddr) { - IERC20 tokenContract = IERC20(token); - _amt = _amt == uint(-1) ? tokenContract.balanceOf(from) : _amt; - tokenContract.safeTransferFrom(from, address(this), _amt); - } else { - require(msg.value == _amt || _amt == uint(-1), "invalid-ether-amount"); - _amt = msg.value; - } - setUint(setId, _amt); - - _eventName = "LogDepositFrom(address,uint256,address,uint256,uint256)"; - _eventParam = abi.encode(token, _amt, from, getId, setId); - } - /** * @dev Withdraw Assets from Smart Account * @notice Withdraw a token from DSA