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

Function contractStorageSizeUpperBound

libsolidity/ast/ASTUtils.cpp:111–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bigint contractStorageSizeUpperBound(ContractDefinition const& _contract, VariableDeclaration::Location _location)
112{
113 solAssert(_location == VariableDeclaration::Location::Unspecified || _location == VariableDeclaration::Location::Transient);
114
115 bigint size = 0;
116 for (ContractDefinition const* contract: _contract.annotation().linearizedBaseContracts)
117 for (VariableDeclaration const* variable: contract->stateVariables())
118 if (
119 !(variable->isConstant() || variable->immutable()) &&
120 variable->referenceLocation() == _location
121 )
122 size += variable->annotation().type->storageSizeUpperBound();
123
124 return size;
125}
126
127u256 layoutBaseForInheritanceHierarchy(ContractDefinition const& _topLevelContract, DataLocation _location)
128{

Calls 5

immutableMethod · 0.80
referenceLocationMethod · 0.80
stateVariablesMethod · 0.45
isConstantMethod · 0.45
storageSizeUpperBoundMethod · 0.45

Tested by

no test coverage detected