MCPcopy Create free account
hub / github.com/argotorg/solidity / forwardingRevertFunction

Method forwardingRevertFunction

libsolidity/codegen/YulUtilFunctions.cpp:4147–4172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4145}
4146
4147std::string YulUtilFunctions::forwardingRevertFunction()
4148{
4149 bool forward = m_evmVersion.supportsReturndata();
4150 std::string functionName = "revert_forward_" + std::to_string(forward);
4151 return m_functionCollector.createFunction(functionName, [&]() {
4152 if (forward)
4153 return Whiskers(R"(
4154 function <functionName>() {
4155 let pos := <allocateUnbounded>()
4156 returndatacopy(pos, 0, returndatasize())
4157 revert(pos, returndatasize())
4158 }
4159 )")
4160 ("functionName", functionName)
4161 ("allocateUnbounded", allocateUnboundedFunction())
4162 .render();
4163 else
4164 return Whiskers(R"(
4165 function <functionName>() {
4166 revert(0, 0)
4167 }
4168 )")
4169 ("functionName", functionName)
4170 .render();
4171 });
4172}
4173
4174std::string YulUtilFunctions::decrementCheckedFunction(Type const& _type)
4175{

Callers 3

endVisitMethod · 0.80
handleCatchMethod · 0.80

Calls 5

WhiskersClass · 0.85
supportsReturndataMethod · 0.80
renderMethod · 0.80
to_stringFunction · 0.50
createFunctionMethod · 0.45

Tested by

no test coverage detected