File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -771,20 +771,14 @@ exec1 conf = do
771771 let cold_storage_cost = if acc then 0 else g_cold_sload
772772 burn (storage_cost + cold_storage_cost) $ do
773773 updateVMState
774-
775- unless (currentVal == newVal) $
776- if currentVal == originalVal then
777- when (originalVal /= 0 && newVal == 0 ) $
778- refund (g_sreset + g_access_list_storage_key)
779- else do
780- when (originalVal /= 0 ) $
781- if currentVal == 0
782- then unRefund (g_sreset + g_access_list_storage_key)
783- else when (newVal == 0 ) $ refund (g_sreset + g_access_list_storage_key)
784- when (originalVal == newVal) $
785- if originalVal == 0
786- then refund (g_sset - g_sload)
787- else refund (g_sreset - g_sload)
774+ case (originalVal, currentVal, newVal) of
775+ (o, c, n)
776+ | c == n -> pure ()
777+ | o /= 0 && n == 0 -> refund (g_sreset + g_access_list_storage_key)
778+ | o /= 0 && c == 0 -> do unRefund (g_sreset + g_access_list_storage_key); when (o == n) $ refund (g_sreset - g_sload)
779+ | o /= 0 && o == n -> refund (g_sreset - g_sload)
780+ | o == 0 && o == n -> refund (g_sset - g_sload)
781+ | otherwise -> pure ()
788782 in
789783 whenSymbolicElse updateVMState concreteSstore
790784 _ -> underrun
You can’t perform that action at this time.
0 commit comments