Skip to content

Updates to Solidity 0.6.4 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contracts/MerklePatriciaProof.sol
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ library MerklePatriciaProof {
* @param root The root hash of the trie.
* @return The boolean validity of the proof.
*/
function verify(bytes value, bytes encodedPath, bytes rlpParentNodes, bytes32 root) internal constant returns (bool) {
function verify(bytes memory value, bytes memory encodedPath, bytes memory rlpParentNodes, bytes32 root) internal pure returns (bool) {
RLP.RLPItem memory item = RLP.toRLPItem(rlpParentNodes);
RLP.RLPItem[] memory parentNodes = RLP.toList(item);

@@ -71,7 +71,7 @@ library MerklePatriciaProof {
}
}

function _nibblesToTraverse(bytes encodedPartialPath, bytes path, uint pathPtr) private constant returns (uint) {
function _nibblesToTraverse(bytes memory encodedPartialPath, bytes memory path, uint pathPtr) private pure returns (uint) {
uint len;
// encodedPartialPath has elements that are each two hex characters (1 byte), but partialPath
// and slicedPath have elements that are each one hex character (1 nibble)
@@ -94,7 +94,7 @@ library MerklePatriciaProof {
}

// bytes b must be hp encoded
function _getNibbleArray(bytes b) private constant returns (bytes) {
function _getNibbleArray(bytes memory b) private pure returns (bytes memory) {
bytes memory nibbles;
if(b.length>0) {
uint8 offset;
@@ -116,7 +116,7 @@ library MerklePatriciaProof {
return nibbles;
}

function _getNthNibbleOfBytes(uint n, bytes str) private constant returns (byte) {
function _getNthNibbleOfBytes(uint n, bytes memory str) private pure returns (byte) {
return byte(n%2==0 ? uint8(str[n/2])/0x10 : uint8(str[n/2])%0x10);
}
}
Loading