1

Let's assume we have something like:

contract C {
   function externalFunction(uint256[] calldata data) external {
      privateFunction(data);
   }

   function privateFunction(uint256[] memory data) private {
   }
}

If I access data from within externalFuction it will read it from calldata, since it is referenced type, thus saving gas. But what will happen when it gets to internalFunction? Will it create a memory copy of array or will it read it from the same location since it will JUMP there from externalFunction?

Referenced documentation would be highly appreciated.

  • Anybody knows anything about this matter? – KwahuNashoba Jun 3 '19 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.