Search documentation of Cartouche

# Cartouche (Cartouche v0.1.3)

Copy Markdown View Source

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

## Summary

### Types

address()
bytes32()
contract()
signature()

### Functions

get_contract_address(address)

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

## Types

# address()

    @type address() :: <<_::160>>

# bytes32()

    @type bytes32() :: <<_::256>>

# contract()

    @type contract() :: address() | atom()

# signature()

    @type signature() :: <<_::520>>

## Functions

# get_contract_address(address)

    @spec get_contract_address(binary() | atom()) :: address()

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

## Examples

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

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

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