prb-math icon indicating copy to clipboard operation
prb-math copied to clipboard

Check if I can DRY-ify the `UD60x18.wrap` conversions

Open PaulRBerg opened this issue 3 years ago • 0 comments

Have a helper function like this:

/// @notice Wraps a signed integer into the UD60x18 type.
function ud60x18(uint256 x) pure returns (UD60x18 result) {
    result = UD60x18.wrap(x);
}

And then reuse it in all places where I am currently using UD60x18.wrap.

The litmus test for whether this is worth it or not is whether it will increase the gas cost.

Based on my previous investigations, my guess would be that no, the gas cost should not increase. But I need to double check.

PaulRBerg avatar Sep 05 '22 09:09 PaulRBerg