Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wtj2021 committed Sep 16, 2024
1 parent 03b75db commit fd5e5e9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 32 deletions.
16 changes: 6 additions & 10 deletions great_ape_safe/ape_api/ebtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -349,7 +345,7 @@ class governanceRoles(Enum):
"signature": self.governance_signatures[
"STEBTC_SET_MAX_DISTRIBUTION_PER_SECOND_PER_ASSET"
],
}
},
],
}

Expand Down
45 changes: 23 additions & 22 deletions scripts/stebtc_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,61 @@

C = Console()


def main():
safe = GreatApeSafe(r.ebtc_wallets.security_multisig)
safe.init_ebtc()

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()

0 comments on commit fd5e5e9

Please sign in to comment.