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

Function arraySize

test/libsolidity/util/ContractABIUtils.cpp:50–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48using ParameterList = solidity::frontend::test::ParameterList;
49
50size_t arraySize(std::string const& _arrayType)
51{
52 auto leftBrack = _arrayType.find("[");
53 auto rightBrack = _arrayType.rfind("]");
54
55 soltestAssert(
56 leftBrack != std::string::npos &&
57 rightBrack != std::string::npos &&
58 rightBrack == _arrayType.size() - 1 &&
59 leftBrack < rightBrack,
60 ""
61 );
62
63 std::string size = _arrayType.substr(leftBrack + 1, rightBrack - leftBrack - 1);
64
65 return static_cast<size_t>(stoi(size));
66}
67
68bool isBool(std::string const& _type)
69{

Callers 1

appendTypesFromNameMethod · 0.85

Calls 2

findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected