View Source Ethers (Ethers v0.0.1-dev)

Documentation for Ethers.

Link to this section Summary

Functions

Returns the current gas price from the RPC API

Returns the address of the deployed contract if the deployment is finished and successful

Estimates gas for a eth_call

Returns the event logs with the given filter

Link to this section Functions

@spec current_gas_price() :: {:ok, non_neg_integer()}

Returns the current gas price from the RPC API

Link to this function

deploy(contract_module_or_binary, contract_init, params, opts \\ [])

View Source

Deploys a contract to the blockchain.

This will return the transaction hash for the deployment transaction. To get the address of your deployed contract, use Ethers.deployed_address/2.

parameters

Parameters

  • contract_module_or_binary: Either the contract module which was already loaded or the compiled binary of the contract.
  • contract_init: Constructor value for contract deployment. Use CONTRACT_MODULE.constructor function's output.
  • opts: RPC and account options.
Link to this function

deployed_address(tx_hash, opts \\ [])

View Source
@spec deployed_address(binary(), Keyword.t()) ::
  {:ok, Ethers.Types.t_address()}
  | {:error, :no_contract_address | :transaction_not_found | atom()}

Returns the address of the deployed contract if the deployment is finished and successful

parameters

Parameters

  • tx_hash: Hash of the Transaction which created a contract.
  • opts: RPC and account options.
Link to this function

estimate_gas(params, opts \\ [])

View Source
@spec estimate_gas(map(), Keyword.t()) ::
  {:ok, non_neg_integer()} | {:error, :gas_estimation_failed}

Estimates gas for a eth_call

parameters

Parameters

  • params
  • opts: RPC and account options.
Link to this function

get_logs(params, overrides \\ [], opts \\ [])

View Source
@spec get_logs(map(), Keyword.t(), Keyword.t()) :: {:ok, [map()]} | {:error, atom()}

Returns the event logs with the given filter