huginn_callisto_network_agent 0.1.81 → 0.1.83
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ed5f76f3114c8521b24a4cb7261420b6bb6bba9f2c24d6355eb2285968af44b
|
4
|
+
data.tar.gz: e458bc227bb0fe55f0ca99c4ff5110fffd689fc50bd58b6c85937eddb8c4ac29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa68db11f70f7776d15b4f4b79b0561cdba4f797749b6e20ba1b42351552e4e2988820d0421fe3df88cddd622a9c18f2f385095950061875bb78952a02aab432
|
7
|
+
data.tar.gz: 0d69632d689c76f2ffca506ea8eae98c2612a318db39b1d97c61cf7b9566c8a361e465820554f1315ec5c546a0ecef31ab8b3de719eb9e052b4bb17f3513f38a
|
@@ -195,6 +195,25 @@ module Agents
|
|
195
195
|
return found_symbol
|
196
196
|
end
|
197
197
|
|
198
|
+
def owner_finder(address=interpolated['wallet'])
|
199
|
+
|
200
|
+
db = SQLite3::Database.new(interpolated['sql_db'])
|
201
|
+
result = db.get_first_row('SELECT name FROM directory WHERE address = ?', address)
|
202
|
+
db.close
|
203
|
+
|
204
|
+
if result
|
205
|
+
if interpolated['debug'] == 'true'
|
206
|
+
log "#{result[0]} found in sqldb"
|
207
|
+
end
|
208
|
+
return result[0]
|
209
|
+
else
|
210
|
+
if interpolated['debug'] == 'true'
|
211
|
+
log "nothing found in sqldb"
|
212
|
+
end
|
213
|
+
return nil
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
198
217
|
def function_finder(contract_address=interpolated['wallet'],bytes_signature)
|
199
218
|
|
200
219
|
db = SQLite3::Database.new(interpolated['sql_db'])
|
@@ -432,6 +451,7 @@ module Agents
|
|
432
451
|
slotmachine_address = '0x7777265dc7fd2a15a7f2e8d8ad87b3daec677777'
|
433
452
|
twobears_address = '0x78afc46df1d3eb5cff7044d288a453fe43e17310'
|
434
453
|
vipwarz_address = '0x2f48b8887d2d5d5b718c9f6516b44ba1c1bb8db1'
|
454
|
+
dead_address = '0x000000000000000000000000000000000000dead'
|
435
455
|
internal = true
|
436
456
|
tx_list = []
|
437
457
|
burnt_ether = 0
|
@@ -440,11 +460,21 @@ module Agents
|
|
440
460
|
gas_used = transactions['result']['gasUsed'].to_i(16)
|
441
461
|
transactions['result']['transactions'].each do |tx|
|
442
462
|
if !tx.empty?
|
443
|
-
gas_price = tx['gasPrice'].to_i(16)
|
444
|
-
fees = gas_price * gas_used.to_f / 10**18
|
445
463
|
tx_list << tx
|
464
|
+
if tx['type'] == "0x2"
|
465
|
+
gas_price = tx['gasPrice'].to_i(16)
|
466
|
+
fees = gas_price * gas_used.to_f / 10**18
|
467
|
+
else
|
468
|
+
fees = 0
|
469
|
+
end
|
470
|
+
if tx['to'] == dead_address
|
471
|
+
burnt = tx['value'].to_i(16) / 10**18
|
472
|
+
else
|
473
|
+
burnt = 0
|
474
|
+
end
|
446
475
|
end
|
447
476
|
burnt_ether += fees
|
477
|
+
burnt_ether += burnt
|
448
478
|
end
|
449
479
|
end
|
450
480
|
top_tx = most_common_from(tx_list)
|
@@ -538,6 +568,14 @@ module Agents
|
|
538
568
|
if !transaction['call_type'].present?
|
539
569
|
transaction['call_type'] = function_finder(transaction['to'],transaction['input'][0, 10])
|
540
570
|
end
|
571
|
+
find_to = owner_finder(transaction['to'])
|
572
|
+
if !find_to.nil?
|
573
|
+
transaction['to_resolved'] = find_to
|
574
|
+
end
|
575
|
+
find_from = owner_finder(transaction['from'])
|
576
|
+
if !find_from.nil?
|
577
|
+
transaction['from_resolved'] = find_from
|
578
|
+
end
|
541
579
|
end
|
542
580
|
# log "#{transaction['input'][0, 10]} -> #{function_finder(transaction['to'],true,transaction['input'][0, 10])}"
|
543
581
|
create_event payload: transaction
|
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.
|
4
|
+
version: 0.1.83
|
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-
|
11
|
+
date: 2024-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|