aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-08-27 02:37:10 +0800
committerchriseth <c@ethdev.com>2016-09-06 03:28:28 +0800
commit962531af96a8a3ed6b28462d43c69d78fa48d511 (patch)
tree596929bcbcc12d93597067057edb3311de88af5a /libsolidity/ast
parent680b83b2a44a8f943d6d78028ad4326f4b3b64c2 (diff)
downloaddexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.tar.gz
dexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.tar.zst
dexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.zip
Merged in changes from chriseth/payable
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 938dced6..ca8490f2 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -1890,20 +1890,23 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
{
MemberList::MemberMap members;
if (m_location != Location::BareDelegateCall && m_location != Location::DelegateCall)
- members.push_back(MemberList::Member(
- "value",
- make_shared<FunctionType>(
- parseElementaryTypeVector({"uint"}),
- TypePointers{copyAndSetGasOrValue(false, true)},
- strings(),
- strings(),
- Location::SetValue,
- false,
- nullptr,
- m_gasSet,
- m_valueSet
- )
- ));
+ {
+ if (!m_declaration || m_isPayable) // If this is an actual function, it has to be payable
+ members.push_back(MemberList::Member(
+ "value",
+ make_shared<FunctionType>(
+ parseElementaryTypeVector({"uint"}),
+ TypePointers{copyAndSetGasOrValue(false, true)},
+ strings(),
+ strings(),
+ Location::SetValue,
+ false,
+ nullptr,
+ m_gasSet,
+ m_valueSet
+ )
+ ));
+ }
if (m_location != Location::Creation)
members.push_back(MemberList::Member(
"gas",