def METHOD_NAME(safe_ens, sim=False):
    target_config, safe = (
        (TARGET_CONFIG_DEV_MSIG, dev_msig)
        if "dev.badgerdao.eth" == safe_ens
        else (TARGET_CONFIG_TECHOPS, techops)
    )
    registry = safe.contract(r.registry_v2, Interface=interface.IBadgerRegistryV2)
    for contract_name in target_config:
        target = safe.contract(registry.get(contract_name), from_explorer=True)
        C.print(f"Processing configuration for {contract_name} at {target}\n")
        roles_targets = target_config[contract_name]
        for role in roles_targets:
            expected_addrs_per_setting = target_config[contract_name][role]
            if not isinstance(expected_addrs_per_setting, str):
                count = target.getRoleMemberCount(role)
                with multicall:
                    members = [target.getRoleMember(role, i) for i in range(count)]
                C.print(
                    f"Role {role} in {contract_name} has {count} members, checking against target config...\n"
                )
                for addr in expected_addrs_per_setting:
                    if not target.hasRole(role, addr):
                        C.print(f"Grant role {role} in {contract_name} for {addr}\n")
                        target.grantRole(role, addr)
                for member in members:
                    if not member in expected_addrs_per_setting:
                        C.print(f"Revoke role {role} in {contract_name} for {member}\n")
                        target.revokeRole(role, member)
            else:
                count = target.getRoleMemberCount(role)
                with multicall:
                    members = [target.getRoleMember(role, i) for i in range(count)]
                C.print(
                    f"Role {role} in {contract_name} has {count} members, checking against target config...\n"
                )
                if not target.hasRole(role, expected_addrs_per_setting):
                    C.print(
                        f"Grant role {role} in {contract_name} for {expected_addrs_per_setting}\n"
                    )
                    target.grantRole(role, expected_addrs_per_setting)
                for member in members:
                    if member != expected_addrs_per_setting:
                        C.print(f"Revoke role {role} in {contract_name} for {member}\n")
                        target.revokeRole(role, member)
    if not sim:
        safe.post_safe_tx()
    else:
        safe.post_safe_tx(skip_preview=True)