<commit_before>%h1 Audit
- projects = Project.order(disabled: :asc, account_balance: :desc).includes(:cold_storage_transfers)
- with_default_precision(0) do
  %p
    %table.table
      - projects.each_slice(15) do |project_slice|
        %thead
          %tr
            %th Project
            %th Address
            %th.money
              %abbr{title: "Total amount that was donated to the project."} Donated
            %th.money
              %abbr{title: "The balance displayed on the website. The amount of the tips is based on this value."} Available balance
            %th.money
              %abbr{title: "Tips attributed but not sent because they have not been processed yet or the author did not set an address."} Tips not sent
            %th.money
              %abbr{title: "Amount currently in cold storage (see below)."} Amount in cold storage
            %th.money
              %abbr{title: "Available balance + tips not sent - amount in cold storage."} Expected account balance
            %th.money
              %abbr{title: "The balance of the project account as reported by the Peercoin daemon."} Account balance
            %th.money
              %abbr{title: "Account balance - expected account balance. If this is negative there is a problem."} Difference
        %tbody
          - project_slice.each do |project|
            %tr
              %td
                %strong= link_to project.full_name, project
              %td
                - address_explorers.each_with_index do |explorer, i|
                  = link_to "[#{i + 1}]", address_url(project.bitcoin_address, explorer)
              %td.money= btc_human(donated   = project.deposits.map(&:amount).sum)
              %td.money= btc_human(available = project.available_amount_cache)
              %td.money= btc_human(unpaid    = project.tips.select(&:unpaid?).map(&:amount).compact.sum)
              %td.money= btc_human(cold      = project.cold_storage_amount)
              %td.money= btc_human(expected  = available + unpaid - cold) if available and unpaid and cold
              %td.money= btc_human(account   = project.account_balance)
              %td.money= btc_human(account - expected) if account and expected
      %tbody
        %tr
          %th{colspan: 2} Total
          %td.money= btc_human(donated   = projects.map(&:deposits).flatten.map(&:amount).sum)
          %td.money= btc_human(available = projects.map(&:available_amount_cache).compact.sum)
          %td.money= btc_human(unpaid    = projects.map(&:tips).flatten.select(&:unpaid?).map(&:amount).compact.sum)
          %td.money= btc_human(cold      = projects.map(&:cold_storage_amount).compact.sum)
          %td.money= btc_human(expected  = available + unpaid - cold) if available and unpaid and cold
          %td.money= btc_human(account   = projects.map(&:account_balance).compact.sum)
          %td.money= btc_human(account - expected) if account and expected

  %h2 Cold storage<commit_msg>disabled projects are grey<commit_after>%h1 Audit
- projects = Project.order(disabled: :asc, account_balance: :desc).includes(:cold_storage_transfers)
- with_default_precision(0) do
  %p
    %table.table
      - projects.each_slice(15) do |project_slice|
        %thead
          %tr
            %th Project
            %th Address
            %th.money
              %abbr{title: "Total amount that was donated to the project."} Donated
            %th.money
              %abbr{title: "The balance displayed on the website. The amount of the tips is based on this value."} Available balance
            %th.money
              %abbr{title: "Tips attributed but not sent because they have not been processed yet or because the author did not set an address."} Tips not sent
            %th.money
              %abbr{title: "Amount currently in cold storage (see below)."} Amount in cold storage
            %th.money
              %abbr{title: "Available balance + tips not sent - amount in cold storage."} Expected account balance
            %th.money
              %abbr{title: "The balance of the project account as reported by the Peercoin daemon."} Account balance
            %th.money
              %abbr{title: "Account balance - expected account balance. If this is negative there is a problem."} Difference
        %tbody
          - project_slice.each do |project|
            %tr{class: project.disabled ? "text-muted" : nil}
              %td
                %strong= link_to project.full_name, project
              %td
                - address_explorers.each_with_index do |explorer, i|
                  = link_to "[#{i + 1}]", address_url(project.bitcoin_address, explorer)
              %td.money= btc_human(donated   = project.deposits.map(&:amount).sum)
              %td.money= btc_human(available = project.available_amount_cache)
              %td.money= btc_human(unpaid    = project.tips.select(&:unpaid?).map(&:amount).compact.sum)
              %td.money= btc_human(cold      = project.cold_storage_amount)
              %td.money= btc_human(expected  = available + unpaid - cold) if available and unpaid and cold
              %td.money= btc_human(account   = project.account_balance)
              %td.money= btc_human(account - expected) if account and expected
      %tbody
        %tr
          %th{colspan: 2} Total
          %td.money= btc_human(donated   = projects.map(&:deposits).flatten.map(&:amount).sum)
          %td.money= btc_human(available = projects.map(&:available_amount_cache).compact.sum)
          %td.money= btc_human(unpaid    = projects.map(&:tips).flatten.select(&:unpaid?).map(&:amount).compact.sum)
          %td.money= btc_human(cold      = projects.map(&:cold_storage_amount).compact.sum)
          %td.money= btc_human(expected  = available + unpaid - cold) if available and unpaid and cold
          %td.money= btc_human(account   = projects.map(&:account_balance).compact.sum)
          %td.money= btc_human(account - expected) if account and expected

  %h2 Cold storage
{'fraction_non_alphanumeric': 0.10341382181515404, 'fraction_numerical': 0.002331390507910075, 'mean_word_length': 2.310915104740904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7532490', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1692, 'n_words': 464}