mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ABI encoding functions are pure and should be usable in constants.
This commit is contained in:
@@ -2865,7 +2865,11 @@ bool FunctionType::isPure() const
|
||||
m_kind == Kind::RIPEMD160 ||
|
||||
m_kind == Kind::AddMod ||
|
||||
m_kind == Kind::MulMod ||
|
||||
m_kind == Kind::ObjectCreation;
|
||||
m_kind == Kind::ObjectCreation ||
|
||||
m_kind == Kind::ABIEncode ||
|
||||
m_kind == Kind::ABIEncodePacked ||
|
||||
m_kind == Kind::ABIEncodeWithSelector ||
|
||||
m_kind == Kind::ABIEncodeWithSignature;
|
||||
}
|
||||
|
||||
TypePointers FunctionType::parseElementaryTypeVector(strings const& _types)
|
||||
|
||||
@@ -1046,8 +1046,8 @@ public:
|
||||
return *m_declaration;
|
||||
}
|
||||
bool hasDeclaration() const { return !!m_declaration; }
|
||||
/// @returns true if the result of this function only depends on its arguments
|
||||
/// and it does not modify the state.
|
||||
/// @returns true if the result of this function only depends on its arguments,
|
||||
/// does not modify the state and is a compile-time constant.
|
||||
/// Currently, this will only return true for internal functions like keccak and ecrecover.
|
||||
bool isPure() const;
|
||||
bool isPayable() const { return m_stateMutability == StateMutability::Payable; }
|
||||
|
||||
Reference in New Issue
Block a user