Copyright | Aleksandr Krupenkin 2016-2021 |
---|---|
License | Apache-2.0 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
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
- abi :: QuasiQuoter
- abiFrom :: QuasiQuoter
The contract quasiquoters
abi :: QuasiQuoter Source #
QQ reader for contract Abi
abiFrom :: QuasiQuoter Source #
Read contract Abi from file