Errors.sol 799 B

12345678910111213141516171819202122232425262728293031
  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. library Errors {
  10. /**
  11. * @dev The ETH balance of the account is not enough to perform the operation.
  12. */
  13. error InsufficientBalance(uint256 balance, uint256 needed);
  14. /**
  15. * @dev A call to an address target failed. The target may have reverted.
  16. */
  17. error FailedCall();
  18. /**
  19. * @dev The deployment failed.
  20. */
  21. error FailedDeployment();
  22. /**
  23. * @dev A necessary precompile is missing.
  24. */
  25. error MissingPrecompile(address);
  26. }