← Code LabSolidity0/50 solved · 0%
Safety · easy

10. require & revert

Guard your functions.

Add `onlyPositive(int256 x)` that `require(x > 0, "must be positive")` and returns `uint256(x)`.
Required in your answer: require(x > 0must be positiveuint256(x)