HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Moduleweb3-ethereum-1.1.0.1Haskell2010

Network.Ethereum.Contract.TH

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.

  • 2 values

The contract quasiquoters

2 declarations