Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/tools/ossfuzz/protoToYul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ EVMVersion ProtoConverter::evmVersionMapping(Program_Version const& _ver)
return EVMVersion::paris();
case Program::SHANGHAI:
return EVMVersion::shanghai();
case Program::CANCUN:
return EVMVersion::cancun();
}
}

Expand Down Expand Up @@ -761,6 +763,22 @@ void ProtoConverter::visit(NullaryOp const& _x)
else
m_output << dictionaryToken();
break;
case NullaryOp::BASEFEE:
// Replace calls to basefee() on unsupported EVMs with a dictionary
// token.
if (m_evmVersion.hasBaseFee())
m_output << "basefee()";
else
m_output << dictionaryToken();
break;
case NullaryOp::BLOBBASEFEE:
// Replace calls to blobbasefee() on unsupported EVMs with a dictionary
// token.
if (m_evmVersion.hasBlobBaseFee())
m_output << "blobbasefee()";
else
m_output << dictionaryToken();
break;
}
}

Expand Down
3 changes: 3 additions & 0 deletions test/tools/ossfuzz/yulProto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ message NullaryOp {
GASLIMIT = 15;
SELFBALANCE = 16;
CHAINID = 17;
BASEFEE = 18;
BLOBBASEFEE = 19;
}
required NOp op = 1;
}
Expand Down Expand Up @@ -399,6 +401,7 @@ message Program {
LONDON = 8;
PARIS = 9;
SHANGHAI = 10;
CANCUN = 11;
}
oneof program_oneof {
Block block = 1;
Expand Down