From 92401647efb182ea2d794b2660bf71ed6013cdcd Mon Sep 17 00:00:00 2001 From: Ramana Kumar Date: Mon, 14 Nov 2022 21:54:36 +0000 Subject: [PATCH] Do not bother with rETHBefore Sending rETH to this contract means sending it to whatever lucky NO calls depositAndMint next. --- contracts/contract/node/RocketNodeDeposit.sol | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/contracts/contract/node/RocketNodeDeposit.sol b/contracts/contract/node/RocketNodeDeposit.sol index 0c220f8e0..cd3152a53 100644 --- a/contracts/contract/node/RocketNodeDeposit.sol +++ b/contracts/contract/node/RocketNodeDeposit.sol @@ -73,14 +73,11 @@ contract RocketNodeDeposit is RocketBase, RocketNodeDepositInterface { } function _mint(uint256 _mintEthAmount) private { - // Save current rETH balance (for calculating how much rETH is minted) - RocketTokenRETHInterface rocketTokenRETH = RocketTokenRETHInterface(getContractAddress("rocketTokenRETH")); - uint256 rETHBefore = rocketTokenRETH.balanceOf(address(this)); // Deposit ETH to mint rETH - RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(getContractAddress("rocketDepositPool")); - rocketDepositPool.deposit{value: _mintEthAmount}(); + RocketDepositPoolInterface(getContractAddress("rocketDepositPool")).deposit{value: _mintEthAmount}(); // Transfer minted rETH back to the caller - rocketTokenRETH.transfer(msg.sender, rocketTokenRETH.balanceOf(address(this)) - rETHBefore); + RocketTokenRETHInterface rocketTokenRETH = RocketTokenRETHInterface(getContractAddress("rocketTokenRETH")); + rocketTokenRETH.transfer(msg.sender, rocketTokenRETH.balanceOf(address(this))); }