aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/ABI.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-17 17:38:29 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-15 18:35:50 +0800
commit12f3257e7d0e23502eb01a28c857ed56d9d2dbdc (patch)
tree1a083e630b49b771edb7ed5acc60f9b696bbf5ff /libsolidity/interface/ABI.cpp
parentdca1f45cb7a45a85a1a8206254de23342a870101 (diff)
downloaddexon-solidity-12f3257e7d0e23502eb01a28c857ed56d9d2dbdc.tar.gz
dexon-solidity-12f3257e7d0e23502eb01a28c857ed56d9d2dbdc.tar.zst
dexon-solidity-12f3257e7d0e23502eb01a28c857ed56d9d2dbdc.zip
Add statemutability field to the ABI
Diffstat (limited to 'libsolidity/interface/ABI.cpp')
-rw-r--r--libsolidity/interface/ABI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/interface/ABI.cpp b/libsolidity/interface/ABI.cpp
index 12f958fc..9fc2f4e8 100644
--- a/libsolidity/interface/ABI.cpp
+++ b/libsolidity/interface/ABI.cpp
@@ -38,6 +38,7 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
method["name"] = it.second->declaration().name();
method["constant"] = it.second->isConstant();
method["payable"] = it.second->isPayable();
+ method["statemutability"] = stateMutabilityToString(it.second->stateMutability());
method["inputs"] = formatTypeList(
externalFunctionType->parameterNames(),
externalFunctionType->parameterTypes(),
@@ -57,6 +58,7 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
auto externalFunction = FunctionType(*_contractDef.constructor(), false).interfaceFunctionType();
solAssert(!!externalFunction, "");
method["payable"] = externalFunction->isPayable();
+ method["statemutability"] = stateMutabilityToString(externalFunction->stateMutability());
method["inputs"] = formatTypeList(
externalFunction->parameterNames(),
externalFunction->parameterTypes(),
@@ -71,6 +73,7 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef)
Json::Value method;
method["type"] = "fallback";
method["payable"] = externalFunctionType->isPayable();
+ method["statemutability"] = stateMutabilityToString(externalFunctionType->stateMutability());
abi.append(method);
}
for (auto const& it: _contractDef.interfaceEvents())