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

Function hasPayableFunctions

libsolidity/codegen/ContractCompiler.cpp:393–407  ·  view source on GitHub ↗

Helper function to check if any function is payable

Source from the content-addressed store, hash-verified

391
392// Helper function to check if any function is payable
393bool hasPayableFunctions(ContractDefinition const& _contract)
394{
395 if (_contract.receiveFunction())
396 return true;
397
398 FunctionDefinition const* fallback = _contract.fallbackFunction();
399 if (fallback && fallback->isPayable())
400 return true;
401
402 for (auto const& it: _contract.interfaceFunctions())
403 if (it.second->isPayable())
404 return true;
405
406 return false;
407}
408
409}
410

Callers 1

Calls 4

receiveFunctionMethod · 0.80
fallbackFunctionMethod · 0.80
interfaceFunctionsMethod · 0.80
isPayableMethod · 0.45

Tested by

no test coverage detected