mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add abi.encode, abi.encodePacked, abi.encodeWithSelector and abi.encodeWithSignature.
This commit is contained in:
1 parent
ee5d0ef79b
commit
d56acb68ab
7 files changed
+287
-4
No files matched your search
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user