diff --git a/contracts/mainnet/connectors/eeth/helpers.sol b/contracts/mainnet/connectors/eeth/helpers.sol index a643bb5..4dce4e7 100644 --- a/contracts/mainnet/connectors/eeth/helpers.sol +++ b/contracts/mainnet/connectors/eeth/helpers.sol @@ -4,7 +4,9 @@ pragma solidity 0.8.19; import "./interfaces.sol"; import {TokenInterface} from "../../common/interfaces.sol"; -contract Helpers{ - IEtherfiPool internal constant ETHERFI_POOL = IEtherfiPool(0x308861A430be4cce5502d0A12724771Fc6DaF216); - TokenInterface internal constant WETH_CONTRACT = TokenInterface(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); +contract Helpers { + IEtherfiPool internal constant ETHERFI_POOL = + IEtherfiPool(0x308861A430be4cce5502d0A12724771Fc6DaF216); + TokenInterface internal constant WETH_CONTRACT = + TokenInterface(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); } diff --git a/contracts/mainnet/connectors/eeth/interfaces.sol b/contracts/mainnet/connectors/eeth/interfaces.sol index 2d8c78c..ced7a29 100644 --- a/contracts/mainnet/connectors/eeth/interfaces.sol +++ b/contracts/mainnet/connectors/eeth/interfaces.sol @@ -1,6 +1,6 @@ //SPDX-License-Identifier: MIT pragma solidity 0.8.19; -interface IEtherfiPool{ +interface IEtherfiPool { function deposit() external payable returns (uint256); } diff --git a/contracts/mainnet/connectors/eeth/main.sol b/contracts/mainnet/connectors/eeth/main.sol index 3cec2fd..d07fe87 100644 --- a/contracts/mainnet/connectors/eeth/main.sol +++ b/contracts/mainnet/connectors/eeth/main.sol @@ -9,16 +9,16 @@ contract EETHContract is Helpers, Basic, Events { /** * @dev deposit wETH into Etherfi. * @notice unwrap wETH and stake ETH in Etherfi, users receive eETH tokens on a 1:1 basis representing their staked ETH. - * @param amount The amount of ETH to deposit. (For max: `uint256(-1)`) + * @param wethAmount The amount of wETH to deposit. (For max: `uint256(-1)`) * @param getId ID to retrieve amt. * @param setId ID stores the amount of ETH deposited. */ function depositWeth( - uint256 amount, + uint256 wethAmount, uint256 getId, uint256 setId ) public returns (string memory _eventName, bytes memory _eventParam) { - uint256 _amount = getUint(getId, amount); + uint256 _amount = getUint(getId, wethAmount); _amount = _amount == type(uint256).max ? WETH_CONTRACT.balanceOf(address(this)) : _amount; @@ -27,7 +27,7 @@ contract EETHContract is Helpers, Basic, Events { WETH_CONTRACT.withdraw(_amount); uint256 _ethAfterBalance = address(this).balance; - uint256 _ethAmount = sub(_ethAfterBalance, _ethBeforeBalance); + uint256 _ethAmount = _ethAfterBalance - _ethBeforeBalance; ETHERFI_POOL.deposit{value: _ethAmount}(); setUint(setId, _ethAmount);