Etherex.Contract (Etherex v1.0.0-rc19) View Source
Types and functions related to bytecode and contracts.
Link to this section Summary
Types
Bytecode and specification of a contract.
Data of the instance of a contract deployed in a blockchain.
Functions
See Etherex.call/5
Seel Etherex.call_transaction/4.
See Etherex.compile_solidity/1.
See Etherex.deploy/3.
See Etherex.estimate_gas/4.
Given a contract, returns its address if the creation transaction has already been mined.
Given a contract, returns its deployed bytecode.
Given a contract, returns the contract creation transaction hash.
Given a contract, returns its creator address.
See Etherex.get_events/2.
Link to this section Types
Specs
bytecode() :: %{code: String.t(), interface: [ABI.FunctionSelector.t()]}
Bytecode and specification of a contract.
Specs
contract()
Data of the instance of a contract deployed in a blockchain.
Link to this section Functions
call(contract, caller, function, arguments, block_or_opts \\ :latest, opts \\ [])
View SourceSpecs
call( contract :: contract(), caller :: Etherex.Type.address(), function :: String.t(), arguments :: list(), block_or_opts :: Etherex.Type.block_parameter() | Etherex.Type.opts(), opts :: Etherex.Type.opts() ) :: {:ok, any()} | {:error, Etherex.Type.error()}
See Etherex.call/5
call_transaction(contract, caller, function, arguments, opts \\ [])
View SourceSpecs
call_transaction( contract :: contract(), caller :: Etherex.Type.address(), function :: String.t(), arguments :: list(), opts :: Etherex.Type.opts() ) :: {:ok, Etherex.Type.hash()} | {:error, Etherex.Type.error()}
Seel Etherex.call_transaction/4.
Specs
compile_solidity(String.t()) :: {:ok, bytecode()} | {:error, Etherex.Type.error()}
See Etherex.compile_solidity/1.
Specs
deploy( bytecode :: bytecode(), creator :: Etherex.Type.address(), arguments :: list(), opts :: Keyword.t() ) :: {:ok, contract()} | {:error, Etherex.Type.error()}
See Etherex.deploy/3.
Specs
estimate_gas( contract :: contract(), caller :: Etherex.Type.address(), function :: String.t(), arguments :: list(), opts :: Etherex.Type.opts() ) :: {:ok, Etherex.Type.quantity()} | {:error, Etherex.Type.error()}
See Etherex.estimate_gas/4.
Specs
get_address(contract()) :: {:ok, Etherex.Type.address() | nil} | {:error, Etherex.Type.error()}
Given a contract, returns its address if the creation transaction has already been mined.
Specs
Given a contract, returns its deployed bytecode.
Specs
get_constructor_spec(bytecode()) :: ABI.FunctionSelector.t() | nil
Specs
get_contract_address(Etherex.Type.hash()) :: {:ok, Etherex.Type.address() | nil} | {:error, Etherex.Type.error()}
Specs
get_creation_hash(contract()) :: Etherex.Type.hash()
Given a contract, returns the contract creation transaction hash.
Specs
get_creator(contract()) :: Etherex.Type.address()
Given a contract, returns its creator address.
Specs
get_event_specs(bytecode()) :: [ABI.FunctionSelector.t()]
Specs
get_events(contract :: contract(), hash :: Etherex.Type.hash()) :: {:ok, [Etherex.Type.event()]}
See Etherex.get_events/2.
Specs
get_function_spec(bytecode(), String.t()) :: ABI.FunctionSelector.t() | nil