Copyright | Alexander Krupenkin 2016 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Ethereum smart contract JSON ABI types.
- newtype ContractABI = ContractABI {
- unABI :: [Declaration]
- data Declaration
- = DConstructor {
- conInputs :: [FunctionArg]
- | DFunction {
- funName :: Text
- funConstant :: Bool
- funInputs :: [FunctionArg]
- funOutputs :: Maybe [FunctionArg]
- | DEvent { }
- | DFallback {
- falPayable :: Bool
- = DConstructor {
- data FunctionArg = FunctionArg {
- funArgName :: Text
- funArgType :: Text
- data EventArg = EventArg {
- eveArgName :: Text
- eveArgType :: Text
- eveArgIndexed :: Bool
- signature :: Declaration -> Text
- methodId :: Declaration -> Text
- eventId :: Declaration -> Text
Documentation
newtype ContractABI Source #
Contract ABI is a list of method / event declarations
ContractABI | |
|
data Declaration Source #
Elementrary contract interface item
DConstructor | Contract constructor |
| |
DFunction | Method |
| |
DEvent | Event |
DFallback | Fallback function |
|
data FunctionArg Source #
Method argument
FunctionArg | |
|
Event argument
EventArg | |
|
signature :: Declaration -> Text Source #
Take a signature by given decl, e.g. foo(uint,string)
methodId :: Declaration -> Text Source #
Generate method selector by given method Delcaration
eventId :: Declaration -> Text Source #
Generate event topic0
hash by givent event Delcaration