aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-28 20:35:28 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-29 02:43:35 +0800
commitaa94000a91be455af7b9436db172ffa86cc57494 (patch)
treeeddf4760044af0ee25f7c6cff8f3fa4275358a52 /libsolidity/ast
parent3d228e98f1fe9dfdbebab2537eb1d8bcc1340d0b (diff)
downloaddexon-solidity-aa94000a91be455af7b9436db172ffa86cc57494.tar.gz
dexon-solidity-aa94000a91be455af7b9436db172ffa86cc57494.tar.zst
dexon-solidity-aa94000a91be455af7b9436db172ffa86cc57494.zip
Mark all built in functions with appropriate statemutability
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 65b09840..4bffd9a5 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -2569,6 +2569,8 @@ u256 FunctionType::externalIdentifier() const
bool FunctionType::isPure() const
{
+ // FIXME: replace this with m_stateMutability == StateMutability::Pure once
+ // the callgraph analyzer is in place
return
m_kind == Kind::SHA3 ||
m_kind == Kind::ECRecover ||
@@ -2865,7 +2867,7 @@ MemberList::MemberMap MagicType::nativeMembers(ContractDefinition const*) const
return MemberList::MemberMap({
{"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
{"timestamp", make_shared<IntegerType>(256)},
- {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Kind::BlockHash)},
+ {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Kind::BlockHash, false, StateMutability::View)},
{"difficulty", make_shared<IntegerType>(256)},
{"number", make_shared<IntegerType>(256)},
{"gaslimit", make_shared<IntegerType>(256)}