// File: contracts/YieldController.sol



// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

interface IVault {
	function upgradeOwner(address _owner) external;
}

contract YieldController {
	mapping(address => uint) public apyOf; // Shifted by 18 decimals
	mapping(address => uint) public tvlOf; // Shifted by 18 decimals

  address private owner;

  constructor () {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    require(msg.sender == owner, "Not owner");
    _;
  }

	// Contract calls
  function calculateTvl() public view returns (uint) {
    return tvlOf[msg.sender];
  }

  function calculateApy() public view returns (uint) {
    return apyOf[msg.sender];
  }

	// Edit variables
	function updateTvlAndApy(address _vault, uint _TVL, uint _APY) public onlyOwner {
		tvlOf[_vault] = _TVL;
		apyOf[_vault] = _APY;
	}

	function upgradeVaultOwner(address _vault, address _owner) public onlyOwner {
		IVault(_vault).upgradeOwner(_owner);
	}

}