Skip to content

Commit

Permalink
Add standard error support
Browse files Browse the repository at this point in the history
  • Loading branch information
OwlOfMoistness committed Apr 30, 2023
1 parent c263156 commit e01f240
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions ape_solidity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ape import plugins

from .compiler import Extension, SolidityCompiler, SolidityConfig
from ._utils import StandardErrors


@plugins.register(plugins.Config)
Expand Down
12 changes: 12 additions & 0 deletions ape_solidity/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ class Extension(Enum):
SOL = ".sol"


class StandardErrors():
ASSERTION_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000001'
ARITHMETIC_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000011'
DIVISION_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000012'
ENUM_CONVERSION_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000021'
ENCODE_STORAGE_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000022'
POP_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000031'
INDEX_OOB_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000032'
MEM_OVERFLOW_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000041'
ZERO_VAR_ERROR = '0x4e487b710000000000000000000000000000000000000000000000000000000000000051'


class ImportRemapping(BaseModel):
entry: str
packages_cache: Path
Expand Down

0 comments on commit e01f240

Please sign in to comment.