Skip to content

Commit

Permalink
Merge branch 'main' into add/mainnet_v2_injector_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Tritium-VLK authored Dec 17, 2024
2 parents d2721dd + 11c7471 commit f65e4ad
Show file tree
Hide file tree
Showing 54 changed files with 797 additions and 132 deletions.
2 changes: 1 addition & 1 deletion bal_addresses/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pytest-mock
responses
pytest-cov
pytest==7.4.0
black==22.10
black==24.3.0
2 changes: 1 addition & 1 deletion bal_addresses/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pathlib>=1.0
git+https://github.com/BalancerMaxis/[email protected].12
git+https://github.com/BalancerMaxis/[email protected].14
requests
pandas
web3
Expand Down
1 change: 1 addition & 0 deletions extras/arbitrum.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"stkauraBAL": "0x4EA9317D90b61fc28C418C247ad0CA8939Bbb0e9",
"LINK": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
"auraBAL": "0x223738a747383d6F9f827d95964e4d8E8AC754cE",
"GHO": "0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33",
"LDO": "0x13Ad51ed4F1B7e9Dc168d8a00cB3f4dDD85EfA60"
},
"across": {
Expand Down
4 changes: 3 additions & 1 deletion extras/gnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
},
"injectorV2": {
"factory": "0x6142582f8946bf192a4f80ed643a5856d18a7060",
"mockLogic": "0x747c4f7d3fc02b7975779effdf5d1c77105109cb"
"mockLogic": "0x747c4f7d3fc02b7975779effdf5d1c77105109cb",
"USDC": "0xfa7b21b30325dbbd4a71ee2b2ede74a7d8a2c0e4",
"USDC.e": "0x4ac87aea2a3a99f34fec78a6a73bc495893b2838"
}
},
"stakewise": {
Expand Down
6 changes: 5 additions & 1 deletion extras/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"USDS": "0xdC035D45d973E3EC169d2276DDab16f1e407384F",
"sUSDS": "0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD",
"GEAR": "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D",
"RPL": "0xD33526068D116cE69F19A9ee46F0bd304F21A51f",
"sdBAL": "0xF24d8651578a55b0C119B9910759a351A3458895"
},
"helpers": {
Expand Down Expand Up @@ -197,7 +198,10 @@
"roles_v2": "0x13c61a25DB73e7a94a244bD2205aDba8b4a60F4a"
},
"gyro": {
"GydDistributor": "0x7cC9eb3cbe2472e9CCa5398DC9A48710682359C2"
"GydDistributor": "0x7cC9eb3cbe2472e9CCa5398DC9A48710682359C2",
"AssociatedDAOVault": "0xA2321E23B3060e160195E138b62F8498546B0247",
"zen_dragon_delegate": "0x25B70c8050B7e327Ce62CfD80A0C60cCcf057Fa6",
"defi_naly_delegate": "0x29430750d7c3Ff58c9615490485deA50bdFD15f7"
},
"aave": {
"balancer_stk_aave_retrieval": "0x0e2d46fe246eb926d939A10efA96fB7d4EB14bB3"
Expand Down
2 changes: 2 additions & 0 deletions gen_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def write_addressbooks(chainlist=AddrBook.chain_ids_by_name.keys()):
flatbook = AddrBook(chain).generate_flatbook()
with open(f"outputs/{chain}.json", "w") as f:
json.dump(dict(sorted(flatbook.items())), f, indent=2)
f.write("\n")
with open(f"outputs/{chain}_reverse.json", "w") as f:
json.dump(reverse_dict(flatbook), f, indent=2)
f.write("\n")


def main():
Expand Down
1 change: 1 addition & 0 deletions gen_core_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def main():
# dump the collected dict to json file
with open("outputs/core_pools.json", "w") as f:
json.dump(core_pools, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions gen_current_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def generate_chain_files(chain):
permissions = build_chain_permissions_list(chain)
with open(f"outputs/permissions/active/{chain}.json", "w") as f:
json.dump(permissions, f, indent=2)
f.write("\n")


def main():
Expand Down
42 changes: 24 additions & 18 deletions gen_mono_addressbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ def main():
# Get deployments
active_deployments = []
old_deployments = []
ls = sorted(os.listdir(f"{basepath}/tasks"))
ls = sorted(os.listdir(f"{basepath}/v2/tasks") + os.listdir(f"{basepath}/v3/tasks"))
for path in ls:
if bool(re.search(r"^\d{8}", path)):
active_deployments.append(path)

ls = sorted(os.listdir(f"{basepath}/tasks/deprecated"))
print(active_deployments)
ls = sorted(
os.listdir(f"{basepath}/v2/deprecated")
+ os.listdir(f"{basepath}/v3/deprecated")
)
for path in ls:
if bool(re.search(r"^\d{8}", path)):
old_deployments.append(path)
Expand All @@ -35,6 +38,7 @@ def main():
results = {"active": active, "old": old}
with open("outputs/deployments.json", "w") as f:
json.dump(results, f, indent=2)
f.write("\n")
### Add extras
for chain in active.keys():
with open("extras/multisigs.json", "r") as f:
Expand Down Expand Up @@ -80,25 +84,27 @@ def main():
results = {"active": active, "old": old}
with open("outputs/addressbook.json", "w") as f:
json.dump(results, f, indent=2)
f.write("\n")


def process_deployments(deployments, old=False):
result = {}
for task in deployments:
if old:
path = Path(f"{basepath}/tasks/deprecated/{task}/output")
else:
path = Path(f"{basepath}/tasks/{task}/output")
for file in list(sorted(path.glob("*.json"))):
chain = file.stem
if chain not in result.keys():
result[chain] = {}
if task not in result[chain].keys():
result[chain][task] = {}
with open(str(file), "r") as f:
data = json.load(f)
for contract, address in data.items():
result[chain][task][contract] = address
for version in ["v2", "v3"]:
for task in deployments:
if old:
path = Path(f"{basepath}/{version}/deprecated/{task}/output")
else:
path = Path(f"{basepath}/{version}/tasks/{task}/output")
for file in list(sorted(path.glob("*.json"))):
chain = file.stem
if chain not in result.keys():
result[chain] = {}
if task not in result[chain].keys():
result[chain][task] = {}
with open(str(file), "r") as f:
data = json.load(f)
for contract, address in data.items():
result[chain][task][contract] = address
return result


Expand Down
3 changes: 3 additions & 0 deletions gen_pools_and_gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ def main():
# dump all collected dicts to json files
with open(f"outputs/pools.json", "w") as f:
json.dump(pools, f, indent=2)
f.write("\n")
with open("outputs/gauges.json", "w") as f:
json.dump(gauges, f, indent=2)
f.write("\n")
with open("outputs/root_gauges.json", "w") as f:
json.dump(root_gauges, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions gen_subgraph_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def main():
# dump the collected dict to json file
with open("outputs/subgraph_urls.json", "w") as f:
json.dump(urls, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit f65e4ad

Please sign in to comment.