Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@wanseob wanseob released this 05 Jan 09:33

Breaking changes

  1. Uses width instead of the total size of MMR for inclusion proof
  2. Supports roll up function for optimistic roll up
  3. Leaf hash method is changed
  • before:
    function hashLeaf(uint256 index, bytes memory data) public pure returns (bytes32) {
        return keccak256(abi.encodePacked(index, data));
    }
  • after:
    function hashLeaf(uint256 index, bytes32 memory hashedData) public pure returns (bytes32) {
        return keccak256(abi.encodePacked(index, hashedData));
    }
    Data will be hashed before getting hashed with the index

Interface changes

  1. hashLeaf

    • before:
      function hashLeaf(uint256 index, bytes memory data) public pure returns (bytes32)
    • after:
      function hashLeaf(uint256 index, bytes32 hashedData) public pure returns (bytes32)
  2. getMerlkeProof()

    • before:
      function getMerkleProof(uint256 index) public view returns (
          bytes32 root,
          uint256 size,
          bytes32[] memory peakBagging,
          bytes32[] memory siblings
      )
    • after:
      function getMerkleProof(uint256 index) public view returns (
          bytes32 root,
          uint256 width,
          bytes32[] memory peakBagging,
          bytes32[] memory siblings
      )
  3. inclusionProof

    • before:
      function hashLeaf(uint256 index, bytes memory data) public pure returns (bytes32)
    • after:
      function hashLeaf(uint256 index, bytes32 hashedData) public pure returns (bytes32)
  4. getPeaks -> getPeakIndexes

    • before:
      function getPeaks(uint256 size) public pure returns (uint256[] memory peaks)
    • after:
      function getPeakIndexes(uint256 width) public pure returns (uint256[] memory peakIndexes)