mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
shifted eth logic to new folder
This commit is contained in:
parent
4cfe052bd4
commit
c901d97fa8
39
contracts/logics/ethLogic.sol
Normal file
39
contracts/logics/ethLogic.sol
Normal file
|
@ -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 {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user