diff --git a/contracts/Interfaces/Oracles/IXRETHOracle.sol b/contracts/Interfaces/Oracles/IXRETHOracle.sol index a5de1526..b1665971 100644 --- a/contracts/Interfaces/Oracles/IXRETHOracle.sol +++ b/contracts/Interfaces/Oracles/IXRETHOracle.sol @@ -7,7 +7,4 @@ interface IXRETHOracle { /// @return The total value locked in the protocol, in wei, for each minipool + rewards earned. function getTotalYieldAccrued() external view returns (uint); - /// @dev Sets decentralized data provided by the Constellation network's cryptographic fraud proofs. - /// @param yield The total value locked in the protocol, in wei, for each minipool + rewards earned. - function setTotalYieldAccrued(uint yield) external; } diff --git a/contracts/Oracle/XRETHOracle.sol b/contracts/Oracle/XRETHOracle.sol new file mode 100644 index 00000000..6e55ca2a --- /dev/null +++ b/contracts/Oracle/XRETHOracle.sol @@ -0,0 +1,22 @@ +// SPDX License Identifier: GPL v3 + +import '../Interfaces/Oracles/IXRETHOracle.sol'; +import '../UpgradeableBase.sol'; + +pragma solidity 0.8.17; + +contract XRETHOracle is IXRETHOracle, UpgradeableBase { + + address public oracleService; // is gonna be rated + + constructor() initializer {} + + /// @dev Initializes the FundRouter contract with the specified directory address. + /// @param _directoryAddress The address of the directory contract. + function initializeOracleService(address _directoryAddress, address _oracleService) public virtual initializer { + super.initialize(_directoryAddress); + oracleService = _oracleService; + } + + function getTotalYieldAccrued() external view override returns (uint) {} +} diff --git a/contracts/Testing/Mocks/MockRETHOracle.sol b/contracts/Testing/Mocks/MockRETHOracle.sol index bfd3a963..55003637 100644 --- a/contracts/Testing/Mocks/MockRETHOracle.sol +++ b/contracts/Testing/Mocks/MockRETHOracle.sol @@ -7,7 +7,7 @@ contract MockRETHOracle is IXRETHOracle { uint private _yield = 0 ether; - function setTotalYieldAccrued(uint yield) public override { + function setTotalYieldAccrued(uint yield) public { _yield = yield; } diff --git a/gas-report.txt b/gas-report.txt index cda9dbf5..f788704e 100644 --- a/gas-report.txt +++ b/gas-report.txt @@ -17,7 +17,7 @@ ·····························|·························|·············|·············|·············|···············|·············· | AdminTreasury · executeAll · 70871 · 157243 · 100790 · 12 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| AdminTreasury · upgradeTo · 37064 · 49776 · 45517 · 6 · - │ +| AdminTreasury · upgradeTo · 49671 · 49852 · 49780 · 6 · - │ ·····························|·························|·············|·············|·············|···············|·············· | Directory · enableSanctions · - · - · 30872 · 2 · - │ ·····························|·························|·············|·············|·············|···············|·············· @@ -39,7 +39,7 @@ ·····························|·························|·············|·············|·············|···············|·············· | MockSanctions · addBlacklist · - · - · 43876 · 3 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| OperatorDistributor · processNextMinipool · 155466 · 328462 · 224664 · 5 · - │ +| OperatorDistributor · processNextMinipool · 155457 · 328455 · 224656 · 5 · - │ ·····························|·························|·············|·············|·············|···············|·············· | PriceFetcher · useFallback · - · - · 41967 · 2 · - │ ·····························|·························|·············|·············|·············|···············|·············· @@ -71,11 +71,11 @@ ·····························|·························|·············|·············|·············|···············|·············· | RPLVault · claimAdminFee · 116257 · 124657 · 119057 · 6 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| RPLVault · deposit · 118503 · 778096 · 309740 · 15 · - │ +| RPLVault · deposit · 118503 · 779841 · 311454 · 15 · - │ ·····························|·························|·············|·············|·············|···············|·············· | RPLVault · redeem · 239678 · 433614 · 323102 · 6 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| SuperNodeAccount · createMinipool · 2050118 · 2400459 · 2288994 · 17 · - │ +| SuperNodeAccount · createMinipool · 2050166 · 2400507 · 2289042 · 17 · - │ ·····························|·························|·············|·············|·············|···············|·············· | SuperNodeAccount · lazyInitialize · - · - · 589844 · 2 · - │ ·····························|·························|·············|·············|·············|···············|·············· @@ -87,7 +87,7 @@ ·····························|·························|·············|·············|·············|···············|·············· | WETHVault · setRplCoverageRatio · - · - · 44251 · 1 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| WhitelistV2 · addOperator · 367985 · 772083 · 554686 · 33 · - │ +| WhitelistV2 · addOperator · 367985 · 772116 · 554687 · 33 · - │ ·····························|·························|·············|·············|·············|···············|·············· | WhitelistV2 · addOperators · - · - · 760737 · 4 · - │ ·····························|·························|·············|·············|·············|···············|·············· @@ -97,7 +97,7 @@ ·····························|·························|·············|·············|·············|···············|·············· | WhitelistV2 · setOperatorController · 56325 · 58329 · 57884 · 9 · - │ ·····························|·························|·············|·············|·············|···············|·············· -| YieldDistributor · finalizeInterval · 356470 · 552603 · 421848 · 3 · - │ +| YieldDistributor · finalizeInterval · 356437 · 552603 · 421826 · 3 · - │ ·····························|·························|·············|·············|·············|···············|·············· | YieldDistributor · harvest · 301656 · 416965 · 333586 · 14 · - │ ·····························|·························|·············|·············|·············|···············|·············· @@ -109,7 +109,7 @@ ·······················································|·············|·············|·············|···············|·············· | AdminTreasury · - · - · 1533477 · 5.1 % · - │ ·······················································|·············|·············|·············|···············|·············· -| Directory · - · - · 3204769 · 10.7 % · - │ +| Directory · - · - · 3204757 · 10.7 % · - │ ·······················································|·············|·············|·············|···············|·············· | FundRouter · - · - · 2536299 · 8.5 % · - │ ·······················································|·············|·············|·············|···············|·············· @@ -119,17 +119,17 @@ ·······················································|·············|·············|·············|···············|·············· | MockPriceFetcher · - · - · 836716 · 2.8 % · - │ ·······················································|·············|·············|·············|···············|·············· -| MockRETHOracle · - · - · 92827 · 0.3 % · - │ +| MockRETHOracle · - · - · 92815 · 0.3 % · - │ ·······················································|·············|·············|·············|···············|·············· | MockSanctions · - · - · 110685 · 0.4 % · - │ ·······················································|·············|·············|·············|···············|·············· -| MockSuperNodeV2 · - · - · 4111037 · 13.7 % · - │ +| MockSuperNodeV2 · - · - · 4170533 · 13.9 % · - │ ·······················································|·············|·············|·············|···············|·············· | MockTargetAlpha · - · - · 91649 · 0.3 % · - │ ·······················································|·············|·············|·············|···············|·············· | MockUniswapV3Pool · - · - · 131311 · 0.4 % · - │ ·······················································|·············|·············|·············|···············|·············· -| OperatorDistributor · - · - · 3601553 · 12 % · - │ +| OperatorDistributor · - · - · 3601541 · 12 % · - │ ·······················································|·············|·············|·············|···············|·············· | PriceFetcher · - · - · 1313586 · 4.4 % · - │ ·······················································|·············|·············|·············|···············|·············· @@ -283,17 +283,17 @@ ·······················································|·············|·············|·············|···············|·············· | RocketVault · - · - · 1693348 · 5.6 % · - │ ·······················································|·············|·············|·············|···············|·············· -| RPLVault · - · - · 3317251 · 11.1 % · - │ +| RPLVault · - · - · 3360942 · 11.2 % · - │ ·······················································|·············|·············|·············|···············|·············· -| SuperNodeAccount · - · - · 4104379 · 13.7 % · - │ +| SuperNodeAccount · - · - · 4163839 · 13.9 % · - │ ·······················································|·············|·············|·············|···············|·············· | WETH · - · - · 756259 · 2.5 % · - │ ·······················································|·············|·············|·············|···············|·············· -| WETHVault · - · - · 4439860 · 14.8 % · - │ +| WETHVault · - · - · 4453717 · 14.8 % · - │ ·······················································|·············|·············|·············|···············|·············· -| Whitelist · - · - · 2319601 · 7.7 % · - │ +| Whitelist · - · - · 2319169 · 7.7 % · - │ ·······················································|·············|·············|·············|···············|·············· | WhitelistV2 · - · - · 2325848 · 7.8 % · - │ ·······················································|·············|·············|·············|···············|·············· -| YieldDistributor · - · - · 3087208 · 10.3 % · - │ +| YieldDistributor · - · - · 3117932 · 10.4 % · - │ ·------------------------------------------------------|-------------|-------------|-------------|---------------|-------------· \ No newline at end of file diff --git a/test/test-xrEth.ts b/test/test-xrEth.ts index 30d0bd5a..70661579 100644 --- a/test/test-xrEth.ts +++ b/test/test-xrEth.ts @@ -98,7 +98,7 @@ describe("xrETH", function () { const { protocol, signers } = await loadFixture(protocolFixture); const tvlCoverageRatio = ethers.utils.parseEther("0.1542069"); - await expect(protocol.vCWETH.connect(signers.ethWhale).setRplCoverageRatio(tvlCoverageRatio)).to.be.revertedWith("Can only be called by admin address!"); + await expect(protocol.vCWETH.connect(signers.ethWhale).setRplCoverageRatio(tvlCoverageRatio)).to.be.revertedWith("Can only be called by short timelock!"); }); });