Skip to content

Commit 477dab8

Browse files
authored
chore: add protocol guild to locked (#7)
1 parent f63d88f commit 477dab8

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎circulating-supply.py‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import json
2424
import os
25+
import re
2526
import sys
2627
import time
2728
from concurrent.futures import ThreadPoolExecutor
@@ -74,6 +75,7 @@
7475
FUTURE_INCENTIVES = "0x662De311f94bdbB571D95B5909e9cC6A25a6802a" # Locked
7576
Y1_REWARDS = "0x3D6A1B00C830C5f278FC5dFb3f6Ff0b74Db6dfe0" # Locked
7677
INVESTOR_WALLET = "0x92ba0fd39658105fac4df2b9bade998b5816b350" # Locked (temporary)
78+
PROTOCOL_GUILD = "0x25941dC771bB64514Fc8abBce970307Fb9d477e9" # Locked
7779
FLUSH_REWARDER = "0x7C9a7130379F1B5dd6e7A53AF84fC0fE32267B65" # Locked (rewardsAvailable)
7880

7981
MULTICALL3 = "0xcA11bde05977b3631167028862bE2a173976CA11"
@@ -317,8 +319,10 @@ def get_logs_safe(address, topics, from_block=None):
317319
except Exception as e:
318320
print(f" get_logs full range failed ({e}), falling back to chunking...")
319321
latest = get_block_info()[0] if isinstance(BLOCK_ID, int) else retry(lambda: w3.eth.block_number)
322+
# Respect the RPC's advertised max range if it tells us; else start broad.
323+
m = re.search(r"maxAllowedRange['\"]?\s*:\s*(\d+)", str(e))
324+
chunk_size = int(m.group(1)) if m else 2_000_000
320325
all_logs = []
321-
chunk_size = 2_000_000
322326
current = start_block
323327
while current <= latest:
324328
params["fromBlock"] = hex(current)
@@ -328,8 +332,8 @@ def get_logs_safe(address, topics, from_block=None):
328332
all_logs.extend(chunk_logs)
329333
current += chunk_size
330334
except Exception:
331-
chunk_size = chunk_size // 4
332-
if chunk_size < 10_000:
335+
chunk_size = chunk_size // 2
336+
if chunk_size < 1_000:
333337
raise
334338
return all_logs
335339

@@ -400,8 +404,8 @@ def fetch_data(atps, contract_addrs):
400404

401405
# [...] Balances: other contracts
402406
other_start_idx = len(calls)
403-
other_contracts = [FUTURE_INCENTIVES, Y1_REWARDS, INVESTOR_WALLET, UNISWAP_POOL]
404-
other_names = ["Future Incentives", "Y1 Network Rewards", "Investor Wallet", "Uniswap Pool"]
407+
other_contracts = [FUTURE_INCENTIVES, Y1_REWARDS, INVESTOR_WALLET, PROTOCOL_GUILD, UNISWAP_POOL]
408+
other_names = ["Future Incentives", "Y1 Network Rewards", "Investor Wallet", "Protocol Guild", "Uniswap Pool"]
405409
for addr in other_contracts:
406410
calls.append((AZTEC_TOKEN, _encode_bal(addr)))
407411

@@ -833,6 +837,7 @@ def display(atps, data):
833837
locked_future_incentives = other_bals.get("Future Incentives", 0)
834838
locked_y1_rewards = other_bals.get("Y1 Network Rewards", 0)
835839
locked_investor_wallet = other_bals.get("Investor Wallet", 0)
840+
locked_protocol_guild = other_bals.get("Protocol Guild", 0)
836841
locked_factories = sum(factory_bals.values())
837842

838843
# Rollup balance breakdown (sum of all historical rollup instances):
@@ -863,6 +868,7 @@ def display(atps, data):
863868
+ locked_future_incentives
864869
+ locked_y1_rewards
865870
+ locked_investor_wallet
871+
+ locked_protocol_guild
866872
+ locked_factories
867873
+ locked_slashed
868874
+ locked_flush_rewarder
@@ -913,6 +919,11 @@ def display(atps, data):
913919
f" Investor Wallet: {fmt(locked_investor_wallet):>27} AZTEC"
914920
f" ({pct(locked_investor_wallet, total_supply)})"
915921
)
922+
if locked_protocol_guild:
923+
print(
924+
f" Protocol Guild: {fmt(locked_protocol_guild):>27} AZTEC"
925+
f" ({pct(locked_protocol_guild, total_supply)})"
926+
)
916927
if locked_factories:
917928
print(
918929
f" Factories: {fmt(locked_factories):>27} AZTEC"
@@ -1261,6 +1272,7 @@ def display(atps, data):
12611272
"future_incentives": str(locked_future_incentives),
12621273
"y1_rewards": str(locked_y1_rewards),
12631274
"investor_wallet": str(locked_investor_wallet),
1275+
"protocol_guild": str(locked_protocol_guild),
12641276
"factories": str(locked_factories),
12651277
"slashed_funds": str(locked_slashed),
12661278
},

‎lambda/supply_calculator.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def calculate_supply():
7676
locked_future_incentives = data["other_bals"].get("Future Incentives", 0)
7777
locked_y1_rewards = data["other_bals"].get("Y1 Network Rewards", 0)
7878
locked_investor_wallet = data["other_bals"].get("Investor Wallet", 0)
79+
locked_protocol_guild = data["other_bals"].get("Protocol Guild", 0)
7980
locked_factories = sum(data["factory_bals"].values())
8081
locked_slashed = data["total_slashed_funds"]
8182
locked_flush_rewarder = data["flush_rewarder_locked"]
@@ -89,6 +90,7 @@ def calculate_supply():
8990
+ locked_future_incentives
9091
+ locked_y1_rewards
9192
+ locked_investor_wallet
93+
+ locked_protocol_guild
9294
+ locked_factories
9395
+ locked_slashed
9496
+ locked_flush_rewarder
@@ -138,6 +140,7 @@ def calculate_supply():
138140
"future_incentives": str(locked_future_incentives),
139141
"y1_rewards": str(locked_y1_rewards),
140142
"investor_wallet": str(locked_investor_wallet),
143+
"protocol_guild": str(locked_protocol_guild),
141144
"factories": str(locked_factories),
142145
"slashed_funds": str(locked_slashed),
143146
"flush_rewarder": str(locked_flush_rewarder),

0 commit comments

Comments
 (0)