Errors.sol 829 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. /**
  4. * @dev Collection of common custom errors used in multiple contracts
  5. *
  6. * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
  7. * It is recommended to avoid relying on the error API for critical functionality.
  8. *
  9. * _Available since v5.1._
  10. */
  11. library Errors {
  12. /**
  13. * @dev The ETH balance of the account is not enough to perform the operation.
  14. */
  15. error InsufficientBalance(uint256 balance, uint256 needed);
  16. /**
  17. * @dev A call to an address target failed. The target may have reverted.
  18. */
  19. error FailedCall();
  20. /**
  21. * @dev The deployment failed.
  22. */
  23. error FailedDeployment();
  24. /**
  25. * @dev A necessary precompile is missing.
  26. */
  27. error MissingPrecompile(address);
  28. }