View Source Etherex.Contract (Etherex v1.1.0)
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
@type bytecode() :: %{code: String.t(), interface: [ABI.FunctionSelector.t()]}
Bytecode and specification of a contract.
@opaque 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 Source@spec 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 Source@spec 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.
@spec compile_solidity(String.t()) :: {:ok, bytecode()} | {:error, Etherex.Type.error()}
See Etherex.compile_solidity/1.
@spec deploy( bytecode :: bytecode(), creator :: Etherex.Type.address(), arguments :: list(), opts :: Keyword.t() ) :: {:ok, contract()} | {:error, Etherex.Type.error()}
See Etherex.deploy/3.
@spec 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.
@spec 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.
Given a contract, returns its deployed bytecode.
@spec get_constructor_spec(bytecode()) :: ABI.FunctionSelector.t() | nil
@spec get_contract_address(Etherex.Type.hash()) :: {:ok, Etherex.Type.address() | nil} | {:error, Etherex.Type.error()}
@spec get_creation_hash(contract()) :: Etherex.Type.hash()
Given a contract, returns the contract creation transaction hash.
@spec get_creator(contract()) :: Etherex.Type.address()
Given a contract, returns its creator address.
@spec get_event_specs(bytecode()) :: [ABI.FunctionSelector.t()]
@spec get_events( bytecode_or_contract :: bytecode() | contract(), hash :: Etherex.Type.hash() ) :: {:ok, [Etherex.Type.event()]}
See Etherex.get_events/2.
@spec get_function_spec(bytecode(), String.t()) :: ABI.FunctionSelector.t() | nil