From fd5e5e91bd2a125918b6991fbeb96d7ba7687e74 Mon Sep 17 00:00:00 2001 From: wtj2021 Date: Mon, 16 Sep 2024 09:43:48 -0700 Subject: [PATCH] lint --- great_ape_safe/ape_api/ebtc.py | 16 +++++------- scripts/stebtc_auth.py | 45 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/great_ape_safe/ape_api/ebtc.py b/great_ape_safe/ape_api/ebtc.py index 2c946253..c0933fa2 100644 --- a/great_ape_safe/ape_api/ebtc.py +++ b/great_ape_safe/ape_api/ebtc.py @@ -106,8 +106,8 @@ class governanceRoles(Enum): 11 # PriceFeed+CDPManager: CollFeedSource & RedemptionFeeFloor ) PYS_REWARD_SPLIT_SETTER = 12 # CDPManager: setStakingRewardSplit - STEBTC_DONOR = 13 # StakedEbtc: donation - STEBTC_MANAGER = 14 # StakedEbtc: management + STEBTC_DONOR = 13 # StakedEbtc: Donor + STEBTC_MANAGER = 14 # StakedEbtc: Manager self.governance_roles = governanceRoles @@ -156,15 +156,11 @@ class governanceRoles(Enum): "STEBTC_SET_MIN_REWARDS_PER_PERIOD_SIG": encode_signature( "setMinRewardsPerPeriod(uint256)" ), - "STEBTC_DONATE": encode_signature( - "donate(uint256)" - ), - "STEBTC_SWEEP": encode_signature( - "sweep(address)" - ), + "STEBTC_DONATE": encode_signature("donate(uint256)"), + "STEBTC_SWEEP": encode_signature("sweep(address)"), "STEBTC_SET_MAX_DISTRIBUTION_PER_SECOND_PER_ASSET": encode_signature( "setMaxDistributionPerSecondPerAsset(uint256)" - ) + ), } # Mapping of the governance roles to the list of permissions (signatures within contracts) that they have @@ -349,7 +345,7 @@ class governanceRoles(Enum): "signature": self.governance_signatures[ "STEBTC_SET_MAX_DISTRIBUTION_PER_SECOND_PER_ASSET" ], - } + }, ], } diff --git a/scripts/stebtc_auth.py b/scripts/stebtc_auth.py index f4737153..2410ed6f 100644 --- a/scripts/stebtc_auth.py +++ b/scripts/stebtc_auth.py @@ -5,6 +5,7 @@ C = Console() + def main(): safe = GreatApeSafe(r.ebtc_wallets.security_multisig) safe.init_ebtc() @@ -12,53 +13,53 @@ def main(): data = [ # Role names safe.ebtc.authority.setRoleName.encode_input( - safe.ebtc.governance_roles.STEBTC_DONOR.value, - "StakedEbtc: Donor" + safe.ebtc.governance_roles.STEBTC_DONOR.value, "StakedEbtc: Donor" ), safe.ebtc.authority.setRoleName.encode_input( - safe.ebtc.governance_roles.STEBTC_MANAGER.value, - "StakedEbtc: Manager" + safe.ebtc.governance_roles.STEBTC_MANAGER.value, "StakedEbtc: Manager" ), # Role capabilities safe.ebtc.authority.setRoleCapability.encode_input( - safe.ebtc.governance_roles.STEBTC_DONOR.value, - safe.ebtc.staked_ebtc, + safe.ebtc.governance_roles.STEBTC_DONOR.value, + safe.ebtc.staked_ebtc, safe.ebtc.staked_ebtc.donate.signature, - True + True, ), safe.ebtc.authority.setRoleCapability.encode_input( - safe.ebtc.governance_roles.STEBTC_MANAGER.value, - safe.ebtc.staked_ebtc, + safe.ebtc.governance_roles.STEBTC_MANAGER.value, + safe.ebtc.staked_ebtc, safe.ebtc.staked_ebtc.setMinRewardsPerPeriod.signature, - True + True, ), safe.ebtc.authority.setRoleCapability.encode_input( - safe.ebtc.governance_roles.STEBTC_MANAGER.value, - safe.ebtc.staked_ebtc, + safe.ebtc.governance_roles.STEBTC_MANAGER.value, + safe.ebtc.staked_ebtc, safe.ebtc.staked_ebtc.sweep.signature, - True + True, ), safe.ebtc.authority.setRoleCapability.encode_input( - safe.ebtc.governance_roles.STEBTC_MANAGER.value, - safe.ebtc.staked_ebtc, + safe.ebtc.governance_roles.STEBTC_MANAGER.value, + safe.ebtc.staked_ebtc, safe.ebtc.staked_ebtc.setMaxDistributionPerSecondPerAsset.signature, - True + True, ), # Grant roles safe.ebtc.authority.setUserRole.encode_input( - safe.ebtc.active_pool.feeRecipientAddress(), + safe.ebtc.active_pool.feeRecipientAddress(), safe.ebtc.governance_roles.STEBTC_DONOR.value, - True + True, ), safe.ebtc.authority.setUserRole.encode_input( - safe.ebtc.techops_multisig, + safe.ebtc.techops_multisig, safe.ebtc.governance_roles.STEBTC_MANAGER.value, - True - ) + True, + ), ] targets = [safe.ebtc.authority] * len(data) values = [0] * len(data) - safe.ebtc.schedule_or_execute_batch_timelock(safe.ebtc.highsec_timelock, targets, values, data, EmptyBytes32) + safe.ebtc.schedule_or_execute_batch_timelock( + safe.ebtc.highsec_timelock, targets, values, data, EmptyBytes32 + ) safe.post_safe_tx()