@bananapus/suckers-v6 0.0.47 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -849,187 +849,187 @@ library MerkleLib {
849
849
  }
850
850
 
851
851
  /**
852
- * @notice Calculates and returns the merkle root for the given leaf `_item`,
853
- * a merkle branch, and the index of `_item` in the tree.
854
- * @param _item Merkle leaf
855
- * @param _branch Merkle proof
856
- * @param _index Index of `_item` in tree
857
- * @return _current Calculated merkle root
852
+ * @notice Calculates and returns the merkle root for the given leaf `item`,
853
+ * a merkle branch, and the index of `item` in the tree.
854
+ * @param item Merkle leaf
855
+ * @param branch Merkle proof
856
+ * @param index Index of `item` in tree
857
+ * @return current Calculated merkle root
858
858
  *
859
859
  */
860
860
  function branchRoot(
861
- bytes32 _item,
862
- bytes32[TREE_DEPTH] memory _branch,
863
- uint256 _index
861
+ bytes32 item,
862
+ bytes32[TREE_DEPTH] memory branch,
863
+ uint256 index
864
864
  )
865
865
  internal
866
866
  pure
867
- returns (bytes32 _current)
867
+ returns (bytes32 current)
868
868
  {
869
869
  assembly {
870
- _current := _item
871
- let BRANCH_DATA_OFFSET := _branch
870
+ current := item
871
+ let BRANCH_DATA_OFFSET := branch
872
872
  let f
873
873
 
874
- f := shl(5, and(_index, 1))
875
- mstore(f, _current)
874
+ f := shl(5, and(index, 1))
875
+ mstore(f, current)
876
876
  mstore(sub(0x20, f), mload(BRANCH_DATA_OFFSET))
877
- _current := keccak256(0, 0x40)
877
+ current := keccak256(0, 0x40)
878
878
 
879
- f := shl(5, iszero(and(_index, shl(1, 1))))
880
- mstore(sub(0x20, f), _current)
879
+ f := shl(5, iszero(and(index, shl(1, 1))))
880
+ mstore(sub(0x20, f), current)
881
881
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 1))))
882
- _current := keccak256(0, 0x40)
882
+ current := keccak256(0, 0x40)
883
883
 
884
- f := shl(5, iszero(and(_index, shl(2, 1))))
885
- mstore(sub(0x20, f), _current)
884
+ f := shl(5, iszero(and(index, shl(2, 1))))
885
+ mstore(sub(0x20, f), current)
886
886
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 2))))
887
- _current := keccak256(0, 0x40)
887
+ current := keccak256(0, 0x40)
888
888
 
889
- f := shl(5, iszero(and(_index, shl(3, 1))))
890
- mstore(sub(0x20, f), _current)
889
+ f := shl(5, iszero(and(index, shl(3, 1))))
890
+ mstore(sub(0x20, f), current)
891
891
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 3))))
892
- _current := keccak256(0, 0x40)
892
+ current := keccak256(0, 0x40)
893
893
 
894
- f := shl(5, iszero(and(_index, shl(4, 1))))
895
- mstore(sub(0x20, f), _current)
894
+ f := shl(5, iszero(and(index, shl(4, 1))))
895
+ mstore(sub(0x20, f), current)
896
896
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 4))))
897
- _current := keccak256(0, 0x40)
897
+ current := keccak256(0, 0x40)
898
898
 
899
- f := shl(5, iszero(and(_index, shl(5, 1))))
900
- mstore(sub(0x20, f), _current)
899
+ f := shl(5, iszero(and(index, shl(5, 1))))
900
+ mstore(sub(0x20, f), current)
901
901
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 5))))
902
- _current := keccak256(0, 0x40)
902
+ current := keccak256(0, 0x40)
903
903
 
904
- f := shl(5, iszero(and(_index, shl(6, 1))))
905
- mstore(sub(0x20, f), _current)
904
+ f := shl(5, iszero(and(index, shl(6, 1))))
905
+ mstore(sub(0x20, f), current)
906
906
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 6))))
907
- _current := keccak256(0, 0x40)
907
+ current := keccak256(0, 0x40)
908
908
 
909
- f := shl(5, iszero(and(_index, shl(7, 1))))
910
- mstore(sub(0x20, f), _current)
909
+ f := shl(5, iszero(and(index, shl(7, 1))))
910
+ mstore(sub(0x20, f), current)
911
911
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 7))))
912
- _current := keccak256(0, 0x40)
912
+ current := keccak256(0, 0x40)
913
913
 
914
- f := shl(5, iszero(and(_index, shl(8, 1))))
915
- mstore(sub(0x20, f), _current)
914
+ f := shl(5, iszero(and(index, shl(8, 1))))
915
+ mstore(sub(0x20, f), current)
916
916
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 8))))
917
- _current := keccak256(0, 0x40)
917
+ current := keccak256(0, 0x40)
918
918
 
919
- f := shl(5, iszero(and(_index, shl(9, 1))))
920
- mstore(sub(0x20, f), _current)
919
+ f := shl(5, iszero(and(index, shl(9, 1))))
920
+ mstore(sub(0x20, f), current)
921
921
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 9))))
922
- _current := keccak256(0, 0x40)
922
+ current := keccak256(0, 0x40)
923
923
 
924
- f := shl(5, iszero(and(_index, shl(10, 1))))
925
- mstore(sub(0x20, f), _current)
924
+ f := shl(5, iszero(and(index, shl(10, 1))))
925
+ mstore(sub(0x20, f), current)
926
926
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 10))))
927
- _current := keccak256(0, 0x40)
927
+ current := keccak256(0, 0x40)
928
928
 
929
- f := shl(5, iszero(and(_index, shl(11, 1))))
930
- mstore(sub(0x20, f), _current)
929
+ f := shl(5, iszero(and(index, shl(11, 1))))
930
+ mstore(sub(0x20, f), current)
931
931
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 11))))
932
- _current := keccak256(0, 0x40)
932
+ current := keccak256(0, 0x40)
933
933
 
934
- f := shl(5, iszero(and(_index, shl(12, 1))))
935
- mstore(sub(0x20, f), _current)
934
+ f := shl(5, iszero(and(index, shl(12, 1))))
935
+ mstore(sub(0x20, f), current)
936
936
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 12))))
937
- _current := keccak256(0, 0x40)
937
+ current := keccak256(0, 0x40)
938
938
 
939
- f := shl(5, iszero(and(_index, shl(13, 1))))
940
- mstore(sub(0x20, f), _current)
939
+ f := shl(5, iszero(and(index, shl(13, 1))))
940
+ mstore(sub(0x20, f), current)
941
941
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 13))))
942
- _current := keccak256(0, 0x40)
942
+ current := keccak256(0, 0x40)
943
943
 
944
- f := shl(5, iszero(and(_index, shl(14, 1))))
945
- mstore(sub(0x20, f), _current)
944
+ f := shl(5, iszero(and(index, shl(14, 1))))
945
+ mstore(sub(0x20, f), current)
946
946
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 14))))
947
- _current := keccak256(0, 0x40)
947
+ current := keccak256(0, 0x40)
948
948
 
949
- f := shl(5, iszero(and(_index, shl(15, 1))))
950
- mstore(sub(0x20, f), _current)
949
+ f := shl(5, iszero(and(index, shl(15, 1))))
950
+ mstore(sub(0x20, f), current)
951
951
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 15))))
952
- _current := keccak256(0, 0x40)
952
+ current := keccak256(0, 0x40)
953
953
 
954
- f := shl(5, iszero(and(_index, shl(16, 1))))
955
- mstore(sub(0x20, f), _current)
954
+ f := shl(5, iszero(and(index, shl(16, 1))))
955
+ mstore(sub(0x20, f), current)
956
956
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 16))))
957
- _current := keccak256(0, 0x40)
957
+ current := keccak256(0, 0x40)
958
958
 
959
- f := shl(5, iszero(and(_index, shl(17, 1))))
960
- mstore(sub(0x20, f), _current)
959
+ f := shl(5, iszero(and(index, shl(17, 1))))
960
+ mstore(sub(0x20, f), current)
961
961
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 17))))
962
- _current := keccak256(0, 0x40)
962
+ current := keccak256(0, 0x40)
963
963
 
964
- f := shl(5, iszero(and(_index, shl(18, 1))))
965
- mstore(sub(0x20, f), _current)
964
+ f := shl(5, iszero(and(index, shl(18, 1))))
965
+ mstore(sub(0x20, f), current)
966
966
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 18))))
967
- _current := keccak256(0, 0x40)
967
+ current := keccak256(0, 0x40)
968
968
 
969
- f := shl(5, iszero(and(_index, shl(19, 1))))
970
- mstore(sub(0x20, f), _current)
969
+ f := shl(5, iszero(and(index, shl(19, 1))))
970
+ mstore(sub(0x20, f), current)
971
971
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 19))))
972
- _current := keccak256(0, 0x40)
972
+ current := keccak256(0, 0x40)
973
973
 
974
- f := shl(5, iszero(and(_index, shl(20, 1))))
975
- mstore(sub(0x20, f), _current)
974
+ f := shl(5, iszero(and(index, shl(20, 1))))
975
+ mstore(sub(0x20, f), current)
976
976
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 20))))
977
- _current := keccak256(0, 0x40)
977
+ current := keccak256(0, 0x40)
978
978
 
979
- f := shl(5, iszero(and(_index, shl(21, 1))))
980
- mstore(sub(0x20, f), _current)
979
+ f := shl(5, iszero(and(index, shl(21, 1))))
980
+ mstore(sub(0x20, f), current)
981
981
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 21))))
982
- _current := keccak256(0, 0x40)
982
+ current := keccak256(0, 0x40)
983
983
 
984
- f := shl(5, iszero(and(_index, shl(22, 1))))
985
- mstore(sub(0x20, f), _current)
984
+ f := shl(5, iszero(and(index, shl(22, 1))))
985
+ mstore(sub(0x20, f), current)
986
986
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 22))))
987
- _current := keccak256(0, 0x40)
987
+ current := keccak256(0, 0x40)
988
988
 
989
- f := shl(5, iszero(and(_index, shl(23, 1))))
990
- mstore(sub(0x20, f), _current)
989
+ f := shl(5, iszero(and(index, shl(23, 1))))
990
+ mstore(sub(0x20, f), current)
991
991
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 23))))
992
- _current := keccak256(0, 0x40)
992
+ current := keccak256(0, 0x40)
993
993
 
994
- f := shl(5, iszero(and(_index, shl(24, 1))))
995
- mstore(sub(0x20, f), _current)
994
+ f := shl(5, iszero(and(index, shl(24, 1))))
995
+ mstore(sub(0x20, f), current)
996
996
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 24))))
997
- _current := keccak256(0, 0x40)
997
+ current := keccak256(0, 0x40)
998
998
 
999
- f := shl(5, iszero(and(_index, shl(25, 1))))
1000
- mstore(sub(0x20, f), _current)
999
+ f := shl(5, iszero(and(index, shl(25, 1))))
1000
+ mstore(sub(0x20, f), current)
1001
1001
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 25))))
1002
- _current := keccak256(0, 0x40)
1002
+ current := keccak256(0, 0x40)
1003
1003
 
1004
- f := shl(5, iszero(and(_index, shl(26, 1))))
1005
- mstore(sub(0x20, f), _current)
1004
+ f := shl(5, iszero(and(index, shl(26, 1))))
1005
+ mstore(sub(0x20, f), current)
1006
1006
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 26))))
1007
- _current := keccak256(0, 0x40)
1007
+ current := keccak256(0, 0x40)
1008
1008
 
1009
- f := shl(5, iszero(and(_index, shl(27, 1))))
1010
- mstore(sub(0x20, f), _current)
1009
+ f := shl(5, iszero(and(index, shl(27, 1))))
1010
+ mstore(sub(0x20, f), current)
1011
1011
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 27))))
1012
- _current := keccak256(0, 0x40)
1012
+ current := keccak256(0, 0x40)
1013
1013
 
1014
- f := shl(5, iszero(and(_index, shl(28, 1))))
1015
- mstore(sub(0x20, f), _current)
1014
+ f := shl(5, iszero(and(index, shl(28, 1))))
1015
+ mstore(sub(0x20, f), current)
1016
1016
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 28))))
1017
- _current := keccak256(0, 0x40)
1017
+ current := keccak256(0, 0x40)
1018
1018
 
1019
- f := shl(5, iszero(and(_index, shl(29, 1))))
1020
- mstore(sub(0x20, f), _current)
1019
+ f := shl(5, iszero(and(index, shl(29, 1))))
1020
+ mstore(sub(0x20, f), current)
1021
1021
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 29))))
1022
- _current := keccak256(0, 0x40)
1022
+ current := keccak256(0, 0x40)
1023
1023
 
1024
- f := shl(5, iszero(and(_index, shl(30, 1))))
1025
- mstore(sub(0x20, f), _current)
1024
+ f := shl(5, iszero(and(index, shl(30, 1))))
1025
+ mstore(sub(0x20, f), current)
1026
1026
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 30))))
1027
- _current := keccak256(0, 0x40)
1027
+ current := keccak256(0, 0x40)
1028
1028
 
1029
- f := shl(5, iszero(and(_index, shl(31, 1))))
1030
- mstore(sub(0x20, f), _current)
1029
+ f := shl(5, iszero(and(index, shl(31, 1))))
1030
+ mstore(sub(0x20, f), current)
1031
1031
  mstore(f, mload(add(BRANCH_DATA_OFFSET, shl(5, 31))))
1032
- _current := keccak256(0, 0x40)
1032
+ current := keccak256(0, 0x40)
1033
1033
  }
1034
1034
  }
1035
1035
  }