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

Method revertWithStringData

libsolidity/codegen/CompilerUtils.cpp:93–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void CompilerUtils::revertWithStringData(Type const& _argumentType)
94{
95 solAssert(_argumentType.isImplicitlyConvertibleTo(*TypeProvider::fromElementaryTypeName("string memory")));
96 fetchFreeMemoryPointer();
97 m_context << util::selectorFromSignatureU256("Error(string)");
98 m_context << Instruction::DUP2 << Instruction::MSTORE;
99 m_context << u256(4) << Instruction::ADD;
100 // Stack: <string data> <mem pos of encoding start>
101 abiEncode({&_argumentType}, {TypeProvider::array(DataLocation::Memory, true)});
102 toSizeAfterFreeMemoryPointer();
103 m_context << Instruction::REVERT;
104}
105
106void CompilerUtils::revertWithError(
107 std::string const& _signature,

Callers 1

visitMethod · 0.80

Calls 2

Tested by

no test coverage detected