ExW3.Contract (exw3 v0.6.1) View Source

Link to this section Summary

Functions

Returns the current Contract GenServer's address

Sets the address for the contract specified by the name argument

Returns a specification to start this module under a supervisor.

Deploys contracts with given arguments

Installs a filter on the Ethereum node. This also formats the parameters, and saves relevant information to format event logs.

Using saved information related to the filter id, event logs are formatted properly

Callback implementation for GenServer.init/1.

Registers the contract with the ContractManager process. Only :abi is required field.

Use a Contract's method with an eth_sendTransaction

Begins the Contract process to manage all interactions with smart contracts

Returns a formatted transaction receipt for the given transaction hash(id)

Uninstalls the filter, and deletes the data associated with the filter id

Link to this section Functions

Specs

address(atom()) :: {:ok, binary()}

Returns the current Contract GenServer's address

Specs

at(atom(), binary()) :: :ok

Sets the address for the contract specified by the name argument

Link to this function

call(contract_name, method_name, args \\ [], timeout \\ :infinity)

View Source

Specs

call(atom(), atom(), list(), any()) :: {:ok, any()}

Use a Contract's method with an eth_call

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

deploy(atom(), list()) :: {:ok, binary(), binary()}

Deploys contracts with given arguments

Link to this function

deploy_helper(bin, abi, args)

View Source
Link to this function

eth_call_helper(address, abi, method_name, args)

View Source
Link to this function

eth_send_helper(address, abi, method_name, args, options)

View Source
Link to this function

filter(contract_name, event_name, event_data \\ %{})

View Source

Specs

filter(atom(), binary(), map()) :: {:ok, binary()}

Installs a filter on the Ethereum node. This also formats the parameters, and saves relevant information to format event logs.

Link to this function

from_block_helper(event_data)

View Source
Link to this function

get_event_attributes(state, contract_name, event_name)

View Source
Link to this function

get_filter_changes(filter_id)

View Source

Specs

get_filter_changes(binary()) :: {:ok, list()}

Using saved information related to the filter id, event logs are formatted properly

Callback implementation for GenServer.init/1.

Link to this function

register(name, contract_info)

View Source

Specs

register(atom(), list()) :: :ok

Registers the contract with the ContractManager process. Only :abi is required field.

Link to this function

send(contract_name, method_name, args, options)

View Source

Specs

send(atom(), atom(), list(), map()) :: {:ok, binary()}

Use a Contract's method with an eth_sendTransaction

Begins the Contract process to manage all interactions with smart contracts

Link to this function

tx_receipt(contract_name, tx_hash)

View Source

Specs

tx_receipt(atom(), binary()) :: map()

Returns a formatted transaction receipt for the given transaction hash(id)

Link to this function

uninstall_filter(filter_id)

View Source

Specs

uninstall_filter(binary()) :: :ok

Uninstalls the filter, and deletes the data associated with the filter id