wise-token-contracts icon indicating copy to clipboard operation
wise-token-contracts copied to clipboard

_stakeNotStarted if closing stake same day when created

Open vm06007 opened this issue 4 years ago • 0 comments

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

vm06007 avatar Dec 02 '20 11:12 vm06007