SafeCastMockUpgradeable.sol 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../utils/math/SafeCastUpgradeable.sol";
  4. import "../proxy/utils/Initializable.sol";
  5. contract SafeCastMockUpgradeable is Initializable {
  6. function __SafeCastMock_init() internal onlyInitializing {
  7. }
  8. function __SafeCastMock_init_unchained() internal onlyInitializing {
  9. }
  10. using SafeCastUpgradeable for uint256;
  11. using SafeCastUpgradeable for int256;
  12. function toUint256(int256 a) public pure returns (uint256) {
  13. return a.toUint256();
  14. }
  15. function toUint224(uint256 a) public pure returns (uint224) {
  16. return a.toUint224();
  17. }
  18. function toUint128(uint256 a) public pure returns (uint128) {
  19. return a.toUint128();
  20. }
  21. function toUint96(uint256 a) public pure returns (uint96) {
  22. return a.toUint96();
  23. }
  24. function toUint64(uint256 a) public pure returns (uint64) {
  25. return a.toUint64();
  26. }
  27. function toUint32(uint256 a) public pure returns (uint32) {
  28. return a.toUint32();
  29. }
  30. function toUint16(uint256 a) public pure returns (uint16) {
  31. return a.toUint16();
  32. }
  33. function toUint8(uint256 a) public pure returns (uint8) {
  34. return a.toUint8();
  35. }
  36. function toInt256(uint256 a) public pure returns (int256) {
  37. return a.toInt256();
  38. }
  39. function toInt128(int256 a) public pure returns (int128) {
  40. return a.toInt128();
  41. }
  42. function toInt64(int256 a) public pure returns (int64) {
  43. return a.toInt64();
  44. }
  45. function toInt32(int256 a) public pure returns (int32) {
  46. return a.toInt32();
  47. }
  48. function toInt16(int256 a) public pure returns (int16) {
  49. return a.toInt16();
  50. }
  51. function toInt8(int256 a) public pure returns (int8) {
  52. return a.toInt8();
  53. }
  54. /**
  55. * @dev This empty reserved space is put in place to allow future versions to add new
  56. * variables without shifting down storage in the inheritance chain.
  57. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  58. */
  59. uint256[50] private __gap;
  60. }