Skip to content

Commit

Permalink
Do not bother with rETHBefore
Browse files Browse the repository at this point in the history
Sending rETH to this contract means sending it to whatever lucky NO
calls depositAndMint next.
  • Loading branch information
xrchz committed Nov 14, 2022
1 parent 9c90a38 commit 9240164
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions contracts/contract/node/RocketNodeDeposit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}


Expand Down

0 comments on commit 9240164

Please sign in to comment.