2019-05-15 19:09:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libsolidity/interface/CompilerStack.h>
|
2019-07-16 09:11:20 +00:00
|
|
|
|
2019-05-15 19:09:44 +00:00
|
|
|
#include <libyul/AssemblyStack.h>
|
2019-07-16 09:11:20 +00:00
|
|
|
|
2019-05-15 19:09:44 +00:00
|
|
|
#include <liblangutil/Exceptions.h>
|
|
|
|
#include <liblangutil/SourceReferenceFormatter.h>
|
2019-07-16 09:11:20 +00:00
|
|
|
|
2020-01-06 10:52:23 +00:00
|
|
|
#include <libsolutil/Keccak256.h>
|
2019-05-15 19:09:44 +00:00
|
|
|
|
2019-12-23 15:50:30 +00:00
|
|
|
namespace solidity::test::abiv2fuzzer
|
2019-05-15 19:09:44 +00:00
|
|
|
{
|
2019-12-23 15:50:30 +00:00
|
|
|
|
2019-05-15 19:09:44 +00:00
|
|
|
class SolidityCompilationFramework
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit SolidityCompilationFramework(langutil::EVMVersion _evmVersion = {});
|
|
|
|
|
|
|
|
Json::Value getMethodIdentifiers()
|
|
|
|
{
|
|
|
|
return m_compiler.methodIdentifiers(m_compiler.lastContractName());
|
|
|
|
}
|
2019-12-23 15:50:30 +00:00
|
|
|
bytes compileContract(
|
2019-05-15 19:09:44 +00:00
|
|
|
std::string const& _sourceCode,
|
2020-04-20 12:28:38 +00:00
|
|
|
std::string const& _contractName,
|
|
|
|
std::map<std::string, solidity::util::h160> const& _libraryAddresses = {},
|
|
|
|
frontend::OptimiserSettings _optimization = frontend::OptimiserSettings::minimal()
|
2019-05-15 19:09:44 +00:00
|
|
|
);
|
|
|
|
protected:
|
2019-12-23 15:50:30 +00:00
|
|
|
frontend::CompilerStack m_compiler;
|
2019-05-15 19:09:44 +00:00
|
|
|
langutil::EVMVersion m_evmVersion;
|
|
|
|
};
|
2019-12-23 15:50:30 +00:00
|
|
|
|
2019-05-15 19:09:44 +00:00
|
|
|
}
|