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

Method asExternallyCallableFunction

libsolidity/ast/Types.cpp:3771–3809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3769}
3770
3771FunctionTypePointer FunctionType::asExternallyCallableFunction(bool _inLibrary) const
3772{
3773 TypePointers parameterTypes;
3774 for (auto const& t: m_parameterTypes)
3775 if (TypeProvider::isReferenceWithLocation(t, DataLocation::CallData))
3776 parameterTypes.push_back(
3777 TypeProvider::withLocationIfReference(DataLocation::Memory, t, true)
3778 );
3779 else
3780 parameterTypes.push_back(t);
3781
3782 TypePointers returnParameterTypes;
3783 for (auto const& returnParamType: m_returnParameterTypes)
3784 if (TypeProvider::isReferenceWithLocation(returnParamType, DataLocation::CallData))
3785 returnParameterTypes.push_back(
3786 TypeProvider::withLocationIfReference(DataLocation::Memory, returnParamType, true)
3787 );
3788 else
3789 returnParameterTypes.push_back(returnParamType);
3790
3791 Kind kind = m_kind;
3792 if (_inLibrary)
3793 {
3794 solAssert(!!m_declaration, "Declaration has to be available.");
3795 solAssert(m_declaration->isPublic(), "");
3796 kind = Kind::DelegateCall;
3797 }
3798
3799 return TypeProvider::function(
3800 parameterTypes,
3801 returnParameterTypes,
3802 m_parameterNames,
3803 m_returnParameterNames,
3804 kind,
3805 m_stateMutability,
3806 m_declaration,
3807 Options::fromFunctionType(*this)
3808 );
3809}
3810
3811Type const* FunctionType::selfType() const
3812{

Callers 10

externalFunctionTypeMethod · 0.80
nativeMembersMethod · 0.80
typeViaContractNameMethod · 0.80
AST.cppFile · 0.80
SMTEncoder.cppFile · 0.80
visitMethod · 0.80
endVisitMethod · 0.80

Calls 2

functionFunction · 0.85
isPublicMethod · 0.80

Tested by

no test coverage detected