[Sol->Yul] Implement index access for storage arrays

This commit is contained in:
Mathias Baumann
2019-06-20 16:14:51 +02:00
parent 346c512cd7
commit 1dd63f416e
7 changed files with 175 additions and 2 deletions
+6
View File
@@ -136,6 +136,12 @@ public:
/// a memory pointer or a calldata pointer to the slot number / memory pointer / calldata pointer
/// for the data position of an array which is stored in that slot / memory area / calldata area.
std::string arrayDataAreaFunction(ArrayType const& _type);
/// @returns the name of a function that returns the slot and offset for the
/// given array and index
/// signature: (array, index) -> slot, offset
std::string storageArrayIndexAccessFunction(ArrayType const& _type);
/// @returns the name of a function that advances an array data pointer to the next element.
/// Only works for memory arrays, calldata arrays and storage arrays that store one item per slot.
std::string nextArrayElementFunction(ArrayType const& _type);