10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/abiparser/utils.rb', line 10
def support?( selectors, sig )
if sig.is_a?( Interface )
iface = sig
iface.selectors.each do |sighash|
unless selectors.include?( sighash )
puts " sighash >#{sighash}< not found in interface"
return false
end
end
true
else
sighash = if m=SIGHASH_RX.match( sig )
m[:sighash].downcase else
sig = sig.gsub( /[ \r\t\n]/, '' )
keccak256( sig )[0,4].hexdigest
end
selectors.include?( sighash ) ? true : false
end
end
|