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

Method erc7201

libsolidity/codegen/YulUtilFunctions.cpp:1300–1315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1298}
1299
1300std::string YulUtilFunctions::erc7201()
1301{
1302 std::string functionName = "erc7201";
1303 return m_functionCollector.createFunction(functionName, [&]() {
1304 Whiskers templ(R"(
1305 function erc7201(namespaceIDDataPtr, namespaceIDLength) -> slot {
1306 let innerKeccak := keccak256(namespaceIDDataPtr, namespaceIDLength)
1307 mstore(0, sub(innerKeccak, 1))
1308 // slot = keccak256(keccak256(id) - 1) & ~0xff
1309 slot := and(keccak256(0, 32), not(0xff))
1310 }
1311 )");
1312
1313 return templ.render();
1314 });
1315}
1316
1317std::string YulUtilFunctions::arrayLengthFunction(ArrayType const& _type)
1318{

Callers 2

visitMethod · 0.80
endVisitMethod · 0.80

Calls 2

renderMethod · 0.80
createFunctionMethod · 0.45

Tested by

no test coverage detected