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

Method appendInitAndConstructorCode

libsolidity/codegen/ContractCompiler.cpp:148–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void ContractCompiler::appendInitAndConstructorCode(ContractDefinition const& _contract)
149{
150 solAssert(!_contract.isLibrary(), "Tried to initialize library.");
151 CompilerContext::LocationSetter locationSetter(m_context, _contract);
152
153 m_baseArguments = &_contract.annotation().baseConstructorArguments;
154
155 // Initialization of state variables in base-to-derived order.
156 for (ContractDefinition const* contract: _contract.annotation().linearizedBaseContracts | ranges::views::reverse)
157 initializeStateVariables(*contract);
158
159 if (FunctionDefinition const* constructor = _contract.constructor())
160 appendConstructor(*constructor);
161 else
162 {
163 // Implicit constructors are always non-payable.
164 appendCallValueCheck();
165 if (auto c = _contract.nextConstructor(m_context.mostDerivedContract()))
166 appendBaseConstructor(*c);
167 }
168}
169
170SubAssemblyID ContractCompiler::packIntoContractCreator(ContractDefinition const& _contract)
171{

Callers

nothing calls this directly

Calls 3

isLibraryMethod · 0.80
nextConstructorMethod · 0.80
constructorMethod · 0.45

Tested by

no test coverage detected