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))); }