MCPcopy Create free account
hub / github.com/argotorg/solidity / allowedDataLocations

Method allowedDataLocations

libsolidity/ast/AST.cpp:836–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834}
835
836std::set<VariableDeclaration::Location> VariableDeclaration::allowedDataLocations() const
837{
838 using Location = VariableDeclaration::Location;
839
840 if (isStateVariable())
841 return std::set<Location>{Location::Unspecified, Location::Transient};
842 else if (!hasReferenceOrMappingType() || isEventOrErrorParameter())
843 return std::set<Location>{ Location::Unspecified };
844 else if (isCallableOrCatchParameter())
845 {
846 std::set<Location> locations{ Location::Memory };
847 if (
848 isConstructorParameter() ||
849 isInternalCallableParameter() ||
850 isLibraryFunctionParameter()
851 )
852 locations.insert(Location::Storage);
853 if (!isTryCatchParameter() && !isConstructorParameter())
854 locations.insert(Location::CallData);
855
856 return locations;
857 }
858 else if (isLocalVariable())
859 // Further restrictions will be imposed later on.
860 return std::set<Location>{ Location::Memory, Location::Storage, Location::CallData };
861 else
862 // Struct members etc.
863 return std::set<Location>{ Location::Unspecified };
864}
865
866std::string VariableDeclaration::externalIdentifierHex() const
867{

Callers 1

endVisitMethod · 0.80

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected