From 3902bd218c70d44d06cbe361e6fd146fd8314350 Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Tue, 24 Sep 2024 15:08:15 +0100 Subject: [PATCH 1/2] chore: updates from the lido-dao main branch --- contracts/COMPILERS.md | 9 +-------- .../common/interfaces/IGateSealFactory.sol | 20 +++++++++++++++++++ .../AccountingOracle__MockForLegacyOracle.sol | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 contracts/common/interfaces/IGateSealFactory.sol diff --git a/contracts/COMPILERS.md b/contracts/COMPILERS.md index 6d1825937..bd07c67ee 100644 --- a/contracts/COMPILERS.md +++ b/contracts/COMPILERS.md @@ -2,17 +2,10 @@ For Lido project coordination, governance and funds management we use [Aragon](https://aragon.org/dao), a well-developed and proven DAO Framework. The current stable release of its Kernel, [4.4.0](https://github.com/aragon/aragonOS/tree/v4.4.0) is fixed on the specific compiler version - [solc 0.4.24](https://solidity.readthedocs.io/en/v0.4.24/), that is currently outdated. Keeping security and consistency in mind, we decided to stay on an older yet proven combination - for all the contracts under Aragon management (`Lido`, `stETH`, `LegacyOracle`) we use solc 0.4.24 release. -cstETH token, that acts as autonomous wrapper and not governed by Aragon, was inherited from OpenZeppelin's library, using one of its stable releases [3.1.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v3.1.0). +For the other contracts the newer compiler versions are used. # How to compile -Separately: - -```bash -yarn compile:4 -yarn compile:6 -``` - All at once: ```bash diff --git a/contracts/common/interfaces/IGateSealFactory.sol b/contracts/common/interfaces/IGateSealFactory.sol new file mode 100644 index 000000000..b2ffaaec5 --- /dev/null +++ b/contracts/common/interfaces/IGateSealFactory.sol @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2023 Lido +// SPDX-License-Identifier: GPL-3.0 + +// See contracts/COMPILERS.md +// solhint-disable-next-line +pragma solidity >=0.4.24 <0.9.0; + +// https://github.com/lidofinance/gate-seals/blob/main/contracts/GateSealFactory.vy +interface IGateSealFactory { + + event GateSealCreated(address gate_seal); + + function create_gate_seal( + address _sealing_committee, + uint256 _seal_duration_seconds, + address[] memory _sealables, + uint256 _expiry_timestamp + ) external; + +} diff --git a/test/0.4.24/contracts/AccountingOracle__MockForLegacyOracle.sol b/test/0.4.24/contracts/AccountingOracle__MockForLegacyOracle.sol index 6361bf3c2..b74eaebde 100644 --- a/test/0.4.24/contracts/AccountingOracle__MockForLegacyOracle.sol +++ b/test/0.4.24/contracts/AccountingOracle__MockForLegacyOracle.sol @@ -31,6 +31,7 @@ contract AccountingOracle__MockForLegacyOracle { } function submitReportData(AccountingOracle.ReportData calldata data, uint256 /* contractVersion */) external { + require(data.refSlot >= _lastRefSlot, "refSlot less than _lastRefSlot"); uint256 slotsElapsed = data.refSlot - _lastRefSlot; _lastRefSlot = data.refSlot; From e4a6ae47ab83d53e521a57e16bd31b04ac0ba17b Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Tue, 24 Sep 2024 15:23:50 +0100 Subject: [PATCH 2/2] docs: improve texts --- contracts/COMPILERS.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/contracts/COMPILERS.md b/contracts/COMPILERS.md index bd07c67ee..5f6c23764 100644 --- a/contracts/COMPILERS.md +++ b/contracts/COMPILERS.md @@ -1,12 +1,17 @@ -# Why we use different compilers +# Compiler Versions Used in Lido Project -For Lido project coordination, governance and funds management we use [Aragon](https://aragon.org/dao), a well-developed and proven DAO Framework. The current stable release of its Kernel, [4.4.0](https://github.com/aragon/aragonOS/tree/v4.4.0) is fixed on the specific compiler version - [solc 0.4.24](https://solidity.readthedocs.io/en/v0.4.24/), that is currently outdated. Keeping security and consistency in mind, we decided to stay on an older yet proven combination - for all the contracts under Aragon management (`Lido`, `stETH`, `LegacyOracle`) we use solc 0.4.24 release. +For Lido project coordination, governance, and funds management, we use [Aragon](https://aragon.org/dao), a +well-developed and proven DAO Framework. The current stable release of its +Kernel, [4.4.0](https://github.com/aragon/aragonOS/tree/v4.4.0), is fixed on a specific compiler +version - [solc 0.4.24](https://solidity.readthedocs.io/en/v0.4.24/), which is currently outdated. Keeping security and +consistency in mind, we decided to stay on an older yet proven combination. Therefore, for all the contracts under +Aragon management (`Lido`, `stETH`, `LegacyOracle`), we use the `solc 0.4.24` release. -For the other contracts the newer compiler versions are used. +For the `wstETH` contract, we use `solc 0.6.12`, as it is non-upgradeable and bound to this version. -# How to compile +For the other contracts, newer compiler versions are used. -All at once: +# Compilation Instructions ```bash yarn compile