| 4636 | } |
| 4637 | |
| 4638 | std::string YulUtilFunctions::panicFunction(util::PanicCode _code) |
| 4639 | { |
| 4640 | std::string functionName = "panic_error_" + toCompactHexWithPrefix(uint64_t(_code)); |
| 4641 | return m_functionCollector.createFunction(functionName, [&]() { |
| 4642 | return Whiskers(R"( |
| 4643 | function <functionName>() { |
| 4644 | mstore(0, <selector>) |
| 4645 | mstore(4, <code>) |
| 4646 | revert(0, 0x24) |
| 4647 | } |
| 4648 | )") |
| 4649 | ("functionName", functionName) |
| 4650 | ("selector", util::selectorFromSignatureU256("Panic(uint256)").str()) |
| 4651 | ("code", toCompactHexWithPrefix(static_cast<unsigned>(_code))) |
| 4652 | .render(); |
| 4653 | }); |
| 4654 | } |
| 4655 | |
| 4656 | std::string YulUtilFunctions::returnDataSelectorFunction() |
| 4657 | { |
no test coverage detected