Add abi.encode, abi.encodePacked, abi.encodeWithSelector and abi.encodeWithSignature.

This commit is contained in:
Alex Beregszaszi authored and chriseth committed 2018-04-11 22:32:10 +02:00
1 parent ee5d0ef79b
commit d56acb68ab
7 files changed
+287 -4

No files matched your search

+6 -1
View File
@@ -305,10 +305,15 @@ void ViewPureChecker::endVisit(MemberAccess const& _memberAccess)
mutability = StateMutability::View;
break;
case Type::Category::Magic:
{
// we can ignore the kind of magic and only look at the name of the member
if (member != "data" && member != "sig" && member != "blockhash")
set<string> static const pureMembers{
"encode", "encodePacked", "encodeWithSelector", "encodeWithSignature", "data", "sig", "blockhash"
};
if (!pureMembers.count(member))
mutability = StateMutability::View;
break;
}
case Type::Category::Struct:
{
if (_memberAccess.expression().annotation().type->dataStoredIn(DataLocation::Storage))