28
28
#include < string>
29
29
#include < vector>
30
30
31
- #include < boost/operators.hpp>
32
-
33
31
34
32
namespace solidity ::evmasm
35
33
{
@@ -44,13 +42,13 @@ namespace solidity::langutil
44
42
* A version specifier of the EVM we want to compile to.
45
43
* Defaults to the latest version deployed on Ethereum Mainnet at the time of compiler release.
46
44
*/
47
- class EVMVersion :
48
- boost::less_than_comparable<EVMVersion>,
49
- boost::equality_comparable<EVMVersion>
45
+ class EVMVersion
50
46
{
51
47
public:
52
48
EVMVersion () = default ;
53
49
50
+ static EVMVersion current () { return {currentVersion}; }
51
+
54
52
static EVMVersion homestead () { return {Version::Homestead}; }
55
53
static EVMVersion tangerineWhistle () { return {Version::TangerineWhistle}; }
56
54
static EVMVersion spuriousDragon () { return {Version::SpuriousDragon}; }
@@ -96,11 +94,10 @@ class EVMVersion:
96
94
static EVMVersion firstWithEOF () { return {Version::Osaka}; }
97
95
98
96
bool isExperimental () const {
99
- return * this > EVMVersion{} ;
97
+ return m_version > currentVersion ;
100
98
}
101
99
102
- bool operator ==(EVMVersion const & _other) const { return m_version == _other.m_version ; }
103
- bool operator <(EVMVersion const & _other) const { return m_version < _other.m_version ; }
100
+ auto operator <=>(EVMVersion const &) const = default ;
104
101
105
102
std::string name () const
106
103
{
@@ -164,10 +161,11 @@ class EVMVersion:
164
161
Prague,
165
162
Osaka,
166
163
};
164
+ static auto constexpr currentVersion = Version::Cancun;
167
165
168
166
EVMVersion (Version _version): m_version(_version) {}
169
167
170
- Version m_version = Version::Cancun ;
168
+ Version m_version = currentVersion ;
171
169
};
172
170
173
171
}
0 commit comments