class Eth::Client

def call(contract, function, *args, **kwargs)

Returns:
  • (Object) - returns the result of the call.

Parameters:
  • **gas_limit (Integer) -- optional gas limit override for deploying the contract.
  • **legacy (Boolean) -- enables legacy transactions (pre-EIP-1559).
  • **sender_key (Eth::Key) -- the sender private key.
  • *args () -- optional function arguments.
  • function (String) -- method name to be called.
  • contract (Eth::Contract) -- the subject contract to call.
  • *args () -- optional function arguments.
  • function (String) -- method name to be called.
  • contract (Eth::Contract) -- the subject contract to call.
  • function (String) -- method name to be called.
  • contract (Eth::Contract) -- the subject contract to call.

Overloads:
  • call(contract, function, *args, **kwargs)
  • call(contract, function, *args)
  • call(contract, function)
def call(contract, function, *args, **kwargs)
  func = contract.functions.select { |func| func.name == function }[0]
  raise ArgumentError, "this function does not exist!" if func.nil?
  output = call_raw(contract, func, *args, **kwargs)
  if output&.length == 1
    return output[0]
  else
    return output
  end
end