Created
June 11, 2019 20:08
-
-
Save dangerousfood/4086c2e0e9227c66ee1003d62b8910d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@public | |
@constant | |
def get_deposit_root() -> bytes32: | |
root: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000 | |
size: uint256 = self.deposit_count | |
for h in range(DEPOSIT_CONTRACT_TREE_DEPTH): | |
if bitwise_and(size, 1) == 1: | |
root = sha3(concat(self.branch[h], root)) | |
else: | |
root = sha3(concat(root, self.zerohashes[h])) | |
size /= 2 | |
return root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment