Created
October 6, 2017 17:13
-
-
Save oscarguindzberg/fba0086c185022ef2def66841fc80c1f to your computer and use it in GitHub Desktop.
subarray in solidity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bytes myByteArrayInStorage = ....; | |
uint pointer; | |
assembly { | |
pointer := myByteArrayInStorage_slot | |
} | |
uint pointer2 = uint(keccak256(bytes32(pointer))); | |
uint firstWord; | |
uint secondWord; | |
assembly { | |
firstWord := sload(pointer2) | |
secondWord := sload(add(pointer2,1)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment