From 3a078503197c90c10f211d67c0a471da5312c99b Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Tue, 28 May 2024 19:39:58 +0200 Subject: [PATCH 1/6] add rpc for new chain permissions. --- generate_current_permissions.py | 35 +++++++++++---------------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/generate_current_permissions.py b/generate_current_permissions.py index 35fddf61..9481a59b 100644 --- a/generate_current_permissions.py +++ b/generate_current_permissions.py @@ -12,33 +12,22 @@ "zkevm": Web3(Web3.HTTPProvider(f"https://zkevm-rpc.com")), "avalanche": Web3(Web3.HTTPProvider(f"https://api.avax.network/ext/bc/C/rpc")), ### Less reliable RPCs first to fail fast :) - "mainnet": Web3( - Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "base": Web3( - Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "arbitrum": Web3( - Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "optimism": Web3( - Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "polygon": Web3( - Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "sepolia": Web3( - Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), +# "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), + "mainnet": Web3(Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "base": Web3(Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "arbitrum": Web3(Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "optimism": Web3(Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "polygon": Web3(Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "mode": Web3(Web3.HTTPProvider("https://mainnet.mode.network/")), + "fraxtal": Web3(Web3.HTTPProvider("https://rpc.frax.com")), + "sepolia": Web3(Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}")), } def build_chain_permissions_list(chain_name): a = AddrBook(chain_name) results = {} - action_ids_list = ( - f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" - ) + action_ids_list = f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" w3 = w3_by_chain[chain_name] authorizer = w3.eth.contract( address=a.search_unique("20210418-authorizer/Authorizer").address, @@ -59,9 +48,7 @@ def build_chain_permissions_list(chain_name): if numMembers > 0: memberAddressList = [] for i in range(0, numMembers, 1): - caller = str( - authorizer.functions.getRoleMember(action_id, i).call() - ) + caller = str(authorizer.functions.getRoleMember(action_id, i).call()) memberAddressList.append(caller) results[action_id] = memberAddressList From 07790d887cb08faf272acd0b68cb3f24feef1d1e Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Tue, 28 May 2024 17:40:35 +0000 Subject: [PATCH 2/6] style: ci lint with `black` --- generate_current_permissions.py | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/generate_current_permissions.py b/generate_current_permissions.py index 9481a59b..e2d4d36b 100644 --- a/generate_current_permissions.py +++ b/generate_current_permissions.py @@ -12,22 +12,36 @@ "zkevm": Web3(Web3.HTTPProvider(f"https://zkevm-rpc.com")), "avalanche": Web3(Web3.HTTPProvider(f"https://api.avax.network/ext/bc/C/rpc")), ### Less reliable RPCs first to fail fast :) -# "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), - "mainnet": Web3(Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "base": Web3(Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "arbitrum": Web3(Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "optimism": Web3(Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "polygon": Web3(Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + # "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), + "mainnet": Web3( + Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "base": Web3( + Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "arbitrum": Web3( + Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "optimism": Web3( + Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "polygon": Web3( + Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), "mode": Web3(Web3.HTTPProvider("https://mainnet.mode.network/")), "fraxtal": Web3(Web3.HTTPProvider("https://rpc.frax.com")), - "sepolia": Web3(Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "sepolia": Web3( + Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), } def build_chain_permissions_list(chain_name): a = AddrBook(chain_name) results = {} - action_ids_list = f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" + action_ids_list = ( + f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" + ) w3 = w3_by_chain[chain_name] authorizer = w3.eth.contract( address=a.search_unique("20210418-authorizer/Authorizer").address, @@ -48,7 +62,9 @@ def build_chain_permissions_list(chain_name): if numMembers > 0: memberAddressList = [] for i in range(0, numMembers, 1): - caller = str(authorizer.functions.getRoleMember(action_id, i).call()) + caller = str( + authorizer.functions.getRoleMember(action_id, i).call() + ) memberAddressList.append(caller) results[action_id] = memberAddressList From ed4892f62e36b7352c6e59ebabdd74d3999aa485 Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Tue, 28 May 2024 19:52:59 +0200 Subject: [PATCH 3/6] switch to alchemy for zkevm. --- generate_current_permissions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_current_permissions.py b/generate_current_permissions.py index 9481a59b..b2a0ace5 100644 --- a/generate_current_permissions.py +++ b/generate_current_permissions.py @@ -9,10 +9,10 @@ w3_by_chain = { "gnosis": Web3(Web3.HTTPProvider(f"https://rpc.gnosischain.com")), - "zkevm": Web3(Web3.HTTPProvider(f"https://zkevm-rpc.com")), + "zkevm": Web3(Web3.HTTPProvider(f"https://polygonzkevm-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), "avalanche": Web3(Web3.HTTPProvider(f"https://api.avax.network/ext/bc/C/rpc")), ### Less reliable RPCs first to fail fast :) -# "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), + # "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), "mainnet": Web3(Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), "base": Web3(Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), "arbitrum": Web3(Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), From 15c5164e314745fb08bca79d36b5252b15d477c5 Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Tue, 28 May 2024 19:54:00 +0200 Subject: [PATCH 4/6] switch to alchemy for zkevm. --- generate_current_permissions.py | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/generate_current_permissions.py b/generate_current_permissions.py index e5d1e75f..b2a0ace5 100644 --- a/generate_current_permissions.py +++ b/generate_current_permissions.py @@ -13,35 +13,21 @@ "avalanche": Web3(Web3.HTTPProvider(f"https://api.avax.network/ext/bc/C/rpc")), ### Less reliable RPCs first to fail fast :) # "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), - "mainnet": Web3( - Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "base": Web3( - Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "arbitrum": Web3( - Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "optimism": Web3( - Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), - "polygon": Web3( - Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), + "mainnet": Web3(Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "base": Web3(Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "arbitrum": Web3(Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "optimism": Web3(Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "polygon": Web3(Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), "mode": Web3(Web3.HTTPProvider("https://mainnet.mode.network/")), "fraxtal": Web3(Web3.HTTPProvider("https://rpc.frax.com")), - "sepolia": Web3( - Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}") - ), + "sepolia": Web3(Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}")), } def build_chain_permissions_list(chain_name): a = AddrBook(chain_name) results = {} - action_ids_list = ( - f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" - ) + action_ids_list = f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" w3 = w3_by_chain[chain_name] authorizer = w3.eth.contract( address=a.search_unique("20210418-authorizer/Authorizer").address, @@ -62,9 +48,7 @@ def build_chain_permissions_list(chain_name): if numMembers > 0: memberAddressList = [] for i in range(0, numMembers, 1): - caller = str( - authorizer.functions.getRoleMember(action_id, i).call() - ) + caller = str(authorizer.functions.getRoleMember(action_id, i).call()) memberAddressList.append(caller) results[action_id] = memberAddressList From 93b0c6332d2e3deca43c980f2850b94c966d32fa Mon Sep 17 00:00:00 2001 From: Tritium-VLK Date: Tue, 28 May 2024 17:54:22 +0000 Subject: [PATCH 5/6] style: ci lint with `black` --- generate_current_permissions.py | 38 +++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/generate_current_permissions.py b/generate_current_permissions.py index b2a0ace5..10e16e0b 100644 --- a/generate_current_permissions.py +++ b/generate_current_permissions.py @@ -9,25 +9,43 @@ w3_by_chain = { "gnosis": Web3(Web3.HTTPProvider(f"https://rpc.gnosischain.com")), - "zkevm": Web3(Web3.HTTPProvider(f"https://polygonzkevm-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "zkevm": Web3( + Web3.HTTPProvider( + f"https://polygonzkevm-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}" + ) + ), "avalanche": Web3(Web3.HTTPProvider(f"https://api.avax.network/ext/bc/C/rpc")), ### Less reliable RPCs first to fail fast :) # "linea": Web3(Web3.HTTPProvider(f"https://linea-mainnet.infura.io/v3/{INFURA_KEY}")), - "mainnet": Web3(Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "base": Web3(Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "arbitrum": Web3(Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "optimism": Web3(Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), - "polygon": Web3(Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "mainnet": Web3( + Web3.HTTPProvider(f"https://eth-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "base": Web3( + Web3.HTTPProvider(f"https://base-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "arbitrum": Web3( + Web3.HTTPProvider(f"https://arb-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "optimism": Web3( + Web3.HTTPProvider(f"https://opt-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), + "polygon": Web3( + Web3.HTTPProvider(f"https://polygon-mainnet.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), "mode": Web3(Web3.HTTPProvider("https://mainnet.mode.network/")), "fraxtal": Web3(Web3.HTTPProvider("https://rpc.frax.com")), - "sepolia": Web3(Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}")), + "sepolia": Web3( + Web3.HTTPProvider(f"https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_KEY}") + ), } def build_chain_permissions_list(chain_name): a = AddrBook(chain_name) results = {} - action_ids_list = f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" + action_ids_list = ( + f"{GITHUB_DEPLOYMENTS_RAW}/action-ids/{chain_name}/action-ids.json" + ) w3 = w3_by_chain[chain_name] authorizer = w3.eth.contract( address=a.search_unique("20210418-authorizer/Authorizer").address, @@ -48,7 +66,9 @@ def build_chain_permissions_list(chain_name): if numMembers > 0: memberAddressList = [] for i in range(0, numMembers, 1): - caller = str(authorizer.functions.getRoleMember(action_id, i).call()) + caller = str( + authorizer.functions.getRoleMember(action_id, i).call() + ) memberAddressList.append(caller) results[action_id] = memberAddressList From 7f0cb88cb713915e94d20d5b91d8bfebaa782e3d Mon Sep 17 00:00:00 2001 From: Tritium-VLK <11885129+Tritium-VLK@users.noreply.github.com> Date: Tue, 28 May 2024 18:11:23 +0000 Subject: [PATCH 6/6] Scheduled update from changes to monorepo --- outputs/permissions/active/fraxtal.json | 1 + outputs/permissions/active/mode.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 outputs/permissions/active/fraxtal.json create mode 100644 outputs/permissions/active/mode.json diff --git a/outputs/permissions/active/fraxtal.json b/outputs/permissions/active/fraxtal.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/outputs/permissions/active/fraxtal.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/outputs/permissions/active/mode.json b/outputs/permissions/active/mode.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/outputs/permissions/active/mode.json @@ -0,0 +1 @@ +{} \ No newline at end of file