diff --git a/contracts/libraries/UnsafeMathUint256.sol b/contracts/libraries/UnsafeMathUint256.sol new file mode 100644 index 0000000..631b86b --- /dev/null +++ b/contracts/libraries/UnsafeMathUint256.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +library UnsafeMathUint256 { + function unsafeAdd(uint256 a, uint256 b) internal pure returns (uint256) { + unchecked { + return a + b; + } + } + + function unsafeSubtract(uint256 a, uint256 b) internal pure returns (uint256) { + unchecked { + return a - b; + } + } + + function unsafeMultiply(uint256 a, uint256 b) internal pure returns (uint256) { + unchecked { + return a * b; + } + } + + function unsafeDivide(uint256 a, uint256 b) internal pure returns (uint256) { + unchecked { + return a / b; + } + } +} \ No newline at end of file