For the first staker of the wxETH, the totalSupply of the wxETH is 0. So he can wrap the xETH to wxETH as 1:1.
function exchangeRate() public view returns (uint256) {
/// @dev if there are no tokens minted, return the initial exchange rate
uint256 _totalSupply = totalSupply();
if (_totalSupply == 0) {
return INITIAL_EXCHANGE_RATE;
}
If the drip is started before the first staker, the unlocked funds can be withdrew immediately in the same block by calling unstake.
Judge has assessed an item in Issue #19 as 2 risk. The relevant finding follows:
For the first staker of the wxETH, the totalSupply of the wxETH is 0. So he can wrap the xETH to wxETH as 1:1.
function exchangeRate() public view returns (uint256) { /// @dev if there are no tokens minted, return the initial exchange rate uint256 _totalSupply = totalSupply(); if (_totalSupply == 0) { return INITIAL_EXCHANGE_RATE; } If the drip is started before the first staker, the unlocked funds can be withdrew immediately in the same block by calling unstake.