| 146 | } |
| 147 | |
| 148 | void 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 | |
| 170 | SubAssemblyID ContractCompiler::packIntoContractCreator(ContractDefinition const& _contract) |
| 171 | { |
nothing calls this directly
no test coverage detected