Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/withdrawals PoC #446

Closed
wants to merge 127 commits into from
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
8bb5de8
chore: add .editorconfig
Aug 22, 2022
5d0c1f1
feat: bootstrap a simple TDD loop
Aug 23, 2022
e28991f
feat: mint a wannabe-NFT when enqueue
Aug 24, 2022
c42deee
chore: abi
Aug 24, 2022
d92c55c
feat: add another bunch of functions
Aug 24, 2022
50753ea
feat: add ether transfer after burn
Aug 25, 2022
6f7a2c5
feat: withdrawals to be used from Lido contract
Aug 30, 2022
7932cc2
feat: Some intermediate PoC code
folkyatina Sep 15, 2022
518a999
feat: radically simplify withdrawal queue
folkyatina Sep 30, 2022
46b9f94
feat: don't finalize if not enough ether
folkyatina Oct 3, 2022
a03c8de
fix: don't finalize if not enogh ether
folkyatina Oct 3, 2022
271ae4b
feat: simple discount for withdrawals
folkyatina Oct 4, 2022
48d82b0
feat: a bit more of comments
folkyatina Oct 4, 2022
700a297
fix: remove enumeration from withdrawals
folkyatina Oct 5, 2022
cc80ca1
fix: test run
folkyatina Oct 5, 2022
dce6530
feat: Add withdrawal events
folkyatina Oct 6, 2022
d9e3efe
fix: finalization ignoring passed id
folkyatina Oct 6, 2022
e5473b7
feat: simplify naming in queue
folkyatina Oct 11, 2022
9033a3e
feat: new TVL calculations
folkyatina Oct 13, 2022
b06644f
fix: fix reentrancy issue
folkyatina Oct 13, 2022
b02ce05
feat: change Request struct to respect the spec
folkyatina Oct 17, 2022
00441fc
feat: unlooped withdrawals (WIP)
folkyatina Oct 21, 2022
8b5fcfb
feat: unlooped withdrawals 2 (WIP)
folkyatina Oct 27, 2022
a2bed40
feat: Fix withdrawals queue tests
folkyatina Oct 31, 2022
8678584
test: lido tests restore
folkyatina Oct 31, 2022
e3fc672
test: fix lidoHandleOracleReport tests
folkyatina Oct 31, 2022
a567566
test: fix other tests
folkyatina Oct 31, 2022
ea6d090
feat: initial draft version of ValidatorExitBus with rate limit
arwer13 Nov 2, 2022
98a2488
refactor(RateLimitUtils): cleaning up
arwer13 Nov 3, 2022
782623b
fix: counter underflow in reverse for loop
folkyatina Nov 3, 2022
059c97a
fix: skipped visibility in interface
folkyatina Nov 3, 2022
6cf6b59
feat: add restake from withdrawal queue
folkyatina Nov 3, 2022
658f7e0
feature(ValidatorExitBus): forbid to report empty keys list
arwer13 Nov 4, 2022
dfed600
feature(oracle): initial version of python oracle logic draft
arwer13 Nov 4, 2022
cfe28f9
chore: internalize OZ util methods
folkyatina Nov 4, 2022
6346fc8
oracle-logic: refactor and add TODOs
arwer13 Nov 8, 2022
46bc202
feat(ValidatorExitBus): report epochId and skip non-first reports
arwer13 Nov 15, 2022
56e145b
feat(LidoOracle reportBeacon): handle withdrawal-related numbers
arwer13 Nov 16, 2022
2b53a5c
feat: add price chain to oracle reports
folkyatina Nov 17, 2022
0d6c20c
fix: remove _wcBuffer from TVL
folkyatina Nov 17, 2022
07d8a82
feat: align withdrawalRequestStatus to the spec
folkyatina Nov 17, 2022
63dd0af
feat: add BufferWithdrawalsReserve handle
folkyatina Nov 17, 2022
955ddf1
Merge branch 'feature/withdrawals-poc' of github.com:lidofinance/lido…
arwer13 Nov 23, 2022
31fd19b
intermediate: partially separate committee quorum from LidoOracle
arwer13 Nov 24, 2022
d2e34ca
add initial version of new LidoOracle, prune old LidoOracle
arwer13 Nov 28, 2022
7fbd6e2
chore: add _ to distributeFee
folkyatina Nov 23, 2022
c4b6ac6
fix: add auth to setBufferWithdrawalsReserve
folkyatina Nov 23, 2022
fd476aa
feat: rewards after withdrawal
folkyatina Nov 29, 2022
89219a4
chore: a bit of formatting for interfaces
folkyatina Nov 29, 2022
c31e5b6
chore: add proper prettier config for solidity
folkyatina Nov 29, 2022
acb8c77
fix: make claim work as expected
folkyatina Nov 29, 2022
76f91f8
Merge branch 'feature/withdrawals-poc' of github.com:lidofinance/lido…
arwer13 Nov 30, 2022
aeb6f2c
restore initial LidoOracle version (with old reportBeacon())
arwer13 Nov 30, 2022
3f58133
clean up LidoOracleNew.sol code and spaces in Lido.sol
arwer13 Dec 1, 2022
c535879
tests(lidooraclenew): fix to work with new contract version
arwer13 Dec 1, 2022
7b229cd
add setOwner to LidoOracleNew
arwer13 Dec 1, 2022
dffcac7
test(lidooraclenew): cleaning up
arwer13 Dec 1, 2022
acce873
refactor lib AragonUnstructuredStorage
arwer13 Dec 1, 2022
06f8915
restore ERC165Checker in LidoOracleNew
arwer13 Dec 1, 2022
f08bb86
feature(LidoOracleNew): plug OpenZeppelin AccessControlEnumerable
arwer13 Dec 1, 2022
ae85728
feature(LidoOracleNew): accept exitedValidatorsNumbers as uint64
arwer13 Dec 1, 2022
8023a4d
tests(new_rewards): handle rounding error
folkyatina Dec 4, 2022
1cd32e3
LidoOracleNew: fix setQuorum logic
arwer13 Dec 5, 2022
99d1844
Merge branch 'feature/parallel_tests' into feature/withdrawals-poc
folkyatina Dec 5, 2022
4967dbd
add yarn command to run tests sequentially
arwer13 Dec 6, 2022
74a9aaa
ValidatorExitBus: fixes and refactoring
arwer13 Dec 6, 2022
6be8ae2
delete temporary oracle-logic.py
arwer13 Dec 6, 2022
b980ccb
Merge branch 'feature/withdrawals-poc' into feature/validator-exit-bus
arwer13 Dec 6, 2022
dbc906f
Merge pull request #453 from lidofinance/feature/validator-exit-bus
arwer13 Dec 6, 2022
21d2be7
remove forgotten ".only" marks in tests
arwer13 Dec 6, 2022
adfbf15
massive rework of ValidatorExitBus and LidoOracleNew
arwer13 Dec 8, 2022
53f095d
update ethers library to 5.1.4
arwer13 Dec 8, 2022
a5d0e91
ValidatorExitBus: accept staking module address instead of id
arwer13 Dec 8, 2022
4ef112d
LidoOracleNew and ValidatorExitBus: use solidity custom errors
arwer13 Dec 11, 2022
b61f4ed
fix running all tests: mark as skipped a few ValidatorExitBus tests
arwer13 Dec 13, 2022
d7e0898
test(withdrawal): add some basic tests
folkyatina Dec 12, 2022
e708cc0
feat: remove totalExitedValidators from report
folkyatina Dec 13, 2022
542ad5c
feat: old-style reward calculation
folkyatina Dec 13, 2022
ee78e89
fix: withdrawal tests
folkyatina Dec 13, 2022
0717cf7
chore: add mocharc to run tests from vscode
folkyatina Dec 13, 2022
db7addf
fix: fix compiler version for UnstructuredStorage
folkyatina Dec 14, 2022
f8e01d1
fix: update solhint to support custom errors
folkyatina Dec 14, 2022
28cfe0d
chore: fix some linting errors
folkyatina Dec 14, 2022
9ca2069
chore: add pre-commit hook generating ABIs
folkyatina Dec 14, 2022
547a71a
fix: minor fixes
folkyatina Dec 14, 2022
af66c40
chore: remove solium
folkyatina Dec 14, 2022
f3ab760
chore: run linter before commit
folkyatina Dec 14, 2022
100b11f
chore: fix last linter warnings
folkyatina Dec 14, 2022
3111cec
LidoOracleNew: unify committee event names
arwer13 Dec 13, 2022
f2859b1
LidoOracleNew, ValidatorExitBus: add testnet admin functions
arwer13 Dec 14, 2022
8b79da8
ValidatorExitBus: add validatorId field to report
arwer13 Dec 14, 2022
b754242
ValidatorExitBus: store last requested validator id
arwer13 Dec 14, 2022
d4b8458
LidoOracleNew: rename reportBeacon to handleCommitteeMemberReport
arwer13 Dec 14, 2022
b4e4475
fix: rename finalizedQueueLength
folkyatina Dec 14, 2022
0b5cc98
WithdrawalQueue: optimize gas cost
folkyatina Dec 14, 2022
f8c4927
fix: forgotten abi
folkyatina Dec 14, 2022
928170a
chore: add hook for lint:js:fix
folkyatina Dec 14, 2022
c8bbfc0
LidoOracleNew report struct: replace staking module ids by addresses
arwer13 Dec 15, 2022
9e31366
fix: typos and spaces
arwer13 Dec 15, 2022
e137b5c
LidoOracleNew: add testnet helper function
arwer13 Dec 15, 2022
20e5396
refactor (LidoOracleNew, ValidatorExitBus)
arwer13 Dec 15, 2022
45a2a3a
fix formatting
arwer13 Dec 17, 2022
3b4e817
add clarifications regarding layout of structured storage
arwer13 Dec 22, 2022
901df0a
WithdrawalQueue: merge features from WithdrawalQueue V0
arwer13 Dec 23, 2022
f171e0e
Lido contract: get rid of Pausable modifiers to reduce contract size
arwer13 Dec 28, 2022
ceb203d
Lido: temporarily remove some code to fit to contract size limit
arwer13 Dec 28, 2022
b8de0d0
feat: remove some funcs shrinking Lido bytecode sz
TheDZhon Dec 28, 2022
0350274
Merge branch 'feature/size-reduce-proposals' into feature/withdrawals…
arwer13 Dec 28, 2022
ef007af
WithdrawalQueue: more consistent formatting
folkyatina Jan 3, 2023
ef043d0
fix: forgotten abi
folkyatina Jan 4, 2023
c0d59e8
test: fix tests after Lido contract shrunk
folkyatina Jan 4, 2023
c62ad4a
feat: remove restake counter
folkyatina Jan 4, 2023
8534ab5
test: reenable some tests
folkyatina Jan 4, 2023
040a3ed
fix: missed plus when updating lockedEther
folkyatina Jan 5, 2023
fba5840
add a few comments and tiny refactoring
arwer13 Jan 6, 2023
b15c8c1
Merge branch 'develop' into feature/withdrawals-poc
arwer13 Jan 8, 2023
e2a0e86
fix: remove too eager sanity check in WQ
folkyatina Jan 8, 2023
aed8597
feat: migtate to 1e27 share rate fomat
folkyatina Jan 8, 2023
fc18412
chore: electron for vscode-hardhat-solidity to work
folkyatina Jan 8, 2023
6dad351
feat: split WithdrawalQueue vault and queue
folkyatina Jan 8, 2023
be443de
chore: get rid of ILido interface
folkyatina Jan 8, 2023
c16a769
fix: fix getWithdrawalRequestStatus
folkyatina Jan 8, 2023
5fdf4df
chore: formatting and abi
folkyatina Jan 8, 2023
5b36d6a
fix: fix naming and cosmetics
folkyatina Jan 8, 2023
e5f13d2
fix: change MIN and MAX withdrawal amounts
folkyatina Jan 8, 2023
515297a
feat: add possibility to change recepient
folkyatina Jan 8, 2023
8ea2f32
chore: uncomment transferToVault
folkyatina Jan 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

[*.js]
indent_size = 2
106 changes: 97 additions & 9 deletions contracts/0.4.24/Lido.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import "./interfaces/ILido.sol";
import "./interfaces/INodeOperatorsRegistry.sol";
import "./interfaces/IDepositContract.sol";
import "./interfaces/ILidoExecutionLayerRewardsVault.sol";
import "./interfaces/IWithdrawalQueue.sol";

import "./StETH.sol";

Expand Down Expand Up @@ -103,6 +104,11 @@ contract Lido is ILido, StETH, AragonApp {
bytes32 internal constant BEACON_BALANCE_POSITION = keccak256("lido.Lido.beaconBalance");
/// @dev number of Lido's validators available in the Beacon state
bytes32 internal constant BEACON_VALIDATORS_POSITION = keccak256("lido.Lido.beaconValidators");
/// @dev number of Lido's validators exited, according to the Beacon state
bytes32 internal constant BEACON_EXITED_VALIDATORS_POSITION = keccak256("lido.Lido.exitedValidators");
folkyatina marked this conversation as resolved.
Show resolved Hide resolved

/// @dev amount of ether buffered for withdrawals, but not finalized yet
bytes32 internal constant WC_BUFFERED_ETHER_POSITION = keccak256("lido.Lido.wcBufferedEther");

/// @dev percent in basis points of total pooled ether allowed to withdraw from LidoExecutionLayerRewardsVault per LidoOracle report
bytes32 internal constant EL_REWARDS_WITHDRAWAL_LIMIT_POSITION = keccak256("lido.Lido.ELRewardsWithdrawalLimit");
Expand Down Expand Up @@ -459,12 +465,61 @@ contract Lido is ILido, StETH, AragonApp {
}

/**
* @notice Updates beacon stats, collects rewards from LidoExecutionLayerRewardsVault and distributes all rewards if beacon balance increased
* @notice this method is responsible for locking StETH and placing user
* in the queue
* @param _amountOfStETH StETH to be locked. `msg.sender` should have the `_amountOfStETH` StETH balance upon this call
* @return ticketId id string that can be used by user to claim their ETH later
*/
function requestWithdrawal(uint256 _amountOfStETH) external returns (uint256 requestId) {
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
address withdrawal = address(uint160(getWithdrawalCredentials()));
// lock StETH to withdrawal contract
_transfer(msg.sender, withdrawal, _amountOfStETH);

uint shares = getSharesByPooledEth(_amountOfStETH);
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
requestId = IWithdrawalQueue(withdrawal).enqueue(msg.sender, _amountOfStETH, shares);

emit WithdrawalRequested(msg.sender, _amountOfStETH, shares, requestId);
}

/**
* @notice Burns a ticket and transfer ETH to ticket owner address
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
* @param _requestId id of the ticket to burn
* Permissionless.
*/
function claimWithdrawal(uint256 _requestId, uint256 _priceIndexHint) external {
/// Just forward it to withdrawals
address withdrawal = address(uint160(getWithdrawalCredentials()));
address recipient = IWithdrawalQueue(withdrawal).claim(_requestId, _priceIndexHint);

emit WithdrawalClaimed(_requestId, recipient, msg.sender);
}

// TODO:
function withdrawalRequestStatus(uint _requestId) external view returns (
bool finalized,
uint256 etherToWithdraw,
address recipient
) {
IWithdrawalQueue withdrawal = IWithdrawalQueue(address(uint160(getWithdrawalCredentials())));

(recipient, etherToWithdraw,) = withdrawal.queue(_requestId);
finalized = _requestId < withdrawal.finalizedQueueLength();
}

/**
* @notice Updates CL stats, collects rewards from LidoExecutionLayerRewardsVault and distributes all rewards if beacon balance increased
* @dev periodically called by the Oracle contract
* @param _beaconValidators number of Lido's keys in the beacon state
* @param _beaconBalance summarized balance of Lido-controlled keys in wei
*/
function handleOracleReport(uint256 _beaconValidators, uint256 _beaconBalance) external whenNotStopped {
function handleOracleReport(
TheDZhon marked this conversation as resolved.
Show resolved Hide resolved
// CL values
uint256 _beaconValidators,
uint256 _beaconBalance,
uint256 _exitedValidators,
// EL values
uint256 _wcBufferedEther,
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
// decision
uint256 _requestIdToFinalizeUpTo
) external whenNotStopped {
require(msg.sender == getOracle(), "APP_AUTH_FAILED");

uint256 depositedValidators = DEPOSITED_VALIDATORS_POSITION.getStorageUint256();
Expand All @@ -476,6 +531,10 @@ contract Lido is ILido, StETH, AragonApp {
// reported number (we'll be unable to figure out who is in the queue and count them).
// See LIP-1 for details https://github.com/lidofinance/lido-improvement-proposals/blob/develop/LIPS/lip-1.md
require(_beaconValidators >= beaconValidators, "REPORTED_LESS_VALIDATORS");

uint256 exitedValidators = BEACON_EXITED_VALIDATORS_POSITION.getStorageUint256();
require(_exitedValidators >= exitedValidators, "REPORTED_LESS_EXITED_VALIDATORS");

uint256 appearedValidators = _beaconValidators.sub(beaconValidators);

// RewardBase is the amount of money that is not included in the reward calculation
Expand All @@ -486,6 +545,8 @@ contract Lido is ILido, StETH, AragonApp {
// calculate rewards on the next push
BEACON_BALANCE_POSITION.setStorageUint256(_beaconBalance);
BEACON_VALIDATORS_POSITION.setStorageUint256(_beaconValidators);
BEACON_EXITED_VALIDATORS_POSITION.setStorageUint256(_exitedValidators);
WC_BUFFERED_ETHER_POSITION.setStorageUint256(_wcBufferedEther);

// If LidoExecutionLayerRewardsVault address is not set just do as if there were no execution layer rewards at all
// Otherwise withdraw all rewards and put them to the buffer
Expand All @@ -504,6 +565,31 @@ contract Lido is ILido, StETH, AragonApp {
}
}

// simple finalization flow
address withdrawalAddress = address(uint160(getWithdrawalCredentials()));
IWithdrawalQueue withdrawal = IWithdrawalQueue(withdrawalAddress);

if (_requestIdToFinalizeUpTo >= withdrawal.finalizedQueueLength()) {
uint256 totalPooledEther = getTotalPooledEther();
uint256 totalShares = getTotalShares();

(uint256 sharesToBurn, uint256 etherToLock) = withdrawal.calculateFinalizationParams(
_requestIdToFinalizeUpTo,
totalPooledEther,
totalShares
);

_burnShares(withdrawalAddress, sharesToBurn);

uint256 additionalFundsForWithdrawal = etherToLock.sub(_wcBufferedEther);
withdrawal.finalize.value(additionalFundsForWithdrawal)(
_requestIdToFinalizeUpTo,
etherToLock,
totalPooledEther,
totalShares
);
}

// Don’t mint/distribute any protocol fee on the non-profitable Lido oracle report
// (when beacon chain balance delta is zero or negative).
// See ADR #3 for details: https://research.lido.fi/t/rewards-distribution-after-the-merge-architecture-decision-record/1535
Expand Down Expand Up @@ -922,19 +1008,21 @@ contract Lido is ILido, StETH, AragonApp {
function _getTransientBalance() internal view returns (uint256) {
uint256 depositedValidators = DEPOSITED_VALIDATORS_POSITION.getStorageUint256();
uint256 beaconValidators = BEACON_VALIDATORS_POSITION.getStorageUint256();
uint256 exitedValidators = BEACON_EXITED_VALIDATORS_POSITION.getStorageUint256();
// beaconValidators can never be less than deposited ones.
assert(depositedValidators >= beaconValidators);
return depositedValidators.sub(beaconValidators).mul(DEPOSIT_SIZE);
assert(depositedValidators.sub(exitedValidators) >= beaconValidators);
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
return depositedValidators.sub(exitedValidators).sub(beaconValidators).mul(DEPOSIT_SIZE);
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* @dev Gets the total amount of Ether controlled by the system
* @return total balance in wei
*/
function _getTotalPooledEther() internal view returns (uint256) {
return _getBufferedEther().add(
BEACON_BALANCE_POSITION.getStorageUint256()
).add(_getTransientBalance());
return _getBufferedEther()
.add(_getTransientBalance())
.add(BEACON_BALANCE_POSITION.getStorageUint256())
.add(WC_BUFFERED_ETHER_POSITION.getStorageUint256());
}

/**
Expand Down
26 changes: 19 additions & 7 deletions contracts/0.4.24/interfaces/ILido.sol
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,13 @@ interface ILido {

/**
* @notice Ether on the ETH 2.0 side reported by the oracle
* @param _epoch Epoch id
* @param _eth2balance Balance in wei on the ETH 2.0 side
*/
function handleOracleReport(uint256 _epoch, uint256 _eth2balance) external;
function handleOracleReport(
uint256 _beaconValidators,
uint256 _beaconBalance,
uint256 _exitedValidators,
uint256 _wcBufferedEther
) external;


// User functions
Expand All @@ -236,11 +239,20 @@ interface ILido {
// The `amount` of ether was sent to the deposit_contract.deposit function
event Unbuffered(uint256 amount);

// Requested withdrawal of `etherAmount` to `pubkeyHash` on the ETH 2.0 side, `tokenAmount` burned by `sender`,
// `sentFromBuffer` was sent on the current Ethereum side.
event Withdrawal(address indexed sender, uint256 tokenAmount, uint256 sentFromBuffer,
bytes32 indexed pubkeyHash, uint256 etherAmount);
// Withdrawal functions
function requestWithdrawal(uint256 _amountOfStETH) external returns (uint256 requestId);

function claimWithdrawal(uint256 _requestId) external;

function withdrawalRequestStatus(uint _requestId) external view returns (
bool finalized,
uint256 ethToWithdraw,
address recipient
);

event WithdrawalRequested(address indexed receiver, uint256 amountOfStETH, uint256 amountOfShares, uint256 requestId);

event WithdrawalClaimed(uint256 indexed requestId, address indexed receiver, address initiator);

// Info functions

Expand Down
34 changes: 34 additions & 0 deletions contracts/0.4.24/interfaces/IWithdrawalQueue.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-FileCopyrightText: 2021 Lido <[email protected]>

// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.4.24;

/**
* @notice an interface for witdrawal queue. See `WithdrawalQueue.sol` for docs
*/
interface IWithdrawalQueue {
folkyatina marked this conversation as resolved.
Show resolved Hide resolved
function enqueue(
address _requestor,
uint256 _etherAmount,
uint256 _sharesAmount
) external returns (uint256 requestId);

function claim(uint256 _requestId, uint256 _priceIndexHint) external returns (address recipient);

function calculateFinalizationParams(
uint256 _lastIdToFinalize,
uint256 _totalPooledEther,
uint256 _totalShares
) view returns (uint256 sharesToBurn, uint256 etherToLock);
Fixed Show fixed Hide fixed

function finalize(
uint256 _lastIdToFinalize,
uint256 _etherToLock,
uint256 _totalPooledEther,
uint256 _totalShares
) external payable;

function queue(uint256 _requestId) external view returns (address, uint, uint);
function finalizedQueueLength() external view returns (uint);
}
2 changes: 1 addition & 1 deletion contracts/0.4.24/oracle/LidoOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ contract LidoOracle is ILidoOracle, AragonApp {
// report to the Lido and collect stats
ILido lido = getLido();
uint256 prevTotalPooledEther = lido.totalSupply();
lido.handleOracleReport(_beaconValidators, _beaconBalanceEth1);
lido.handleOracleReport(_beaconValidators, _beaconBalanceEth1, 0, 0); // here should be withdrawal params
uint256 postTotalPooledEther = lido.totalSupply();

PRE_COMPLETED_TOTAL_POOLED_ETHER_POSITION.setStorageUint256(prevTotalPooledEther);
Expand Down
2 changes: 1 addition & 1 deletion contracts/0.4.24/test_helpers/LidoMockForOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract LidoMockForOracle {
return totalPooledEther;
}

function handleOracleReport(uint256 /*_beaconValidators*/, uint256 _beaconBalance) external {
function handleOracleReport(uint256 /*_beaconValidators*/, uint256 _beaconBalance, uint256, uint256) external {
totalPooledEther = _beaconBalance;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/0.4.24/test_helpers/OracleMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract OracleMock {
}

function reportBeacon(uint256 _epochId, uint128 _beaconValidators, uint128 _beaconBalance) external {
pool.handleOracleReport(_beaconValidators, _beaconBalance);
pool.handleOracleReport(_beaconValidators, _beaconBalance, 0, 0);
}

function setBeaconReportReceiver(address _receiver) {
Expand Down
Loading