|
struct Stake { |
|
uint256 stakesShares; |
|
uint256 stakedAmount; |
|
uint256 rewardAmount; |
|
uint64 startDay; |
|
uint64 lockDays; |
|
uint64 finalDay; |
|
uint64 closeDay; |
|
uint256 scrapeDay; |
|
uint256 daiEquivalent; |
|
uint256 referrerShares; |
|
address referrer; |
|
bool isActive; |
it is possible to refactor or get rid of one of the fields in the Stake structure, as isActive can be determined by closeDay
zero - active
non zero - inactive
with that it is possible either add a helper function _isActive(stake.closeDay) to determine if the stake is active or not or completely remove this field and rely only on closeDay field. This is not a bug, just an improvement/refactoring in general to avoid extra fields and for better optimization. (only if time allows)
wise-token-contracts/contracts/Declaration.sol
Lines 170 to 182 in fe975b5
it is possible to refactor or get rid of one of the fields in the Stake structure, as
isActivecan be determined bycloseDayzero - active
non zero - inactive
with that it is possible either add a helper function
_isActive(stake.closeDay)to determine if the stake is active or not or completely remove this field and rely only on closeDay field. This is not a bug, just an improvement/refactoring in general to avoid extra fields and for better optimization. (only if time allows)