forked from ton-society/the-open-league
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjetton_mint.py
24 lines (17 loc) · 808 Bytes
/
jetton_mint.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from models.metric import Metric, CalculationContext, RedoubtMetricImpl
class JettonMintRedoubtImpl(RedoubtMetricImpl):
def calculate(self, context: CalculationContext, metric):
jetton_masters = "\nor\n".join(map(lambda addr: f"jetton_master = '{addr}'", metric.jetton_masters))
return f"""
select msg_id as id, '{context.project.name}' as project, 1 as weight, user_address, ts
from jetton_mint_local
WHERE {jetton_masters}
"""
"""
TEP-74 token (jetton) mint, i.e. transfer initiated by jetton master
"""
class JettonMint(Metric):
def __init__(self, description, jetton_masters=[]):
assert type(jetton_masters) == list
Metric.__init__(self, description, [JettonMintRedoubtImpl()])
self.jetton_masters = jetton_masters