@@ -58,10 +58,11 @@ class EVMVersion:
58
58
static EVMVersion berlin () { return {Version::Berlin}; }
59
59
static EVMVersion london () { return {Version::London}; }
60
60
static EVMVersion paris () { return {Version::Paris}; }
61
+ static EVMVersion shanghai () { return {Version::Shanghai}; }
61
62
62
63
static std::optional<EVMVersion> fromString (std::string const & _version)
63
64
{
64
- for (auto const & v: {homestead (), tangerineWhistle (), spuriousDragon (), byzantium (), constantinople (), petersburg (), istanbul (), berlin (), london (), paris ()})
65
+ for (auto const & v: {homestead (), tangerineWhistle (), spuriousDragon (), byzantium (), constantinople (), petersburg (), istanbul (), berlin (), london (), paris (), shanghai () })
65
66
if (_version == v.name ())
66
67
return v;
67
68
return std::nullopt;
@@ -84,6 +85,7 @@ class EVMVersion:
84
85
case Version::Berlin: return " berlin" ;
85
86
case Version::London: return " london" ;
86
87
case Version::Paris: return " paris" ;
88
+ case Version::Shanghai: return " shanghai" ;
87
89
}
88
90
return " INVALID" ;
89
91
}
@@ -98,6 +100,7 @@ class EVMVersion:
98
100
bool hasSelfBalance () const { return *this >= istanbul (); }
99
101
bool hasBaseFee () const { return *this >= london (); }
100
102
bool hasPrevRandao () const { return *this >= paris (); }
103
+ bool hasPush0 () const { return *this >= shanghai (); }
101
104
102
105
bool hasOpcode (evmasm::Instruction _opcode) const ;
103
106
@@ -106,7 +109,7 @@ class EVMVersion:
106
109
bool canOverchargeGasForCall () const { return *this >= tangerineWhistle (); }
107
110
108
111
private:
109
- enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople, Petersburg, Istanbul, Berlin, London, Paris };
112
+ enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople, Petersburg, Istanbul, Berlin, London, Paris, Shanghai };
110
113
111
114
EVMVersion (Version _version): m_version(_version) {}
112
115
0 commit comments