Difficulty -
Medium
Total Plays - 0
Allowed Time - 10 sec
Best time - 10 sec
Why is msg.value validation kept at the top of functions?
#A
#B
#C
#D
Explanation:
Validating msg.value early ensures no state mutation occurs before detecting invalid ether transfers. This prevents partially updated storage on failure, preserving atomicity. It aligns with checks-effects-interactions