@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.
- package/package.json +3 -3
- package/script/Deploy.s.sol +125 -139
- package/script/helpers/SuckerDeploymentLib.sol +10 -12
- package/src/JBArbitrumSucker.sol +5 -2
- package/src/JBCCIPSucker.sol +3 -3
- package/src/JBCeloSucker.sol +2 -0
- package/src/JBOptimismSucker.sol +2 -0
- package/src/JBSucker.sol +42 -8
- package/src/JBSuckerRegistry.sol +79 -60
- package/src/JBSwapCCIPSucker.sol +38 -101
- package/src/deployers/JBSwapCCIPSuckerDeployer.sol +17 -17
- package/src/interfaces/IJBSucker.sol +11 -6
- package/src/interfaces/IJBSuckerRegistry.sol +6 -3
- package/src/interfaces/IL1ArbitrumGateway.sol +10 -10
- package/src/libraries/CCIPHelper.sol +64 -64
- package/src/libraries/JBCCIPLib.sol +18 -0
- package/src/libraries/JBRelayBeneficiary.sol +1 -1
- package/src/libraries/JBSuckerLib.sol +157 -161
- package/src/libraries/JBSwapPoolLib.sol +268 -268
- package/src/structs/PeerValueScratch.sol +18 -0
- package/src/utils/MerkleLib.sol +108 -108
package/src/utils/MerkleLib.sol
CHANGED
|
@@ -849,187 +849,187 @@ library MerkleLib {
|
|
|
849
849
|
}
|
|
850
850
|
|
|
851
851
|
/**
|
|
852
|
-
* @notice Calculates and returns the merkle root for the given leaf `
|
|
853
|
-
* a merkle branch, and the index of `
|
|
854
|
-
* @param
|
|
855
|
-
* @param
|
|
856
|
-
* @param
|
|
857
|
-
* @return
|
|
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
|
|
862
|
-
bytes32[TREE_DEPTH] memory
|
|
863
|
-
uint256
|
|
861
|
+
bytes32 item,
|
|
862
|
+
bytes32[TREE_DEPTH] memory branch,
|
|
863
|
+
uint256 index
|
|
864
864
|
)
|
|
865
865
|
internal
|
|
866
866
|
pure
|
|
867
|
-
returns (bytes32
|
|
867
|
+
returns (bytes32 current)
|
|
868
868
|
{
|
|
869
869
|
assembly {
|
|
870
|
-
|
|
871
|
-
let BRANCH_DATA_OFFSET :=
|
|
870
|
+
current := item
|
|
871
|
+
let BRANCH_DATA_OFFSET := branch
|
|
872
872
|
let f
|
|
873
873
|
|
|
874
|
-
f := shl(5, and(
|
|
875
|
-
mstore(f,
|
|
874
|
+
f := shl(5, and(index, 1))
|
|
875
|
+
mstore(f, current)
|
|
876
876
|
mstore(sub(0x20, f), mload(BRANCH_DATA_OFFSET))
|
|
877
|
-
|
|
877
|
+
current := keccak256(0, 0x40)
|
|
878
878
|
|
|
879
|
-
f := shl(5, iszero(and(
|
|
880
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
882
|
+
current := keccak256(0, 0x40)
|
|
883
883
|
|
|
884
|
-
f := shl(5, iszero(and(
|
|
885
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
887
|
+
current := keccak256(0, 0x40)
|
|
888
888
|
|
|
889
|
-
f := shl(5, iszero(and(
|
|
890
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
892
|
+
current := keccak256(0, 0x40)
|
|
893
893
|
|
|
894
|
-
f := shl(5, iszero(and(
|
|
895
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
897
|
+
current := keccak256(0, 0x40)
|
|
898
898
|
|
|
899
|
-
f := shl(5, iszero(and(
|
|
900
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
902
|
+
current := keccak256(0, 0x40)
|
|
903
903
|
|
|
904
|
-
f := shl(5, iszero(and(
|
|
905
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
907
|
+
current := keccak256(0, 0x40)
|
|
908
908
|
|
|
909
|
-
f := shl(5, iszero(and(
|
|
910
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
912
|
+
current := keccak256(0, 0x40)
|
|
913
913
|
|
|
914
|
-
f := shl(5, iszero(and(
|
|
915
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
917
|
+
current := keccak256(0, 0x40)
|
|
918
918
|
|
|
919
|
-
f := shl(5, iszero(and(
|
|
920
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
922
|
+
current := keccak256(0, 0x40)
|
|
923
923
|
|
|
924
|
-
f := shl(5, iszero(and(
|
|
925
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
927
|
+
current := keccak256(0, 0x40)
|
|
928
928
|
|
|
929
|
-
f := shl(5, iszero(and(
|
|
930
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
932
|
+
current := keccak256(0, 0x40)
|
|
933
933
|
|
|
934
|
-
f := shl(5, iszero(and(
|
|
935
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
937
|
+
current := keccak256(0, 0x40)
|
|
938
938
|
|
|
939
|
-
f := shl(5, iszero(and(
|
|
940
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
942
|
+
current := keccak256(0, 0x40)
|
|
943
943
|
|
|
944
|
-
f := shl(5, iszero(and(
|
|
945
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
947
|
+
current := keccak256(0, 0x40)
|
|
948
948
|
|
|
949
|
-
f := shl(5, iszero(and(
|
|
950
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
952
|
+
current := keccak256(0, 0x40)
|
|
953
953
|
|
|
954
|
-
f := shl(5, iszero(and(
|
|
955
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
957
|
+
current := keccak256(0, 0x40)
|
|
958
958
|
|
|
959
|
-
f := shl(5, iszero(and(
|
|
960
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
962
|
+
current := keccak256(0, 0x40)
|
|
963
963
|
|
|
964
|
-
f := shl(5, iszero(and(
|
|
965
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
967
|
+
current := keccak256(0, 0x40)
|
|
968
968
|
|
|
969
|
-
f := shl(5, iszero(and(
|
|
970
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
972
|
+
current := keccak256(0, 0x40)
|
|
973
973
|
|
|
974
|
-
f := shl(5, iszero(and(
|
|
975
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
977
|
+
current := keccak256(0, 0x40)
|
|
978
978
|
|
|
979
|
-
f := shl(5, iszero(and(
|
|
980
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
982
|
+
current := keccak256(0, 0x40)
|
|
983
983
|
|
|
984
|
-
f := shl(5, iszero(and(
|
|
985
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
987
|
+
current := keccak256(0, 0x40)
|
|
988
988
|
|
|
989
|
-
f := shl(5, iszero(and(
|
|
990
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
992
|
+
current := keccak256(0, 0x40)
|
|
993
993
|
|
|
994
|
-
f := shl(5, iszero(and(
|
|
995
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
997
|
+
current := keccak256(0, 0x40)
|
|
998
998
|
|
|
999
|
-
f := shl(5, iszero(and(
|
|
1000
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1002
|
+
current := keccak256(0, 0x40)
|
|
1003
1003
|
|
|
1004
|
-
f := shl(5, iszero(and(
|
|
1005
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1007
|
+
current := keccak256(0, 0x40)
|
|
1008
1008
|
|
|
1009
|
-
f := shl(5, iszero(and(
|
|
1010
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1012
|
+
current := keccak256(0, 0x40)
|
|
1013
1013
|
|
|
1014
|
-
f := shl(5, iszero(and(
|
|
1015
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1017
|
+
current := keccak256(0, 0x40)
|
|
1018
1018
|
|
|
1019
|
-
f := shl(5, iszero(and(
|
|
1020
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1022
|
+
current := keccak256(0, 0x40)
|
|
1023
1023
|
|
|
1024
|
-
f := shl(5, iszero(and(
|
|
1025
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1027
|
+
current := keccak256(0, 0x40)
|
|
1028
1028
|
|
|
1029
|
-
f := shl(5, iszero(and(
|
|
1030
|
-
mstore(sub(0x20, f),
|
|
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
|
-
|
|
1032
|
+
current := keccak256(0, 0x40)
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|