wise-token-contracts
wise-token-contracts copied to clipboard
_stakeNotStarted if closing stake same day when created
https://github.com/wise-foundation/wise-token-contracts/blob/fe975b5f065d020ab3af065679f5c7bb738e1d1a/contracts/Helper.sol#L170
in scenario when user closes pending stake (same day as creation) this will impact the views as it will return eventually false, even though the stake will never get started as it is closed same day.
solution:
function _stakeNotStarted(Stake memory _stake) internal view returns (bool) {
return _stake.closeDay > 0
? _stake.startDay > _stake.closeDay
: _stake.startDay > _currentWiseDay();
}