huginn_callisto_network_agent 0.1.82 → 0.1.84

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e54c7e79bf9a6e80602514a29a0e229c26d7738a3b6283692032384e514db602
4
- data.tar.gz: 771ddcf73e1c48ef07bfd06d6a980f781aadb6cfa3f4795f4016cdcdfaf8684a
3
+ metadata.gz: 6347392197009dec8851be8b8aa60bec647ba0b3139411f2a70eb43ab90468d9
4
+ data.tar.gz: a0d9fa5cc02c1ff40af63ccb7a6fc80708d5d865f966915d258648588d9a4002
5
5
  SHA512:
6
- metadata.gz: a1834915b6048d07b11bee7feb6152a87dcebbf51ef7efa63e26681cb928c1f1fa3e740825a72c40444cb4fb2e7dfb52cd77351057c1d6fe0db98b00ed87263d
7
- data.tar.gz: fcd37ff91e213cf5e2461fe12ff549998f2aba3d9dcad626ccabd9634a0b8036a358d7da3a2307eed1ae54ffff1cccbf2452fdee9d94f2358b43c62497b6709a
6
+ metadata.gz: 38c76efc882a2b939ea0e7518d6fbee1c6b83f37a438be2adafe1af00e974f9f17298f3cc6f19e8783465ddad0c436bd62ddbcfab73608189f1f6dbd1b5f35e2
7
+ data.tar.gz: cecb584921dcc14bdd3b4ebb996d1abcace256c5644d6f2606bc4edf3e0af35db9a969c191df902d7e34767c646d5098b460410a42ebc83fd94a018050ab9e29
@@ -451,21 +451,36 @@ module Agents
451
451
  slotmachine_address = '0x7777265dc7fd2a15a7f2e8d8ad87b3daec677777'
452
452
  twobears_address = '0x78afc46df1d3eb5cff7044d288a453fe43e17310'
453
453
  vipwarz_address = '0x2f48b8887d2d5d5b718c9f6516b44ba1c1bb8db1'
454
+ dead_address = '0x000000000000000000000000000000000000dead'
454
455
  internal = true
455
456
  tx_list = []
456
- burnt_ether = 0
457
+ burnt_clo = 0
458
+ burnt_type2 = 0
459
+ burnt_dead = 0
457
460
  (interpolated['first_block']..interpolated['last_block']).each do |i|
458
461
  transactions = get_data(i.to_i,internal)
459
- gas_used = transactions['result']['gasUsed'].to_i(16)
460
462
  transactions['result']['transactions'].each do |tx|
461
463
  if !tx.empty?
462
- gas_price = tx['gasPrice'].to_i(16)
463
- fees = gas_price * gas_used.to_f / 10**18
464
464
  tx_list << tx
465
+ if tx['type'] == "0x2"
466
+ gas_fee = transactions['result']['baseFeePerGas'].to_i(16)
467
+ fees = ( transactions['result']['gasUsed'].to_i(16) * gas_fee.to_f ) / (10 ** 18)
468
+ log gas_fee
469
+ log fees
470
+ else
471
+ fees = 0
472
+ end
473
+ if tx['to'] == dead_address
474
+ burnt = tx['value'].to_i(16).to_f / 10**18
475
+ else
476
+ burnt = 0
477
+ end
465
478
  end
466
- burnt_ether += fees
479
+ burnt_type2 += fees
480
+ burnt_dead += burnt
467
481
  end
468
482
  end
483
+ burnt_clo = ( burnt_type2 / tx_list.count ) + burnt_dead
469
484
  top_tx = most_common_from(tx_list)
470
485
  top_count = tx_list.count { |hash| hash['from'] == top_tx }
471
486
  miners_count = tx_list.select { |hash| all_miners.include?(hash['from']) }
@@ -479,7 +494,7 @@ module Agents
479
494
  active = tx_list.map { |p| p['from'] }.uniq.count
480
495
  # log "top_count : #{top_count}"
481
496
  # log "total : #{tx_list.count}"
482
- create_event :payload => { 'total_tx' => "#{tx_list.count}", 'total_active' => "#{active}", 'burnt_clo' => "#{burnt_ether}", 'top_wallet': {'address' => "#{top_tx}", 'percentage' => "#{percentage(top_count.to_i,tx_list.count.to_i)}"}, 'shitty': {'address': 'shitty', 'shitty_percentage' => "#{percentage(shitty_count.count,tx_list.count.to_i)}"}, 'miners': {'address': "miners", 'percentage' => "#{percentage(miners_count.count,tx_list.count.to_i)}"}, 'callosha': {'address': callosha_address, 'percentage' => "#{percentage(callosha_count.count,tx_list.count.to_i)}"}, 'twobears': {'address': twobears_address, 'percentage' => "#{percentage(twobears_count.count,tx_list.count.to_i)}"}, 'vipwarz': {'address': vipwarz_address, 'percentage' => "#{percentage(vipwarz_count.count,tx_list.count.to_i)}"}, 'slotmachine': {'address': slotmachine_address, 'percentage' => "#{percentage(slotmachine_count.count,tx_list.count.to_i)}"}}
497
+ create_event :payload => { 'total_tx' => "#{tx_list.count}", 'total_active' => "#{active}", 'burnt_clo' => "#{burnt_clo}", 'top_wallet': {'address' => "#{top_tx}", 'percentage' => "#{percentage(top_count.to_i,tx_list.count.to_i)}"}, 'shitty': {'address': 'shitty', 'shitty_percentage' => "#{percentage(shitty_count.count,tx_list.count.to_i)}"}, 'miners': {'address': "miners", 'percentage' => "#{percentage(miners_count.count,tx_list.count.to_i)}"}, 'callosha': {'address': callosha_address, 'percentage' => "#{percentage(callosha_count.count,tx_list.count.to_i)}"}, 'twobears': {'address': twobears_address, 'percentage' => "#{percentage(twobears_count.count,tx_list.count.to_i)}"}, 'vipwarz': {'address': vipwarz_address, 'percentage' => "#{percentage(vipwarz_count.count,tx_list.count.to_i)}"}, 'slotmachine': {'address': slotmachine_address, 'percentage' => "#{percentage(slotmachine_count.count,tx_list.count.to_i)}"}}
483
498
 
484
499
  end
485
500
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huginn_callisto_network_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.82
4
+ version: 0.1.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Germain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-03 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler