Refactoring copyLiteralToMemoryFunction and reusing it from other functions.

Co-authored-by: Leonardo <leo@ethereum.org>

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
This commit is contained in:
Djordje Mijovic
2020-12-30 17:31:20 +01:00
co-authored by Leonardo Alex Beregszaszi
parent b74c08143f
commit 047d693ac9
4 changed files with 37 additions and 47 deletions
+7 -3
View File
@@ -72,10 +72,14 @@ public:
/// Pads with zeros and might write more than exactly length.
std::string copyToMemoryFunction(bool _fromCalldata);
/// @returns a function name that copies string literal to memory
/// and returns pointer to memory array containing it
/// @returns the name of a function that copies a string literal to memory
/// and returns a pointer to the memory area containing the string literal.
/// signature: () -> memPtr
std::string copyToMemoryLiteralFunction(std::string const& _literal);
std::string copyLiteralToMemoryFunction(std::string const& _literal);
/// @returns the name of a function that stores a string literal at a specific location in memory
/// signature: (memPtr) ->
std::string storeLiteralInMemoryFunction(std::string const& _literal);
// @returns the name of a function that has the equivalent logic of an
// `assert` or `require` call.