tornado-aggregator/contracts/Aggregator.sol

39 lines
981 B
Solidity
Raw Normal View History

2020-10-07 15:05:34 +02:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "./GovernanceAggregator.sol";
import "./PriceAggregator.sol";
import "./SwapAggregator.sol";
2020-10-08 11:06:43 +02:00
import "./MinerAggregator.sol";
2020-11-04 18:42:54 +01:00
import "torn-token/contracts/ENS.sol";
2020-10-07 15:05:34 +02:00
2020-11-04 18:42:54 +01:00
contract Aggregator is EnsResolve, GovernanceAggregator, PriceAggregator, SwapAggregator, MinerAggregator {
2020-10-08 11:06:43 +02:00
function miningData(
Miner miner,
address[] calldata instances,
RewardSwap swap
)
external
view
returns (
uint256[] memory _rates,
uint256 balance,
uint256 poolWeight
)
{
_rates = minerRates(miner, instances);
(balance, poolWeight) = swapState(swap);
}
function marketData(
address[] calldata fromTokens,
uint256[] calldata oneUnitAmounts,
RewardSwap swap
) external view returns (uint256[] memory prices, uint256 balance) {
prices = getPricesInETH(fromTokens, oneUnitAmounts);
balance = swap.tornVirtualBalance();
}
}