somish/NexusMutual

BaseMin and Varmin should be uint

Closed this issue · 3 comments

The variables BaseMin and Varmin should be uint256 instead of uint64 and should store values with decimals, for eg if BaseMin = 6 ETH it should be saved as 6*10^18.
This also leads to incorrect comparison and triggers in functions like internalLiquiditySwap, where Base Min + Var Min is compared to CA Balance directly, even though Base Min is saved without decimals and CA balance is retrieved with decimals.

changes done, please refer 2dde656

There are places where they are still referred as uint64, for example in function sendClaimPayout we are converting the parameter to changeCurrencyAssetVarMin() as uint64, while the parameter requires uint256.

changes are done. I am converting all non uint256 types to uint256 as breaking uint256 to smaller uints consume gas if they are not packed. e.g sum assured is not in 10^18, cover period is uint16 etc.