-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathcontracts.py
29 lines (26 loc) · 817 Bytes
/
contracts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from etherscan.enums.actions_enum import ActionsEnum as actions
from etherscan.enums.fields_enum import FieldsEnum as fields
from etherscan.enums.modules_enum import ModulesEnum as modules
class Contracts:
@staticmethod
def get_contract_abi(address: str) -> str:
url = (
f"{fields.MODULE}"
f"{modules.CONTRACT}"
f"{fields.ACTION}"
f"{actions.GET_ABI}"
f"{fields.ADDRESS}"
f"{address}"
)
return url
@staticmethod
def get_contract_source_code(address: str) -> str:
url = (
f"{fields.MODULE}"
f"{modules.CONTRACT}"
f"{fields.ACTION}"
f"{actions.GET_SOURCE_CODE}"
f"{fields.ADDRESS}"
f"{address}"
)
return url