View Source Signet (Signet v1.3.8)

Signet is a library for interacting with private keys, signatures, and Etheruem.

Summary

Functions

Returns a contract address, that may have been set in configuration.

Types

@type address() :: <<_::160>>
@type bytes32() :: <<_::256>>
@type contract() :: address() | atom()
@type signature() :: <<_::520>>

Functions

Link to this function

get_contract_address(address)

View Source

Returns a contract address, that may have been set in configuration.

Examples

iex> Signet.get_contract_address(<<1::160>>)
<<1::160>>

iex> Signet.get_contract_address("0x0000000000000000000000000000000000000001")
<<1::160>>

iex> Application.put_env(:signet, :contracts, [test: "0x0000000000000000000000000000000000000001"])
iex> Signet.get_contract_address(:test)
<<1::160>>

iex> Application.put_env(:signet, :contracts, [test: "0x0000000000000000000000000000000000000001"])
iex> Signet.get_contract_address(:test_00)
** (KeyError) key :test_00 not found in: [test: "0x0000000000000000000000000000000000000001"]