From 36a567cd61bf88a5b23ceb9d7eee97f1a3069f80 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 18 Jun 2016 10:56:01 +0100 Subject: Introduce fallback entry in the ABI --- libsolidity/interface/InterfaceHandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libsolidity') diff --git a/libsolidity/interface/InterfaceHandler.cpp b/libsolidity/interface/InterfaceHandler.cpp index f5c10356..5d24e1bf 100644 --- a/libsolidity/interface/InterfaceHandler.cpp +++ b/libsolidity/interface/InterfaceHandler.cpp @@ -74,7 +74,15 @@ string InterfaceHandler::abiInterface(ContractDefinition const& _contractDef) ); abi.append(method); } - + if (_contractDef.fallbackFunction()) + { + auto externalFunctionType = FunctionType(*_contractDef.fallbackFunction()).interfaceFunctionType(); + solAssert(!!externalFunctionType, ""); + Json::Value method; + method["type"] = "fallback"; + method["constant"] = externalFunctionType->isConstant(); + abi.append(method); + } for (auto const& it: _contractDef.interfaceEvents()) { Json::Value event; -- cgit v1.2.3