Skip to content

Instantly share code, notes, and snippets.

@ylv-io
Created November 18, 2018 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ylv-io/a3b167b0d45f32884391aae5f80c94b0 to your computer and use it in GitHub Desktop.
Save ylv-io/a3b167b0d45f32884391aae5f80c94b0 to your computer and use it in GitHub Desktop.
contract Calc {
bytes32 public one;
uint public index;
uint public length;
bytes32 public lengthBytes;
function getIndex() {
one = keccak256(bytes32(1));
index = 2 ** 256 - 1 - uint(one) + 1;
}
function getLength() {
length = 2 ** 200 + 1;
lengthBytes = bytes32(length);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment