2020-08-30 18:03:16 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.6.8;
|
|
|
|
|
|
|
|
contract EthRateLogic {
|
|
|
|
address poolToken;
|
2020-09-08 13:19:20 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2020-08-30 18:03:16 +00:00
|
|
|
|
|
|
|
function getTotalToken() public returns (uint) {
|
2020-09-08 13:19:20 +00:00
|
|
|
address _dsa = 0x0000000000000000000000000000000000000000;
|
|
|
|
uint bal = poolToken.balance;
|
|
|
|
bal += getNetDsaAssets(_dsa);
|
2020-08-30 18:03:16 +00:00
|
|
|
return bal;
|
|
|
|
}
|
|
|
|
|
|
|
|
function reduceETH(uint amt) public {
|
|
|
|
payable(address(0)).transfer(amt);
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor (address ethPool) public {
|
|
|
|
poolToken = address(ethPool);
|
|
|
|
}
|
2020-08-31 18:07:54 +00:00
|
|
|
|
|
|
|
receive() external payable {}
|
2020-08-30 18:03:16 +00:00
|
|
|
}
|