class Ethereum::Function

Attributes

constant[RW]
function_string[RW]
inputs[RW]
name[RW]
outputs[RW]
signature[RW]

Public Class Methods

new(data) click to toggle source
# File lib/ethereumex/function.rb, line 6
def initialize(data)
  @name = data["name"]
  @constant = data["constant"]
  @inputs = data["inputs"].collect do |input|
    Ethereum::FunctionInput.new(input)
  end
  @outputs = data["outputs"].collect do |output|
    Ethereum::FunctionOutput.new(output)
  end
  @function_string = "#{@name}(#{@inputs.collect {|x| x.type }.join(",")})"
  @signature = Digest::SHA3.hexdigest(@function_string, 256)[0..7]
end