mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fuzzer: Permit linking of libraries in compilation framework
This commit is contained in:
parent
c24c4f85e4
commit
ea5b64ca9e
@ -9,13 +9,16 @@ SolidityCompilationFramework::SolidityCompilationFramework(langutil::EVMVersion
|
||||
|
||||
solidity::bytes SolidityCompilationFramework::compileContract(
|
||||
std::string const& _sourceCode,
|
||||
std::string const& _contractName
|
||||
std::string const& _contractName,
|
||||
std::map<std::string, solidity::util::h160> const& _libraryAddresses,
|
||||
frontend::OptimiserSettings _optimization
|
||||
)
|
||||
{
|
||||
std::string sourceCode = _sourceCode;
|
||||
m_compiler.setSources({{"", sourceCode}});
|
||||
m_compiler.setLibraries(_libraryAddresses);
|
||||
m_compiler.setEVMVersion(m_evmVersion);
|
||||
m_compiler.setOptimiserSettings(m_optimiserSettings);
|
||||
m_compiler.setOptimiserSettings(_optimization);
|
||||
if (!m_compiler.compile())
|
||||
{
|
||||
langutil::SourceReferenceFormatter formatter(std::cerr);
|
||||
|
@ -23,12 +23,13 @@ public:
|
||||
}
|
||||
bytes compileContract(
|
||||
std::string const& _sourceCode,
|
||||
std::string const& _contractName = {}
|
||||
std::string const& _contractName,
|
||||
std::map<std::string, solidity::util::h160> const& _libraryAddresses = {},
|
||||
frontend::OptimiserSettings _optimization = frontend::OptimiserSettings::minimal()
|
||||
);
|
||||
protected:
|
||||
frontend::CompilerStack m_compiler;
|
||||
langutil::EVMVersion m_evmVersion;
|
||||
frontend::OptimiserSettings m_optimiserSettings = frontend::OptimiserSettings::none();
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user