From c901d97fa8e8bfe83a35bc66408e59939434d26d Mon Sep 17 00:00:00 2001 From: Samyak Jain <34437877+KaymasJain@users.noreply.github.com> Date: Tue, 8 Sep 2020 23:23:30 +1000 Subject: [PATCH] shifted eth logic to new folder --- contracts/logics/ethLogic.sol | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 contracts/logics/ethLogic.sol diff --git a/contracts/logics/ethLogic.sol b/contracts/logics/ethLogic.sol new file mode 100644 index 0000000..c0b4c5b --- /dev/null +++ b/contracts/logics/ethLogic.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.6.8; + +contract EthRateLogic { + address poolToken; + + function getCompoundNetAssetsInEth(address _dsa) private returns (uint _netBal) { + // Logics + // Take price from Compound's Oracle? + } + + function getCurveNetAssetsInEth(address _dsa) private returns (uint _netBal) { + // Logics + // Take price from ChainLink's Oracle? + } + + function getNetDsaAssets(address _dsa) private returns (uint _netBal) { + _netBal = _dsa.balance; + _netBal += getCompoundNetAssetsInEth(_dsa); + _netBal += getCurveNetAssetsInEth(_dsa); + } + + function getTotalToken() public returns (uint) { + address _dsa = 0x0000000000000000000000000000000000000000; + uint bal = poolToken.balance; + bal += getNetDsaAssets(_dsa); + return bal; + } + + function reduceETH(uint amt) public { + payable(address(0)).transfer(amt); + } + + constructor (address ethPool) public { + poolToken = address(ethPool); + } + + receive() external payable {} +} \ No newline at end of file