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

Method interfaceFunctionType

libsolidity/ast/Types.cpp:3365–3400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3363}
3364
3365FunctionTypePointer FunctionType::interfaceFunctionType() const
3366{
3367 // Note that m_declaration might also be a state variable!
3368 solAssert(m_declaration, "Declaration needed to determine interface function type.");
3369 bool isLibraryFunction = false;
3370 if (kind() != Kind::Event && kind() != Kind::Error)
3371 if (auto const* contract = dynamic_cast<ContractDefinition const*>(m_declaration->scope()))
3372 isLibraryFunction = contract->isLibrary();
3373
3374 util::Result<TypePointers> paramTypes =
3375 transformParametersToExternal(m_parameterTypes, isLibraryFunction);
3376
3377 if (!paramTypes.message().empty())
3378 return FunctionTypePointer();
3379
3380 util::Result<TypePointers> retParamTypes =
3381 transformParametersToExternal(m_returnParameterTypes, isLibraryFunction);
3382
3383 if (!retParamTypes.message().empty())
3384 return FunctionTypePointer();
3385
3386 auto variable = dynamic_cast<VariableDeclaration const*>(m_declaration);
3387 if (variable && retParamTypes.get().empty())
3388 return FunctionTypePointer();
3389
3390 solAssert(!takesArbitraryParameters());
3391 return TypeProvider::function(
3392 paramTypes,
3393 retParamTypes,
3394 m_parameterNames,
3395 m_returnParameterNames,
3396 m_kind,
3397 m_stateMutability,
3398 m_declaration
3399 );
3400}
3401
3402MemberList::MemberMap FunctionType::nativeMembers(ASTNode const* _scope) const
3403{

Callers 4

generateMethod · 0.80
visitMethod · 0.80
AST.cppFile · 0.80

Calls 6

functionFunction · 0.85
scopeMethod · 0.80
isLibraryMethod · 0.80
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected