| 3135 | } |
| 3136 | |
| 3137 | std::string YulUtilFunctions::extractFromStorageValue(Type const& _type, size_t _offset) |
| 3138 | { |
| 3139 | std::string functionName = "extract_from_storage_value_offset_" + std::to_string(_offset) + "_" + _type.identifier(); |
| 3140 | return m_functionCollector.createFunction(functionName, [&] { |
| 3141 | return Whiskers(R"( |
| 3142 | function <functionName>(slot_value) -> value { |
| 3143 | value := <cleanupStorage>(<shr>(slot_value)) |
| 3144 | } |
| 3145 | )") |
| 3146 | ("functionName", functionName) |
| 3147 | ("shr", shiftRightFunction(_offset * 8)) |
| 3148 | ("cleanupStorage", cleanupFromStorageFunction(_type)) |
| 3149 | .render(); |
| 3150 | }); |
| 3151 | } |
| 3152 | |
| 3153 | std::string YulUtilFunctions::cleanupFromStorageFunction(Type const& _type) |
| 3154 | { |
no test coverage detected