web3-ethereum-1.0.0.0: Ethereum support for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2021
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Network.Ethereum.Contract.TH

Description

Contract abstraction is a high level interface of web3 library.

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem. It can be described by specially JSON file, like ERC20.json. This module use TemplateHaskell for generation described in Abi contract methods and events. Helper functions and instances inserted in haskell module and can be used in another modules or in place.

import Network.Ethereum.Contract.TH

[abiFrom|examples/ERC20.json|]

main = do
    runWeb3 $ event' def $
       (Transfer _ to val) -> liftIO $ do print to
                                           print val

Full code example available in examples folder.

Synopsis

The contract quasiquoters

abi :: QuasiQuoter Source #

QQ reader for contract Abi

abiFrom :: QuasiQuoter Source #

Read contract Abi from file