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

Method extractFromStorageValue

libsolidity/codegen/YulUtilFunctions.cpp:3137–3151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3135}
3136
3137std::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
3153std::string YulUtilFunctions::cleanupFromStorageFunction(Type const& _type)
3154{

Calls 5

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

Tested by

no test coverage detected